/* Long-form pages: How We Score, the methodology, the FAQ. Everything is scoped under .doc
   so it cannot reach the rest of the site; plain CSS, so the compiled Tailwind file
   (output.css) needs no rebuild. input.css styles bare h1/h2/h3/p globally, hence the
   explicit resets here. */

.doc {
  --ink: #1f2937;
  --muted: #4b5563;
  --line: #e5e7eb;
  --amber: #f59e0b;
  --amber-dark: #b45309;
  --tint: #fffbeb;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px 3rem;
  color: var(--ink);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  user-select: text;
  -webkit-user-select: text;
  text-align: left;
}
.doc * { box-sizing: border-box; }

.doc .doc-hero { text-align: center; padding: 1rem 0 2rem; }
.doc h1 {
  font-family: "Jersey 10", "Jersey 25", cursive;
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1;
  margin: 0 0 1rem;
  font-weight: 400;
  text-align: center;
}
.doc .lede { font-size: 1.1rem; line-height: 1.7; color: var(--muted); margin: 0 auto; max-width: 40rem; }
.doc .updated { margin-top: .9rem; font-size: .85rem; color: var(--muted); }
.doc .chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.25rem; }
.doc .chips span { border: 1px solid #fcd34d; background: #fff; color: #92400e; border-radius: 999px; padding: .2rem .75rem; font-size: .85rem; }

.doc h2 {
  font-family: "Jersey 10", "Jersey 25", cursive;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 2.75rem 0 .75rem;
  scroll-margin-top: 1rem;
}
.doc h3 {
  font-family: Roboto, system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  margin: 1.75rem 0 .5rem;
  scroll-margin-top: 1rem;
}
.doc p, .doc li { font-size: 1rem; line-height: 1.75; margin: 0 0 .9rem; }
.doc ul, .doc ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc li { margin-bottom: .35rem; }
.doc a { color: var(--amber-dark); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { color: #92400e; }
.doc strong { font-weight: 700; }
.doc sup a { text-decoration: none; font-size: .75em; font-weight: 700; }

.doc .summary {
  background: var(--tint);
  border: 1px solid #fde68a;
  border-radius: .75rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
}
.doc .summary p:last-child { margin-bottom: 0; }

.doc nav.toc { border: 1px solid var(--line); border-radius: .75rem; padding: .9rem 1.25rem; margin: 0 0 1rem; background: #f9fafb; }
.doc nav.toc .toc-title { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: .4rem; }
.doc nav.toc ol { margin: 0; }
.doc nav.toc li { margin: 0; line-height: 1.8; }

/* The method as a numbered timeline */
.doc ol.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; position: relative; }
.doc ol.steps::before { content: ""; position: absolute; left: 1.15rem; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(#fde68a, var(--amber), #fde68a); }
.doc ol.steps > li { position: relative; padding-left: 3.4rem; margin: 0 0 1.6rem; counter-increment: step; }
.doc ol.steps { counter-reset: step; }
.doc ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .1rem;
  width: 2.3rem; height: 2.3rem; border-radius: 999px;
  background: var(--amber); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px #fff;
}
.doc ol.steps > li > h2 { margin-top: 0; }
.doc .card { border: 1px solid var(--line); border-radius: .9rem; padding: 1rem 1.25rem; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }

/* Equations: plain text, so a person and a crawler read the same thing */
.doc .eq {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .93rem;
  line-height: 1.6;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin: .5rem 0 1rem;
  overflow-x: auto;
  white-space: pre;
}
.doc .where { font-size: .92rem; color: var(--muted); }
.doc .note { font-size: .92rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: .9rem; }

.doc table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.25rem; font-size: .93rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; vertical-align: top; line-height: 1.5; }
.doc th { background: #f9fafb; font-weight: 700; }
.doc .table-wrap { overflow-x: auto; }

.doc .independent { background: #b45309; color: #fff; border-radius: .9rem; padding: 1.25rem 1.5rem; margin-top: 2.5rem; }
.doc .independent h2 { margin-top: 0; color: #fff; }
.doc .independent a { color: #fde68a; }
.doc .independent li { margin-bottom: .3rem; }

.doc ol.refs li { font-size: .88rem; line-height: 1.6; color: var(--muted); }
.doc .more { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; }

/* FAQ */
.doc details { border: 1px solid var(--line); border-radius: .75rem; margin: 0 0 .6rem; background: #fff; }
.doc details[open] { border-color: #fcd34d; }
.doc summary { cursor: pointer; padding: .85rem 1.1rem; font-weight: 700; line-height: 1.45; list-style: none; position: relative; padding-right: 2.5rem; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; position: absolute; right: 1.1rem; top: .7rem; font-size: 1.3rem; color: var(--amber-dark); }
.doc details[open] summary::after { content: "–"; }
.doc details .answer { padding: 0 1.1rem .4rem; }

/* The home page's FAQ preview (index.html) */
.home-faq { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 16px; font-family: Roboto, system-ui, sans-serif; text-align: left; user-select: text; -webkit-user-select: text; }
.home-faq details { border: 1px solid #e5e7eb; border-radius: .75rem; margin: 0 0 .6rem; background: #fff; }
.home-faq details[open] { border-color: #fcd34d; }
.home-faq summary { cursor: pointer; padding: .85rem 2.5rem .85rem 1.1rem; font-weight: 700; line-height: 1.45; list-style: none; position: relative; font-size: 1rem; }
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: .7rem; font-size: 1.3rem; color: #b45309; }
.home-faq details[open] summary::after { content: "–"; }
.home-faq details p { padding: 0 1.1rem .9rem; margin: 0; font-size: .95rem; line-height: 1.7; color: #374151; }
.home-faq .home-faq-more { display: flex; justify-content: center; margin-top: 1.25rem; }

@media (max-width: 480px) {
  .doc ol.steps > li { padding-left: 2.9rem; }
  .doc ol.steps::before { left: .95rem; }
  .doc ol.steps > li::before { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
}

/* --- Food pages (/food and /food/{brand}/{name}, engine/api/food_pages.py) --------------- */
.doc.doc-wide { max-width: 72rem; }
.doc .crumbs { font-size: .85rem; color: var(--muted); margin: .5rem 0 1rem; }
.doc .crumbs a { color: var(--muted); }
.doc .muted { color: var(--muted); font-size: .85rem; }
.doc .food-search { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 auto .5rem; max-width: 46rem; }
.doc .food-search input { flex: 1 1 16rem; min-width: 0; border: 1px solid #d1d5db; border-radius: .5rem; padding: .6rem .8rem; font-size: 1rem; }
.doc .food-search select { border: 1px solid #d1d5db; border-radius: .5rem; padding: .55rem .6rem; font-size: .95rem; background: #fff; }
.doc .food-search input:focus, .doc .food-search select:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.doc .food-count { text-align: center; font-size: .9rem; color: var(--muted); margin: .25rem 0 1rem; }
.doc .food-empty { text-align: center; }
.doc ul.food-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); gap: .75rem; }
.doc ul.food-grid li { margin: 0; }
.doc .food-card[hidden] { display: none; }
.doc .food-card a, .doc ul.related a { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.doc .food-card a:hover, .doc ul.related a:hover { border-color: #fcd34d; box-shadow: 0 4px 14px rgba(180, 83, 9, .12); color: var(--ink); }
.doc .food-card-brand { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.doc .food-card-name { font-weight: 700; line-height: 1.35; }
.doc .food-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .2rem; }
.doc .food-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.doc .bones { display: inline-flex; align-items: center; height: 1.4rem; padding: 0 .3rem; }
.doc .bones img { width: 1.5rem; height: .75rem; margin: 0 -.2rem; transform: rotate(-60deg); image-rendering: pixelated; }
.doc .bones img.off { opacity: .45; }
.doc .rating { font-family: "Jersey 10", "Jersey 25", cursive; font-size: 1.25rem; line-height: 1; }
.doc .rating.r1 { color: #ea580c; } .doc .rating.r2 { color: #ca8a04; } .doc .rating.r3 { color: #65a30d; } .doc .rating.r4 { color: #16a34a; }
.doc .tag { display: inline-block; border-radius: .45rem; padding: .12rem .55rem; font-size: .8rem; line-height: 1.5; background: #6b7280; color: #fff; }
.doc .tag.plain { background: #fff; color: var(--ink); border: 1px solid #d1d5db; }
.doc .tag.p-chicken { background: #f59e0b; } .doc .tag.p-turkey { background: #ea580c; } .doc .tag.p-duck { background: #ef4444; }
.doc .tag.p-white-fish { background: #0ea5e9; } .doc .tag.p-fish { background: #0e7490; } .doc .tag.p-salmon { background: #ec4899; }
.doc .tag.p-beef { background: #991b1b; } .doc .tag.p-lamb { background: #7c3aed; } .doc .tag.p-pork { background: #e11d48; }
.doc .tag.p-bison { background: #431407; }
.doc .food-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.doc .food-title { flex: 1 1 22rem; min-width: 0; }
.doc .food-brand { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.doc h1.food-h1 { text-align: left; font-size: clamp(2rem, 5vw, 3rem); margin: .1rem 0 .6rem; }
.doc .food-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .25rem 0 .5rem; }
.doc .food-score { flex: none; text-align: center; border: 1px solid var(--line); border-radius: .9rem; padding: .75rem 1.25rem; background: #fff; }
.doc .food-score .rating { font-size: 1.9rem; margin-top: .2rem; }
.doc .food-score .bones { height: 2rem; }
.doc .food-score .bones img { width: 2.2rem; height: 1.1rem; margin: 0 -.3rem; }
.doc .food-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .5rem; }
.doc .btn { display: inline-flex; align-items: center; border: 2px solid #d1d5db; border-radius: .45rem; padding: .45rem .9rem; font-weight: 700; font-size: .95rem; color: var(--ink); background: #fff; text-decoration: none; }
.doc .btn:hover { border-color: var(--amber); color: var(--ink); }
.doc .btn.primary { background: var(--amber); border-color: var(--amber); color: #fff; }
.doc .btn.primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); color: #fff; }
.doc ol.ingredients { columns: 2 16rem; column-gap: 2rem; }
.doc ol.ingredients li { break-inside: avoid; margin-bottom: .15rem; line-height: 1.5; }
.doc ul.related { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; }
.doc ul.related li { margin: 0; }
.doc .feed-table td, .doc .feed-table th { white-space: nowrap; }

/* Food page accordions: the score stays open above them, similar foods below */
.doc .food-accs { margin-top: 2.25rem; }
.doc details.food-acc { border: 1px solid var(--line); border-radius: .8rem; margin: 0 0 .7rem; background: #fff; }
.doc details.food-acc[open] { border-color: #fcd34d; }
.doc details.food-acc > summary { padding: .95rem 3rem .95rem 1.15rem; font-weight: 400; }
.doc details.food-acc > summary::after { top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.doc details.food-acc > summary h2 { display: inline; margin: 0; font-size: clamp(1.45rem, 3.4vw, 1.9rem); }
.doc details.food-acc > summary:hover h2 { color: var(--amber-dark); }
.doc .food-acc-body { padding: 0 1.15rem 1rem; }
.doc .food-acc-body > :first-child { margin-top: 0; }
.doc .food-note { border-left: 4px solid var(--amber); background: #fff; border-radius: .5rem; padding: .7rem 1rem; margin: -0.75rem 0 1.5rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.doc .food-note strong { display: block; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-dark); margin-bottom: .2rem; }
.doc .food-note p { margin: 0 0 .4rem; }
.doc .food-note p:last-child { margin-bottom: 0; }
.doc ul.related.reading { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
