/* Shared styles for the short "one question" pages under /bg/ (UVB, temps, diet, ...), the printable
   checklist, and /about. Same desert palette and components as the main guide (public/blog/bg.html),
   which keeps its own inline copy because of its labs and photo wall. */

/* ================================================================
   DESERT PALETTE (light + dark). Dark is the default; see the inline script in each page's <head>.
   ================================================================ */
:root {
  --bg: #F3EADB;
  --surface: #FAF4E8;
  --card: #E8DAC2;
  --card-deep: #DFCDAF;
  --ink: #2B2118;
  --muted: #6B5A48;
  --line: #3A2C20;
  --hair: rgba(58, 44, 32, 0.18);
  --shadow: 0 3px 0 #3A2C20;
  --shadow-hover: 0 5px 0 #3A2C20;
  --green: #4F7A3A;
  --green-ink: #FFFBF2;
  --green-soft: rgba(79, 122, 58, 0.16);
  --sand: #C9AE82;
  --clay: #B4643C;
  --tag-bg: #D4BE98;
  --tag-ink: #4A3524;
  --accent-text: #8A5A36;
  --danger: #B0362A;
  --danger-soft: rgba(176, 54, 42, 0.12);
}
html.dark {
  --bg: #1C1712;
  --surface: #262019;
  --card: #14100C;
  --card-deep: #0E0B08;
  --ink: #EFE4D0;
  --muted: #B5A48A;
  --line: #4D3D2D;
  --hair: rgba(239, 228, 208, 0.12);
  --shadow: 0 3px 0 #000;
  --shadow-hover: 0 5px 0 #000;
  --green: #86AD5F;
  --green-ink: #15110C;
  --green-soft: rgba(134, 173, 95, 0.16);
  --sand: #D9C29A;
  --clay: #D08455;
  --tag-bg: #3A2E22;
  --tag-ink: #E6D3B3;
  --accent-text: #D9C29A;
  --danger: #EC7A62;
  --danger-soft: rgba(236, 122, 98, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
::selection { background: var(--green); color: var(--green-ink); }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.col { max-width: 680px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ================================================================
   BUTTONS + TAGS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  font: 700 14px/1.2 'Plus Jakarta Sans', sans-serif;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--tag-bg); color: var(--tag-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.5;
}

/* ================================================================
   HEADER (same as the main guide)
   ================================================================ */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
@media (hover: none) { .site-head { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.site-head-inner {
  max-width: 880px; margin: 0 auto; padding: 0 16px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; flex: none; border: 2px solid var(--line); object-fit: cover; }
.brand-name { font-family: 'Fraunces', serif; font-weight: 800; font-size: 16px; line-height: 1; white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-btn { width: 44px; padding: 0; font-size: 17px; }
.theme-btn .when-dark { display: none; }
html.dark .theme-btn .when-dark { display: inline; }
html.dark .theme-btn .when-light { display: none; }
@media (max-width: 519px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ================================================================
   ARTICLE
   ================================================================ */
.article { padding-top: 28px; padding-bottom: 24px; }
.crumbs { font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--accent-text); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.article h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 800;
  font-size: clamp(32px, 8vw, 46px); letter-spacing: -0.015em; line-height: 1.08;
  margin-bottom: 14px;
}
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.byline img { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); object-fit: cover; }
.byline a { color: var(--ink); font-weight: 700; text-decoration: none; }
.byline a:hover { text-decoration: underline; }

/* The one-paragraph answer at the top of every page */
.answer {
  margin: 0 0 30px; padding: 16px 18px;
  border: 2px solid var(--line); border-left: 8px solid var(--green); border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow);
}
.answer .tag { margin-bottom: 8px; }
.answer p { margin: 0; font-size: 18px; line-height: 1.55; }
.answer p + p { margin-top: 10px; }

.article h2 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 700;
  font-size: 25px; line-height: 1.2; margin: 34px 0 10px; scroll-margin-top: 76px;
}
.article h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 19px; margin: 22px 0 8px; }
.article ul, .article ol { margin: 0 0 1em; padding-left: 1.3em; }
.article li { margin: 4px 0; }
.article li::marker { color: var(--clay); font-weight: 800; }
.article strong { color: var(--ink); }
.article a:not(.btn):not(.cite) { color: var(--accent-text); font-weight: 600; text-underline-offset: 3px; }

.note {
  margin: 18px 0; padding: 12px 14px; border-radius: 12px; font-size: 15.5px;
  border-left: 4px solid var(--green); background: var(--green-soft);
}
.note.warn { border-left-color: var(--danger); background: var(--danger-soft); }
.note p:last-child { margin-bottom: 0; }

/* Infographics (poop chart, boy vs. girl) */
.figure { margin: 22px 0 6px; }
.figure img { width: 100%; height: auto; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.figure-tall img { max-width: 460px; margin: 0 auto; }

/* Data tables (UV Index by distance, feeding by age, ...) scroll sideways on small phones instead of the page */
.table-wrap { overflow-x: auto; margin: 14px 0 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table caption { caption-side: bottom; text-align: left; padding: 8px 12px 10px; font-size: 13px; color: var(--muted); }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hair); }
.data-table thead th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--card-deep); }
.data-table tbody tr:last-child td, .data-table tbody tr:last-child th { border-bottom: 0; }
.data-table .ok { color: var(--green); font-weight: 800; }
.data-table .low { color: var(--danger); font-weight: 800; }

.cite { font-size: .72em; font-weight: 700; vertical-align: super; line-height: 1; text-decoration: none; color: var(--accent-text); padding: 0 1px; }
.cite:hover { text-decoration: underline; }

/* "More questions" links back into the hub and the other pages */
.related { margin-top: 40px; }
.related h2 { margin-top: 0; }
.related-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.related-list a {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px;
  text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink) !important;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.related-list a::after { content: '→'; margin-left: auto; font-size: 18px; color: var(--green); }
.related-list a:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.related-list li { margin: 0; }

/* Sources */
.sources-block { margin-top: 40px; }
.sources { list-style: none; padding: 0 !important; margin: 12px 0 0; display: grid; gap: 8px; }
.sources li { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair); font-size: 14px; scroll-margin-top: 80px; }
.sources li:target { box-shadow: inset 0 0 0 2px var(--sand); }
.sources .num { font-weight: 800; color: var(--accent-text); margin-right: 6px; }
.sources a { font-weight: 700 !important; }

/* Not-a-vet note */
.disclaimer { margin-top: 28px; padding: 14px 16px; border-radius: 14px; border: 1.5px dashed var(--sand); font-size: 14.5px; }
.disclaimer p:last-child { margin-bottom: 0; }

footer { border-top: 2px solid var(--line); background: var(--card); padding: 28px 0 40px; margin-top: 48px; }
.foot { display: flex; flex-direction: column; gap: 16px; }
.foot-title { font-family: 'Fraunces', serif; font-weight: 800; font-size: 17px; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.foot-note { font-size: 13px; color: var(--muted); margin: 0; }

@media (min-width: 720px) {
  .foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .foot-note { flex-basis: 100%; }
}

/* ================================================================
   PRINTABLE CHECKLIST (/bg/checklist)
   ================================================================ */
.sheet { max-width: 880px; }
.sheet-grid { display: grid; gap: 16px; }
.sheet-box { padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.sheet-box h2 { font-size: 19px; margin: 0 0 8px; }
.sheet-box ul { list-style: none; padding: 0; margin: 0; }
.sheet-box li { margin: 0; padding: 5px 0; border-bottom: 1px solid var(--hair); font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.sheet-box li:last-child { border-bottom: 0; }
.sheet-box li b { white-space: nowrap; }
.box { flex: none; width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 3px; transform: translateY(2px); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
@media (min-width: 720px) { .sheet-grid { grid-template-columns: 1fr 1fr; } .sheet-grid .full { grid-column: 1 / -1; } }

/* ================================================================
   DECISION TREE (/bg/decision-tree)
   With JS (html.dt-js), one .dt-node shows at a time. Without it, every step is listed with jump links.
   ================================================================ */
.dt { margin: 0 0 28px; scroll-margin-top: 72px; }
.dt-node {
  margin: 0 0 18px; padding: 18px 18px 20px; scroll-margin-top: 76px;
  border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow);
}
.dt-node .tag { margin-bottom: 10px; }
.dt-q {
  font-family: 'Fraunces', Georgia, serif; font-weight: 800;
  font-size: clamp(22px, 5.6vw, 27px); line-height: 1.2; letter-spacing: -0.01em; margin: 0;
}
.article .dt-q { margin: 0; }
.dt-q:focus { outline: none; }
.dt-q:focus-visible { outline: 3px solid var(--sand); outline-offset: 4px; border-radius: 4px; }
.dt-hint { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* Answers */
.dt-leaf { background: var(--card); border-left: 8px solid var(--sand); }
.dt-good { border-left-color: var(--green); }
.dt-bad { border-left-color: var(--clay); }
.dt-vet { border-left-color: var(--danger); }
.dt-vet .tag { background: var(--danger-soft); color: var(--danger); }
.dt-body { margin-top: 12px; font-size: 16.5px; }
.dt-body > :last-child { margin-bottom: 0; }
.dt-body .note { margin: 12px 0 0; }
.dt-body .table-wrap { background: var(--surface); }
.dt-rules { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); font-size: 15.5px; }
.dt-rules ul { margin: 6px 0 0; }
/* "Dig deeper" link to the full Got questions page: a raised row with the topic's emoji, a small
   label and an arrow, the same family as the guide's read-more rows (.more-links in bg.html) */
.dt-more { margin: 16px 0 0; }
.dt-more a {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 9px 14px 9px 10px;
  text-decoration: none; color: var(--ink) !important; font-weight: 700 !important; font-size: 15.5px; line-height: 1.3;
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.dt-more a::after { content: '→'; margin-left: auto; padding-left: 6px; flex: none; font-size: 18px; color: var(--green); transition: transform .12s ease; }
.dt-more a:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.dt-more a:hover::after { transform: translateX(3px); }
.dt-more a:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.dt-more a:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
.dt-more-emoji { flex: none; width: 36px; height: 36px; display: grid; place-items: center; font-size: 19px; border-radius: 10px; background: var(--card); }
html.dark .dt-more-emoji { background: var(--tag-bg); }   /* --card is near-black in dark mode */
.dt-more-text { min-width: 0; }
.dt-more-kicker { display: block; margin-bottom: 1px; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.dt-vet-btn { margin: 16px 0 0; }

/* Answer buttons */
.dt-choices { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 620px) { .dt-choices { grid-template-columns: 1fr 1fr; } }
.dt-choice {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  text-decoration: none; color: var(--ink) !important; font-weight: 700 !important; font-size: 15.5px; line-height: 1.3;
  background: var(--bg); border: 2px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.dt-choice:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); background: var(--green-soft); }
.dt-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.dt-choice:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
.dt-choice::after { content: '→'; margin-left: auto; padding-left: 6px; font-size: 18px; color: var(--green); flex: none; }
.dt-emoji { flex: none; width: 36px; height: 36px; display: grid; place-items: center; font-size: 20px; border-radius: 10px; background: var(--card); }
.dt-label small { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dt-next { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--hair); }
.dt-next-title, .dt-rules .dt-next-title {
  grid-column: 1 / -1; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.dt-next .dt-choice { min-height: 48px; background: var(--surface); }

/* Trail + back/start over (JS only) */
.dt-bar { display: none; }
.dt-js .dt-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 14px;
}
.dt-trail { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 13.5px; font-weight: 700; color: var(--muted); min-width: 0; }
.dt-trail li { margin: 0; display: inline-flex; align-items: center; }
.dt-trail li + li::before { content: '›'; margin: 0 6px; color: var(--sand); }
.dt-trail button {
  font: inherit; color: var(--accent-text); background: none; border: 0; padding: 2px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair);
}
.dt-trail button:hover { text-decoration-color: currentColor; }
.dt-trail [aria-current] { color: var(--ink); }
.dt-nav { display: flex; gap: 8px; flex: none; }
.dt-nav .btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: var(--shadow); }
.dt.at-start .dt-nav { visibility: hidden; }
.dt-js .dt-node { display: none; margin: 0; }
.dt-js .dt-node.is-current { display: block; animation: dt-in .22s ease-out; }
.dt-js .dt-noscript-note { display: none; }
@keyframes dt-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dt-js .dt-node.is-current { animation: none; } }

/* The whole tree as an outline (built by JS) */
.dt-map { display: none; margin: 0 0 8px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); }
.dt-js .dt-map { display: block; }
.dt-map summary {
  cursor: pointer; padding: 14px 16px; font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 19px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.dt-map summary::-webkit-details-marker { display: none; }
.dt-map summary::before { content: '🌳'; }
.dt-map summary::after { content: '+'; margin-left: auto; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; color: var(--green); }
.dt-map[open] summary::after { content: '−'; }
.dt-map summary:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; border-radius: 14px; }
.dt-map > p { margin: -4px 16px 8px; }
#dt-map-tree { padding: 0 12px 16px 16px; overflow-x: auto; }
.dt-map-start { display: inline-block; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--green); color: var(--green-ink); font-size: 14px; }
.dt-map ul { list-style: none; margin: 0 0 0 8px; padding: 4px 0 0 14px !important; border-left: 2px solid var(--hair); }
.dt-map li { position: relative; margin: 0; padding: 2px 0; }
.dt-map li::before { content: ''; position: absolute; left: -14px; top: 20px; width: 10px; border-top: 2px solid var(--hair); }
.dt-map-link {
  display: inline-flex; flex-direction: column; padding: 5px 9px; border-radius: 10px; text-decoration: none;
  font-weight: 700 !important; color: var(--ink) !important; font-size: 14.5px; line-height: 1.3;
}
.dt-map-link:hover { background: var(--green-soft); }
.dt-map-dest { font-weight: 600; font-size: 13px; color: var(--muted); }
.dt-map-link.is-leaf .dt-map-dest { color: var(--green); }
.dt-map-link.is-vet .dt-map-dest { color: var(--danger); }

/* ================================================================
   PRINT: plain black on white, no header, buttons or footer
   ================================================================ */
@media print {
  :root, html.dark {
    --bg: #fff; --surface: #fff; --card: #fff; --card-deep: #f3f3f3;
    --ink: #000; --muted: #333; --line: #000; --hair: #bbb; --shadow: none; --shadow-hover: none;
    --green: #000; --green-soft: transparent; --accent-text: #000; --danger: #000; --danger-soft: transparent;
    --tag-bg: #eee; --tag-ink: #000; --clay: #000; --sand: #777;
  }
  body { font-size: 11pt; }
  .site-head, footer, .sheet-actions, .related, .no-print, .dt-bar, .dt-map { display: none !important; }
  .dt-js .dt-node { display: block !important; margin-bottom: 10px; box-shadow: none; break-inside: avoid; }
  .article { padding-top: 0; }
  .answer, .sheet-box, .table-wrap { box-shadow: none; break-inside: avoid; }
  a { text-decoration: none; }
  .sheet .article h1, .sheet h1 { font-size: 22pt; }
  .sheet-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sheet-grid .full { grid-column: 1 / -1; }
  .sheet-box { padding: 6px 10px; border-width: 1.5px; }
  .sheet-box h2 { font-size: 12pt; margin-bottom: 4px; }
  .sheet-box li { font-size: 9.5pt; padding: 2px 0; }
  .sheet .byline, .sheet .crumbs { margin-bottom: 6px; }
  @page { margin: 12mm; }
}
