/* ============================================================================
   sugar.css — SugarCheck-only layer. Loads after styles.css + data.css.
   Adds the site accent, the pure-SVG glucose-curve hero, the prominent medical
   disclaimer block, the calculator surface and the result-band colours.
   No images, no libraries, no web fonts beyond the shared Inter.
   The tone is deliberately clinical: this is not a page to be dramatic on.
   ========================================================================== */

/* ------------------------------------------------------------- site accent */
body[data-site="sugar"] {
  --accent: #b91c1c; --accent-2: #7f1d1d; --accent-3: #ef4444;
  --accent-soft: #fdeaea;
  --g-normal: #0f766e; --g-pre: #b45309; --g-dia: #b91c1c;
  --gi-low: #0f766e; --gi-med: #b45309; --gi-high: #b91c1c;
  --curve-grid: #e6eaf1;
}
:root[data-theme="dark"] body[data-site="sugar"] {
  --accent: #f87171; --accent-2: #fca5a5; --accent-3: #ef4444;
  --accent-soft: rgba(248, 113, 113, .14);
  --g-normal: #2dd4bf; --g-pre: #fbbf24; --g-dia: #f87171;
  --gi-low: #2dd4bf; --gi-med: #fbbf24; --gi-high: #f87171;
  --curve-grid: #1e2740;
}

/* ------------------------------------------------- the medical disclaimer
   Deliberately near the top of every clinical page rather than in the footer.
   It is the first thing under the hero, and it is not collapsible.          */
.disc-top { padding-top: 22px; padding-bottom: 0; }
.med-disc {
  display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.med-disc svg { width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.med-disc strong { display: block; font-size: .95rem; font-weight: 750; color: var(--ink); margin-bottom: 5px; }
.med-disc p { font-size: .87rem; line-height: 1.62; color: var(--ink-2, var(--muted)); }
.med-disc p b { color: var(--ink); font-weight: 700; }
@media (max-width: 520px) { .med-disc { grid-template-columns: 1fr; } .med-disc svg { display: none; } }

/* ---------------------------------------------------- the SVG glucose hero */
.gcurve { max-width: 620px; margin: 28px auto 0; }
.gcurve svg { width: 100%; height: auto; overflow: visible; display: block; }
.gc-grid line { stroke: var(--curve-grid); stroke-width: 1; }
.gc-line { stroke-width: 3.4; stroke-linecap: round; }
.gc-lab text { fill: var(--muted); font-family: var(--font); font-size: 13px; font-weight: 650; }
.gc-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.gc-dot-b { stroke: var(--accent-3); }
.gc-note { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.55; }

/* One slow draw on load. Nothing loops, nothing pulses — this subject does
   not need animation shouting at the reader. */
.gc-line { stroke-dasharray: 900; stroke-dashoffset: 900; animation: gc-draw 1.9s cubic-bezier(.25,.8,.3,1) forwards; }
.gc-area { opacity: 0; animation: gc-fade 1.2s ease-out .9s forwards; }
.gc-dot { opacity: 0; animation: gc-fade .5s ease-out forwards; }
.gc-dot-a { animation-delay: .35s } .gc-dot-b { animation-delay: 1.0s } .gc-dot-c { animation-delay: 1.5s }
@keyframes gc-draw { to { stroke-dashoffset: 0 } }
@keyframes gc-fade { to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .gc-line, .gc-area, .gc-dot { animation: none; stroke-dashoffset: 0; opacity: 1; }
}

/* ------------------------------------------------------------ calculator UI */
.sc-calc { max-width: 700px; margin: 26px auto 0; text-align: left; }
.sc-calc .card-body { padding: 22px; }
.sc-out {
  margin-top: 18px; padding: 18px; border-radius: var(--radius);
  background: var(--surface-2, var(--bg-tint)); border: 1px solid var(--line); text-align: center;
}
.sc-out .v { font-size: clamp(2.2rem, 8vw, 3.2rem); font-weight: 800; letter-spacing: -.05em; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.sc-out .u { font-size: .9rem; color: var(--muted); font-weight: 650; margin-top: 6px; }
.sc-out .u2 { font-size: .95rem; color: var(--ink); font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.sc-out .verdict { margin-top: 13px; font-size: .98rem; font-weight: 700; line-height: 1.45; }
.sc-nojs { margin-top: 14px; font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* ------------------------------------------------------------ band colours */
.g-normal { color: var(--g-normal); font-weight: 700; }
.g-pre    { color: var(--g-pre);    font-weight: 700; }
.g-dia    { color: var(--g-dia);    font-weight: 700; }
.gi-low   { color: var(--gi-low);   font-weight: 700; }
.gi-med   { color: var(--gi-med);   font-weight: 700; }
.gi-high  { color: var(--gi-high);  font-weight: 700; }
.gl-low   { color: var(--gi-low);   font-weight: 700; }
.gl-med   { color: var(--gi-med);   font-weight: 700; }
.gl-high  { color: var(--gi-high);  font-weight: 700; }

table.data tr.grp th {
  background: var(--bg-tint); font-size: .8rem; font-weight: 750;
  letter-spacing: .02em; text-transform: none; color: var(--ink); text-align: left;
}
table.data tr.self th, table.data tr.self td { font-weight: 750; background: var(--accent-soft); }
table.data td.hi, table.data th.hi { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
table.data .sm { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* --------------------------------------------------- two published rulebooks */
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
@media (max-width: 720px) { .dual { grid-template-columns: 1fr; } }
.dual-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs); }
.dual-col.lead { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent), var(--shadow-sm); }
.dual-col h3 { font-size: 1rem; font-weight: 750; letter-spacing: -.02em; margin-bottom: 3px; }
.dual-col .who { font-size: .77rem; color: var(--muted); margin-bottom: 12px; }
.dual-col p { font-size: .88rem; line-height: 1.6; color: var(--muted); }
.dual-tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; margin-bottom: 9px; }

/* ------------------------------------------------------------- quick jumps */
.jump { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }
.jump a {
  display: block; text-align: center; padding: 11px 8px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none;
  font-size: .87rem; font-weight: 700; color: var(--ink); transition: .16s; box-shadow: var(--shadow-xs);
}
.jump a small { display: block; font-weight: 500; font-size: .71rem; color: var(--muted); margin-top: 3px; }
.jump a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.jump a[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------- tool cards */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tool {
  display: block; text-decoration: none; color: inherit; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); transition: .2s; position: relative; overflow: hidden;
}
.tool::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%); pointer-events: none;
}
.tool:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: var(--shadow); }
.tool .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 13px; }
.tool .ti svg { width: 20px; height: 20px; }
.tool h3 { font-size: 1.02rem; font-weight: 750; letter-spacing: -.025em; margin-bottom: 6px; line-height: 1.3; }
.tool p { font-size: .86rem; color: var(--muted); line-height: 1.55; }
.tool .go { display: inline-block; margin-top: 12px; font-size: .83rem; font-weight: 700; color: var(--accent); }

/* ------------------------------------------------------- formulas & cites */
.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem;
  background: var(--bg-tint); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; color: var(--ink); overflow-x: auto; line-height: 1.9;
}
.cite { font-size: .77rem; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.cite b { color: var(--ink); font-weight: 650; }

/* ------------------------------------- the medical caution block, inline use */
.caution {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line)); border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  border-radius: var(--radius-sm); padding: 15px 18px; font-size: .89rem;
  color: var(--muted); line-height: 1.62; margin-top: 18px;
}
.caution strong { color: var(--ink); }

/* the big answer number in a hero */
.answer .big {
  display: block; font-size: clamp(2rem, 7vw, 2.9rem); font-weight: 800;
  letter-spacing: -.045em; color: var(--accent); line-height: 1.05; margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

/* the caveat that travels with the PeakForm placement on this site */
.pf-med {
  margin-top: 14px; font-size: .8rem; color: var(--muted); line-height: 1.6;
  text-align: center; max-width: 62ch; margin-left: auto; margin-right: auto;
}
