/* Guides: loaded after /home.css, so the articles share the landing page's tokens, type, nav and
 * footer. Ported from Mooskles' guides.css, with WhereItWent's right-to-left rules, in Milkies'
 * colours (burnt orange hero, amber links, gold markers, clay for the doctor box).
 * The home page loads it too, for section#articles and its .guide-list. */

/* ------------------------------------------------------------------ hero */
.g-hero { position: relative; isolation: isolate; overflow: clip; padding: calc(112px + env(safe-area-inset-top)) var(--gutter) 52px; }
.g-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 80% at 12% 0%, rgba(232, 137, 74, .5), transparent 70%),
    radial-gradient(50% 70% at 92% 8%, rgba(245, 196, 106, .22), transparent 70%),
    linear-gradient(180deg, var(--burnt-deep) -30%, var(--bg) 100%);
}
/* The icon's sparkles, faint, as on the home page's hero. */
.g-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .05; background: var(--pattern) 0 0 / 132px 132px; }
.g-hero-in, .g-body { max-width: 760px; margin: 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: .92rem; font-weight: 700; color: rgba(255, 255, 255, .7); }
.crumbs a { color: rgba(255, 255, 255, .88); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.g-hero h1 {
  margin: 22px 0 0; color: #fff; text-shadow: none;
  font: 900 clamp(2.2rem, 7.4vw, 3.9rem)/1.04 var(--display); letter-spacing: -.035em;
  text-wrap: balance; overflow-wrap: break-word;
}
.g-hero .lede { max-width: none; margin: 22px 0 0; color: rgba(255, 255, 255, .9); font-size: clamp(1.08rem, 2.2vw, 1.25rem); line-height: 1.55; }
.g-hero .lede b, .g-hero .lede strong { color: #fff; }
.g-hero .lede a { color: #ffe3bd; text-underline-offset: 3px; }
.g-hero .meta { margin: 18px 0 0; color: rgba(255, 255, 255, .66); font-size: .92rem; }

/* ------------------------------------------------------------------ body */
.g-body { padding: 24px var(--gutter) 40px; font-size: 1.08rem; line-height: 1.75; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); }
.g-body > * { max-width: 100%; }
.g-body p, .g-body li { color: color-mix(in srgb, var(--ink) 88%, var(--muted)); overflow-wrap: break-word; }
.g-body h2 { margin: 56px 0 14px; font: 900 clamp(1.6rem, 4.6vw, 2.15rem)/1.12 var(--display); letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.g-body h3 { margin: 32px 0 8px; font: 700 1.2rem/1.3 var(--display); letter-spacing: -.015em; color: var(--ink); }
.g-body ul, .g-body ol { padding-inline-start: 1.3em; }
.g-body li { margin: 8px 0; }
.g-body li::marker { color: var(--gold); }
.g-body a { color: var(--amber-hi); text-decoration: underline; text-underline-offset: 3px; }
.g-body a:hover { color: var(--gold); }
.g-body code { font: .92em var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--card); }
.g-body pre { margin: 0; padding: 18px 20px; font: .9rem/1.6 var(--mono); color: var(--amber-hi); }
.g-body pre code { padding: 0; background: none; }

/* Tables and code scroll inside their own box, never the page. */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; border-radius: 16px; background: var(--tile); box-shadow: inset 0 0 0 1px var(--line-2); }
.g-body table { width: 100%; border-collapse: collapse; font-size: .97rem; line-height: 1.5; }
.g-body caption { caption-side: top; padding: 14px 16px 4px; text-align: start; color: var(--muted); font-size: .9rem; }
.g-body th, .g-body td { text-align: start; vertical-align: top; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.g-body td { font-variant-numeric: tabular-nums; }
.g-body tr:last-child td { border-bottom: 0; }
.g-body th { color: var(--muted); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.g-body tbody th { text-transform: none; letter-spacing: 0; font-size: .97rem; color: var(--ink); white-space: normal; }

/* Screenshots: the app's 600x1298 phone renders, in a thin device frame. */
.g-body figure { margin: 36px 0; }
.shot { display: block; width: min(300px, 78%); height: auto; margin: 0 auto; border-radius: 34px; border: 8px solid #0d0907; box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -30px rgba(207, 111, 49, .55); }
.g-body figcaption { margin-top: 16px; text-align: center; color: var(--muted); font-size: .95rem; }

/* ------------------------------------------------------------------ medical blocks */
.disclaimer {
  margin: 8px 0 0; padding: 14px 18px; border-radius: 14px;
  background: var(--wash); border-inline-start: 4px solid var(--gold);
  font-size: .95rem; line-height: 1.6; color: var(--muted) !important;
}
.disclaimer strong { color: var(--ink); }
.doctor-box {
  margin: 40px 0; padding: 22px 22px 14px; border-radius: 20px;
  background: rgba(201, 105, 94, .1); box-shadow: inset 0 0 0 1px rgba(201, 105, 94, .45);
}
.g-body .doctor-box h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -.015em; color: var(--clay-hi); }
.g-body .doctor-box li::marker { color: var(--clay-hi); }
.g-body .doctor-box p:last-child { margin-bottom: 8px; }

.sources { margin-top: 56px; }
.g-body .sources h2 { margin-top: 0; font-size: 1.35rem; }
.g-body .sources ol { padding-inline-start: 1.6em; font-size: .95rem; line-height: 1.6; }
.g-body .sources li { color: var(--muted); }
.g-body .sources li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
.g-body .sources a { overflow-wrap: anywhere; }
.sources .checked { margin: 14px 0 0; color: var(--faint) !important; font-size: .9rem; }

/* ------------------------------------------------------------------ call to action */
.cta { position: relative; overflow: hidden; isolation: isolate; margin: 56px 0 0; padding: 34px 24px; border-radius: 28px; text-align: center;
  background: radial-gradient(70% 90% at 50% 0%, #e07a3a, transparent 70%), linear-gradient(180deg, var(--burnt), var(--burnt-deep)); }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .08; background: var(--pattern) 0 0 / 132px 132px; }
.g-body .cta p { margin: 0 0 20px; color: rgba(255, 255, 255, .92); font-size: 1.1rem; }
.cta strong { color: #fff; }
.g-body .cta .button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: #fff; color: var(--burnt-deep); font-weight: 800; text-decoration: none; box-shadow: 0 14px 34px -12px rgba(70, 20, 0, .55); transition: transform .25s var(--ease); }
.g-body .cta .button:hover { transform: translateY(-2px); color: var(--burnt-deep); }

/* ------------------------------------------------------------------ related + the home page's list */
.related { margin-top: 56px; }
.g-body .related h2 { margin-top: 0; font-size: 1.35rem; }
.related ul, .guide-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.g-body .related ul { padding: 0; }
.related li, .guide-list li { margin: 0; }
.related a, .guide-list a {
  display: block; height: 100%; padding: 18px 20px; border-radius: 16px;
  background: var(--tile); box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink) !important; font-weight: 700; line-height: 1.4; text-decoration: none !important;
  transition: background-color .2s, transform .25s var(--ease);
}
.related a:hover, .guide-list a:hover { background: var(--wash); transform: translateY(-2px); }
.guide-list a b { display: block; color: var(--ink); font: 700 1.15rem/1.3 var(--display); letter-spacing: -.01em; }
.guide-list a span { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: .98rem; line-height: 1.5; }
@media (min-width: 640px) { .related ul, .guide-list { grid-template-columns: 1fr 1fr; } }

/* The home page's section#articles. */
.guides { padding: clamp(84px, 12vw, 150px) var(--gutter) 0; }
.guides-in { max-width: 860px; margin: 0 auto; }
.guides h2 { text-align: center; }
.guides .guide-list { margin: clamp(40px, 6vw, 64px) 0 0; }

/* ------------------------------------------------------------------ scripts and direction */
:is(:lang(ja), :lang(ko), :lang(zh), :lang(ar)) .g-hero h1 { letter-spacing: 0; line-height: 1.2; }
:is(:lang(ja), :lang(ko), :lang(zh)) .g-hero h1 { font-size: clamp(1.9rem, 7vw, 3.2rem); }
:is(:lang(ja), :lang(ko), :lang(zh), :lang(ar)) .g-body h2 { letter-spacing: 0; line-height: 1.3; }
/* The Arabic guides mirror the layout (lists and cells already use logical sides above). */
[dir="rtl"] .g-body ul, [dir="rtl"] .g-body ol { padding-left: 0; padding-right: 1.3em; }
[dir="rtl"] .g-body .sources ol { padding-right: 1.6em; }
[dir="rtl"] .g-body .related ul, [dir="rtl"] .guide-list { padding-right: 0; }
[dir="rtl"] .g-body th, [dir="rtl"] .g-body td, [dir="rtl"] .g-body caption { text-align: right; }
[dir="rtl"] .crumbs span { display: inline-block; transform: scaleX(-1); }

/* Guides keep the nav in its scrolled look; white-on-amber fails contrast (2.6:1), so use the light button */
.nav.scrolled .btn-nav { background: #fff; color: var(--burnt-deep); }
