/* Home Blend Guide — Caribbean editorial */

html[data-font-size="sm"] { font-size: 100%; }
html[data-font-size="md"] { font-size: 112.5%; }
html[data-font-size="lg"] { font-size: 125%; }
html[data-font-size="xl"] { font-size: 137.5%; }

:root {
  --navy: #0b2a4a;
  --ink: #0b2a4a;
  --ink-soft: #33516f;
  --ocean: #075f78;
  --turquoise: #18b5b0;
  --aqua: #7fdcd6;
  --seafoam: #e3f7f3;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-tint: #f2fbfa;
  --line: rgba(11, 42, 74, 0.12);
  --coral: #b23a1a;
  --coral-bg: #fff1ec;
  --coral-line: #f4a68e;
  --link: #075f78;
  --btn-bg: #075f78;
  --btn-text: #ffffff;
  --btn-quiet-text: #075f78;
  --btn-quiet-line: #0b7a8f;
  --nav-glass: rgba(255, 255, 255, 0.82);
  --hero-grad: linear-gradient(140deg, #e7faf7 0%, #d4f3f1 40%, #e9f6fd 100%);
  --shadow: 0 1.25rem 2.75rem -1.75rem rgba(11, 42, 74, 0.35);
  --tag-bg: #e3f7f3;
  --tag-text: #0a5a5c;
  --size-on-bg: #075f78;
  --size-on-text: #ffffff;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #e6f5f7;
  --ink-soft: #b6d3dc;
  --ocean: #7fd8de;
  --page: #061a2c;
  --surface: #0b2640;
  --surface-tint: #0a2238;
  --line: rgba(127, 220, 214, 0.18);
  --coral: #ffab92;
  --coral-bg: #2a1a1e;
  --coral-line: #a8523d;
  --link: #8fe3e6;
  --btn-bg: #7fdcd6;
  --btn-text: #062033;
  --btn-quiet-text: #9be6e3;
  --btn-quiet-line: #5fbfbf;
  --nav-glass: rgba(6, 26, 44, 0.8);
  --hero-grad: linear-gradient(140deg, #08304a 0%, #0a3a4e 45%, #072a40 100%);
  --shadow: 0 1.25rem 2.75rem -1.75rem rgba(0, 0, 0, 0.7);
  --tag-bg: #0f3a4c;
  --tag-text: #aeeee9;
  --size-on-bg: #7fdcd6;
  --size-on-text: #062033;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background-color: var(--page);
  color: var(--ink);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
}

h1, h2, h3 {
  font-family: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}
p { margin: 0; }
a { color: var(--link); text-underline-offset: 0.15em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 0.16rem solid var(--turquoise); outline-offset: 0.15rem; }
ul, ol, dl { text-align: left; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink);
}
.skip:focus { top: calc(0.75rem + env(safe-area-inset-top, 0px)); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    background: var(--nav-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
  }
}
.nav-row {
  padding: 0.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, #0b7a8f, #18b5b0);
  color: #ffffff;
  flex: none;
}
.brand-mark svg { width: 1.35rem; height: 1.35rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.brand-name { font-family: "Newsreader", Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: 0.78rem; color: var(--ink-soft); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15rem 0.35rem; }
.links a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 0.35rem 0.6rem; border-radius: 0.55rem; }
.links a:hover, .links a[aria-current="page"] { color: var(--ink); background: var(--tag-bg); }
.prefs { display: flex; align-items: center; gap: 0.5rem; }
.sizes { display: inline-flex; align-items: flex-end; border: 1px solid var(--line); border-radius: 0.65rem; padding: 0.15rem; }
.size-btn { border: 0; background: transparent; color: var(--ink-soft); min-width: 2rem; height: 2rem; border-radius: 0.5rem; cursor: pointer; font-weight: 700; line-height: 1; padding: 0 0.3rem; }
.size-btn.s1 { font-size: 0.75rem; }
.size-btn.s2 { font-size: 0.9rem; }
.size-btn.s3 { font-size: 1.05rem; }
.size-btn.s4 { font-size: 1.2rem; }
.size-btn[aria-pressed="true"] { background: var(--size-on-bg); color: var(--size-on-text); }
.theme-btn { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: 0.65rem; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.theme-btn svg { width: 1.15rem; height: 1.15rem; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-grad); padding: 2.25rem 1.25rem 2.5rem; }
.hero-inner { display: grid; gap: 1.75rem; align-items: center; }
.hero-inner > * { min-width: 0; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.6rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lede { margin: 1rem auto 0; font-size: 1.08rem; color: var(--ink-soft); max-width: 40rem; }
.hero-actions { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-bg);
  font-weight: 700;
  text-decoration: none;
}
.btn.quiet { background: transparent; color: var(--btn-quiet-text); border-color: var(--btn-quiet-line); }
.decode {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1.4rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.decode h2 { font-size: 1.35rem; margin-bottom: 0.8rem; }
.decode dl { margin: 0; display: grid; gap: 0.9rem; text-align: center; }
.decode dl div { display: grid; gap: 0.15rem; }
.decode dt { font-family: "Newsreader", Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 600; color: var(--ocean); line-height: 1.1; }
.decode dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Comparison table ---------- */
.compare { padding: 2.5rem 1.25rem 1rem; background: var(--page); }
.compare h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); margin-bottom: 1.25rem; }
.table-wrap { min-width: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
thead { display: none; }
tbody { display: grid; gap: 0.9rem; }
tbody tr {
  display: grid;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}
tbody th, tbody td { display: grid; gap: 0.1rem; padding: 0; font-weight: 400; overflow-wrap: anywhere; }
tbody th { font-family: "Newsreader", Georgia, "Times New Roman", serif; font-weight: 600; font-size: 1.2rem; color: var(--ocean); }
tbody td::before { content: attr(data-label); font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }

/* ---------- Layout: toc + entries ---------- */
.layout { padding: 1.5rem 1.25rem 2rem; display: grid; gap: 1.5rem; }
.layout > * { min-width: 0; }
.toc {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.1rem 1.2rem;
}
.toc h2 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.3rem; font-size: 0.92rem; }
.toc a { color: var(--ink); text-decoration-color: var(--aqua); }

.entries { display: grid; gap: 1.1rem; align-items: start; }
.entries:focus { outline: none; }
.loading { color: var(--ink-soft); }
.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1.4rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.entry::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.25rem;
  background: linear-gradient(90deg, #18b5b0, #7fdcd6, #0b7a8f);
}
.entry.is-safety { border-color: var(--coral-line); }
.entry.is-safety::before { background: linear-gradient(90deg, #e4572e, #f4a68e); }
.tags { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.tags li { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--tag-bg); color: var(--tag-text); }
.entry.is-safety .tags li { background: var(--coral-bg); color: var(--coral); }
.entry h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); overflow-wrap: anywhere; }
.summary { margin-top: 0.6rem; font-size: 1.06rem; font-weight: 600; color: var(--ink); }
.body { margin-top: 0.75rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.facts { margin: 1.1rem 0 0; display: grid; gap: 0.55rem; padding: 0.9rem 1rem; border-radius: 0.9rem; background: var(--surface-tint); border: 1px solid var(--line); }
.facts div { display: grid; gap: 0.05rem; min-width: 0; }
.facts dt { font-size: 0.78rem; font-weight: 700; color: var(--ocean); }
.facts dd { margin: 0; font-size: 0.93rem; overflow-wrap: anywhere; }
.facts .is-next { margin-top: 0.2rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.entry.is-safety .facts dt { color: var(--coral); }
.ask { display: inline-block; margin-top: 1rem; font-weight: 700; }

/* ---------- Sources & footer ---------- */
.sources { padding: 2rem 1.25rem 2.5rem; background: var(--surface-tint); border-top: 1px solid var(--line); }
.sources h2 { font-size: 1.5rem; margin-bottom: 0.8rem; }
.disclaimer {
  margin: 0 auto 1rem;
  max-width: 50rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: var(--coral-bg);
  color: var(--coral);
  border: 1px solid var(--coral-line);
  font-weight: 600;
}
.sources ul { margin: 0 auto; padding-left: 1.2rem; display: grid; gap: 0.35rem; max-width: 60rem; font-size: 0.92rem; }
.sources li { overflow-wrap: anywhere; }
.updated { margin-top: 1rem; font-size: 0.85rem; color: var(--ink-soft); }
.footer { padding: 1.5rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--ink-soft); }

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  body { text-align: left; }
  .nav-row { justify-content: space-between; padding: 0.6rem 2rem; }
  .hero { padding: 3rem 2rem 3.25rem; }
  .lede { margin-left: 0; }
  .hero-actions { justify-content: flex-start; }
  .tags { justify-content: flex-start; }
  .decode dl { text-align: left; }
  .compare, .layout, .sources, .footer { padding-left: 2rem; padding-right: 2rem; }
  .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .disclaimer { margin-left: 0; }
  .sources ul { margin-left: 0; }
}

@media (min-width: 900px) {
  thead { display: table-header-group; }
  tbody { display: table-row-group; }
  tbody tr { display: table-row; background: transparent; border: 0; box-shadow: none; padding: 0; }
  table { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow); }
  thead th { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); background: var(--surface-tint); padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
  tbody th, tbody td { display: table-cell; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
  tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
  tbody td::before { content: none; }
  tbody th { font-size: 1.1rem; width: 18%; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1100px) {
  .hero-inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3rem; }
  .layout { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
  .toc { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
}

@media (min-width: 1600px) {
  .hero, .compare, .layout, .sources, .footer { padding-left: 3.5rem; padding-right: 3.5rem; }
  .entries { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout { grid-template-columns: 19rem minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
