/* Chickpea Baby guides (generated pages under /guides/, see backend/scripts/siteGuides.ts): a quiet reading layout in the
   home page's palette. Light and dark follow the device. Fonts are self-hosted, so the pages make no third-party requests. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url(/fonts/figtree.woff2) format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/fonts/fredoka.woff2) format("woff2"); }

:root {
  --bg: #F4F2FB; --surface: #FFFFFF; --ink: #1E2140; --muted: #5B5E7E; --indigo: #4A47C8; --line: rgba(30, 33, 64, .13);
  --tint: #ECEAF8; --mark: #FFF1C9;
  --display: "Fredoka", "Avenir Next Rounded", ui-rounded, system-ui, sans-serif;
  --body: "Figtree", -apple-system, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1C36; --surface: #23254A; --ink: #EEEDF7; --muted: #A9ABC8; --indigo: #A5A2F5; --line: rgba(238, 237, 247, .15);
    --tint: #2A2C55; --mark: #4A4220;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.7 var(--body); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img { max-width: 100%; height: auto; }
a { color: var(--indigo); text-underline-offset: .15em; }
a:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; text-wrap: balance; letter-spacing: -.01em; margin: 0; }

/* Header and footer */
.gtop, .guide, .gfoot { max-width: 720px; margin-inline: auto; padding-inline: 20px; }
.gtop { display: flex; align-items: center; gap: 12px; padding-top: max(18px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 8px; }
.brand span { font-family: var(--display); font-weight: 600; font-size: 19px; }
.gtop nav { margin-left: auto; display: flex; gap: 18px; font-size: 15px; }
.gtop nav a { color: var(--muted); text-decoration: none; }
.gtop nav a:hover { color: var(--ink); }
.gfoot { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; padding-block: 28px max(40px, env(safe-area-inset-bottom)); }
.gfoot a { color: var(--muted); }

/* Page */
.guide { padding-block: 20px 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.ghead { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); }
.ghead h1 { font-size: clamp(32px, 7vw, 46px); }
.lede { margin: 14px 0 0; font-size: 20px; line-height: 1.5; color: var(--muted); }

/* Body text: about 68 characters a line */
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(25px, 4.5vw, 30px); margin: 2.1em 0 .5em; scroll-margin-top: 16px; }
.prose h3 { font-size: clamp(20px, 3.6vw, 23px); margin: 1.7em 0 .4em; scroll-margin-top: 16px; }
.prose h4 { font: 700 18px/1.3 var(--body); margin: 1.4em 0 .3em; }
.prose h2:target, .prose h3:target, .sources h2:target { background: linear-gradient(transparent 62%, var(--mark) 62%); width: fit-content; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; padding-left: .2em; }
.prose li > ul { margin: .4em 0 0; }
.prose strong { font-weight: 700; }
.prose code { font-size: .92em; background: var(--tint); border-radius: 5px; padding: .1em .35em; }
.tablewrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.tablewrap table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 16px; line-height: 1.45; }
.tablewrap th, .tablewrap td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tablewrap th { background: var(--tint); font-weight: 700; white-space: nowrap; }
.tablewrap tr:last-child td { border-bottom: 0; }

/* Sources */
.sources { max-width: 68ch; margin-top: 2.6em; padding-top: 1.4em; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--muted); }
.sources h2 { font-size: 20px; margin-bottom: .6em; color: var(--ink); }
.sources ol { margin: 0; padding-left: 1.4em; }
.sources li { margin-bottom: .55em; overflow-wrap: anywhere; }

/* After the article: wellness note, related guides, the app */
.more { margin-top: 36px; padding: 22px clamp(18px, 4vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.more .note { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.more h2 { font-size: 21px; margin-bottom: 10px; }
.related, .cards { list-style: none; margin: 0; padding: 0; }
.related li { padding-block: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.related a, .cards a { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.25; }
.related span, .cards span { font-size: 15px; line-height: 1.5; color: var(--muted); }
.more .cta { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.55; }
.more .note + .cta { border-top: 0; padding-top: 0; margin-top: 0; }

/* Index */
.topic { margin-top: 38px; }
.topic h2 { font-size: 26px; margin-bottom: 14px; scroll-margin-top: 16px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cards li { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.cards li:hover { border-color: var(--indigo); }
.cards a { text-decoration: none; }
.cards a::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.cards a:focus-visible { outline: none; }
.cards li:has(a:focus-visible) { outline: 3px solid var(--indigo); outline-offset: 2px; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .lede { font-size: 18px; }
  .gtop nav { gap: 14px; }
}
