/* Shared chrome and components for the Learn guides (public/learn/*.html).
 * Colors come from /brand.css; page-specific pieces stay inline in each page. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-sans:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:         ui-monospace, "SF Mono", "Roboto Mono", Menlo, monospace;
  --rule:         rgba(29,43,91,0.1);
  --muted-text:   #5B6170; /* --muted fails 4.5:1 for small text on cream */
}

*:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body { background: var(--cream); }
body { font-family: var(--font-sans); color: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--teal-deep); }

/* ── Top nav (the articles' back link + logo, with a step count) ── */
.topnav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(248,239,220,0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner { max-width: 680px; margin: 0 auto; padding: 12px 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.nav-back:hover, .foot-prev:hover { color: var(--teal-deep); }
.nav-back { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--navy); text-decoration: none; white-space: nowrap; justify-self: start; }
.nav-back svg { width: 17px; height: 17px; }
.nav-brand img { height: 30px; display: block; }
.nav-step { justify-self: end; font-family: var(--mono); font-size: 11.5px; color: var(--muted-text); white-space: nowrap; }

/* ── Page ─────────────────────────────────────────────────────── */
.page { max-width: 680px; margin: 0 auto; padding: 34px 22px 24px; }

.kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-deep); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.kicker::after { content: ""; flex: 1; height: 1px; background: rgba(31,114,116,0.25); }

h1.title { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5.4vw, 44px); line-height: 1.08; color: var(--navy); margin: 0 0 18px; text-wrap: balance; }
.hl { color: var(--orange); text-decoration: underline; text-decoration-thickness: 0.11em; text-underline-offset: 0.14em; text-decoration-skip-ink: none; }

.lede { font-size: 17px; line-height: 1.7; color: var(--navy); margin: 0 0 14px; }
.lede-2 { font-size: 16px; line-height: 1.7; color: var(--body); margin: 0 0 14px; }

h2.section-h { font-family: var(--font-display); font-weight: 800; font-size: 23px; line-height: 1.2; color: var(--navy); margin: 42px 0 8px; text-wrap: balance; }
.section-sub { font-size: 15.5px; line-height: 1.7; color: var(--body); margin: 0 0 16px; }
.prose p { font-size: 16px; line-height: 1.72; color: var(--body); margin: 0 0 14px; }
.prose strong { color: var(--navy); }

/* ── Callouts ─────────────────────────────────────────────────── */
.callout { border-radius: 20px; padding: 18px 20px; margin: 18px 0; font-size: 15px; line-height: 1.65; color: var(--navy); }
.callout b, .callout strong { font-family: var(--font-display); font-weight: 800; }
.callout-care { background: var(--peach-soft); border: 1px solid var(--peach); }
.callout-key { background: var(--mint); }
.callout-key .callout-label, .callout-care .callout-label { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal-deeper); margin: 0 0 6px; }
.callout-care .callout-label { color: var(--orange-ink); }

.pill { display: inline-flex; align-items: center; gap: 10px; background: var(--peach-soft); border-radius: 999px; padding: 9px 16px; margin: 6px 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--navy); }
.pill svg { width: 18px; height: 18px; color: var(--orange-deep); flex: none; }

/* ── Accordion cards ──────────────────────────────────────────── */
.acc-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 8px; }
.acc { background: var(--cream-soft); border-radius: 22px; border: 1.5px solid rgba(29,43,91,0.07); overflow: hidden; transition: border-color var(--dur-fast) var(--ease-soft), box-shadow var(--dur-fast) var(--ease-soft); }
.acc.open { border-color: rgba(31,114,116,0.32); box-shadow: 0 10px 28px -12px rgba(29,43,91,0.16); }
.acc-btn:focus-visible { outline-offset: -3px; border-radius: 20px; }
.acc-btn { width: 100%; text-align: left; cursor: pointer; background: none; border: none; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; font: inherit; color: inherit; }
.acc-num { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--mint-soft); color: var(--teal-deep); font-family: var(--font-display); font-weight: 900; font-size: 16px; flex-shrink: 0; transition: background var(--dur-fast), color var(--dur-fast); }
.acc.open .acc-num { background: var(--teal-deep); color: #fff; }
.acc-head { display: flex; flex-direction: column; gap: 2px; }
.acc-tag { font-family: var(--font-display); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--teal-deep); text-transform: uppercase; }
.acc-title { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: clamp(15.5px, 2vw, 17.5px); line-height: 1.3; }
.acc-arrow { display: flex; color: var(--teal-deep); transition: transform var(--dur-fast); }
.acc-arrow svg { width: 21px; height: 21px; }
.acc.open .acc-arrow { transform: rotate(180deg); }
.acc-body { padding: 0 22px 22px 76px; }
/* Collapsed only once learn.js can open them again (html.js is set in each page's head). */
.js .acc:not(.open) .acc-body { display: none; }
.acc-body p { font-size: 15.5px; line-height: 1.72; color: var(--body); margin: 0 0 12px; }
.acc-body p:last-child { margin-bottom: 0; }

/* ── Open cards and lists ─────────────────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.card { background: var(--cream-soft); border-radius: 20px; border: 1.5px solid rgba(29,43,91,0.07); padding: 18px 20px; }
.card-t { font-family: var(--font-display); font-weight: 800; font-size: 16.5px; line-height: 1.3; color: var(--navy); margin: 0 0 6px; }
.card p { font-size: 15px; line-height: 1.7; color: var(--body); }

.dots { list-style: none; margin: 12px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dots li { position: relative; padding-left: 22px; font-size: 15.5px; line-height: 1.68; color: var(--body); }
.dots li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.dots li b { font-family: var(--font-display); color: var(--navy); }

/* ── Closing + sources ────────────────────────────────────────── */
.closing { background: var(--navy); border-radius: 22px; padding: 26px 24px; margin: 36px 0 8px; text-align: center; }
.closing-h { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: #fff; line-height: 1.45; margin: 0 0 8px; }
.closing p { font-size: 14.5px; color: rgba(255,255,255,0.75); line-height: 1.65; }

.sources { margin: 28px 0 0; border: 1px solid var(--rule); border-radius: 18px; background: var(--cream-soft); }
.sources summary { cursor: pointer; list-style: none; padding: 16px 20px; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sources summary::-webkit-details-marker { display: none; }
.sources summary::after { content: "+"; font-size: 20px; color: var(--teal-deep); line-height: 1; }
.sources[open] summary::after { content: "–"; }
.sources-body { padding: 0 20px 18px; }
.sources-body p { font-size: 13.5px; line-height: 1.6; color: var(--muted-text); margin: 0 0 12px; }
.sources ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.sources li { font-size: 13.5px; line-height: 1.55; color: var(--body); }

/* ── Guide-to-guide footer ────────────────────────────────────── */
.guide-foot { max-width: 680px; margin: 28px auto 0; padding: 22px 22px 56px; border-top: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.foot-prev { display: inline-flex; align-items: center; gap: 7px; color: var(--muted-text); font-family: var(--font-display); font-weight: 700; font-size: 14px; text-decoration: none; }
.foot-next { display: inline-flex; align-items: center; gap: 7px; background: var(--teal-deep); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 14px; padding: 11px 18px; border-radius: 999px; text-decoration: none; margin-left: auto; transition: background var(--dur-fast); }
.foot-next:hover { background: var(--teal-deeper); }
.foot-prev svg, .foot-next svg { width: 17px; height: 17px; }

/* Inside the signed-in app's iframe the app supplies its own navigation. */
.framed .topnav, .framed [data-public-only] { display: none; }

@media (max-width: 560px) {
  .page { padding-top: 26px; }
  .nav-step { display: none; }
  .topnav-inner { grid-template-columns: 1fr auto; }
  .nav-brand { justify-self: end; }
  .acc-btn { padding: 16px; gap: 12px; }
  .acc-body { padding: 0 18px 20px; }
  /* Phone type matches the articles' data-sc-mobile-type block. */
  .nav-back { font-size: 15px; padding: 10px 0; }
  .acc-body p, .card p, .dots li, .callout, .section-sub, .prose p { font-size: 16px; }
  .foot-prev, .foot-next { font-size: 15px; }
  .sources-body p, .sources li { font-size: 14.5px; }
}
