/* content.css — shared stylesheet for calvinhealth.com content pages.
 *
 * The homepage keeps its CSS inline (it is one page and its layout is bespoke).
 * Content pages share this file instead, so the twentieth guide looks like the
 * first without copying 200 lines into each one.
 *
 * Tokens are the app's, same as the homepage: AccentColor #4A7C59 / #8FBF9C and
 * LaunchBackground #F7F6F1 / #121412 from Cals/Assets.xcassets, with the gold
 * that marks metered things. Type mirrors the app's split — SF Pro Rounded
 * carries the page, serif italic marks section headings and nothing else.
 */

:root {
  --bg: #f7f5ee;
  --surface: #fffefa;
  --ink: #2b2b26;
  --muted: #6b6b60;
  --rule: #ddd8c8;
  --accent: #4a7c59;
  --gold: #9a7d3f;

  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412; --surface: #1b1e1b; --ink: #ecebe4;
    --muted: #9c9c90; --rule: #2f342f; --accent: #8fbf9c; --gold: #c2a76a;
  }
}
:root[data-theme="dark"] {
  --bg: #121412; --surface: #1b1e1b; --ink: #ecebe4;
  --muted: #9c9c90; --rule: #2f342f; --accent: #8fbf9c; --gold: #c2a76a;
}
:root[data-theme="light"] {
  --bg: #f7f5ee; --surface: #fffefa; --ink: #2b2b26;
  --muted: #6b6b60; --rule: #ddd8c8; --accent: #4a7c59; --gold: #9a7d3f;
}

* { box-sizing: border-box; }
body {
  font-family: var(--rounded);
  background: var(--bg); color: var(--ink);
  line-height: 1.65; margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Nav — same shape as the homepage so the two read as one site. */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 46rem; margin: 0 auto; height: 3.9rem;
  padding: 0 1.25rem; display: flex; align-items: center; gap: 1.5rem;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.06rem; letter-spacing: -0.015em;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand img { width: 1.65rem; height: 1.65rem; border-radius: 0.42rem; display: block; }
.nav a.nav-link { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.nav a.nav-link:hover { color: var(--ink); }
@media (max-width: 40rem) { .nav a.nav-link { display: none; } }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

/* Breadcrumb + byline */
.crumbs { font-size: 0.88rem; color: var(--muted); padding: 1.75rem 0 0; }
.crumbs a { color: var(--muted); }
.byline {
  font-size: 0.88rem; color: var(--muted);
  margin: 0 0 2.25rem; padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

h1 {
  font-size: clamp(1.95rem, 5vw, 2.6rem); line-height: 1.12;
  letter-spacing: -0.022em; font-weight: 700; margin: 1.5rem 0 1rem;
  text-wrap: balance;
}
h2 {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 1.42rem; letter-spacing: -0.01em;
  margin: 3rem 0 1rem; scroll-margin-top: 4.9rem;
}
h3 { font-size: 1.06rem; font-weight: 650; margin: 2rem 0 0.5rem; letter-spacing: -0.008em; }
p { margin: 0 0 1.1rem; }
main { padding-bottom: 1rem; }

/* The answer box: the single highest-value AEO element on the page. 40–60
   words, first sentence answers the h1 outright, at least one hard number, and
   NO links — a link fragments the chunk an answer engine wants to quote.

   .summary-box is the same thing visually, for reference pages (the press kit)
   whose headings are legitimately labels rather than questions. The class name
   is what check-formula.mjs keys on to decide whether a page is answer-first
   content, so the two must stay distinct. */
.answer-box, .summary-box {
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0.85rem; padding: 1.35rem 1.5rem; margin: 0 0 2rem;
}
.answer-box p, .summary-box p { margin: 0; font-size: 1.06rem; }

.verified {
  display: inline-block; font-size: 0.82rem; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.15rem 0.7rem; margin-bottom: 1.5rem;
}

/* Disclosure. Any page that ranks Calvin against other apps says so, plainly,
   above the comparison rather than in a footnote. */
.disclosure {
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--rule));
  border-radius: 0.85rem; padding: 1rem 1.25rem; margin: 0 0 2rem;
  font-size: 0.93rem; color: var(--muted);
}
.disclosure p { margin: 0; }

/* Health YMYL. Any page discussing calories, weight or metabolism carries this,
   near the end where it does not interrupt the answer but cannot be missed.
   Calvin is not a medical device and this content is not medical advice. */
.medical-note {
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0 0; padding: 1.25rem 0 0;
  font-size: 0.9rem; color: var(--muted);
}
.medical-note p { margin: 0; }

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 34rem; }
th, td { text-align: left; padding: 0.62rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 650;
}
td strong { font-weight: 650; }
.yes { color: var(--accent); font-weight: 650; }
.no { color: var(--muted); }

ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
li { margin-bottom: 0.5rem; }

.faq details { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; font-weight: 650; letter-spacing: -0.008em;
  list-style: none; display: flex; gap: 0.75rem; align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--muted);
  font-weight: 400; font-size: 1.2rem; line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.faq details p { color: var(--muted); margin: 0.7rem 0 0; }

.sources { font-size: 0.9rem; color: var(--muted); }
.sources li { margin-bottom: 0.65rem; }

.cta {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 1rem; padding: 1.5rem 1.6rem; margin: 2.5rem 0 0;
}
/* The CTA's title is deliberately a <p>, not an <h2>: it is promotional, not a
   section of the document, and an answer engine reading the outline should not
   be offered a sales line as a heading. Same reasoning keeps it out of the
   extraction-formula gate. */
.cta-title {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 1.42rem; letter-spacing: -0.01em;
  margin: 0 0 1rem; color: var(--ink);
}
.cta p:last-child { margin-bottom: 0; }
.coming { font-family: var(--serif); font-style: italic; color: var(--muted); }
.coming strong { font-family: var(--rounded); font-style: normal; color: var(--ink); font-weight: 650; }

footer {
  border-top: 1px solid var(--rule); margin-top: 3.5rem;
  padding: 2.25rem 0 3.5rem; font-size: 0.9rem; color: var(--muted);
}
footer nav { margin-bottom: 0.9rem; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.lang-switch { margin-bottom: 0.9rem; }
