/* ============================================================================
   ShePrep base theme
   ---------------------------------------------------------------------------
   Palette : bone / espresso / marigold / deep teal, with a warm "2am mode"
   Type    : Iowan–Palatino serif for reading, system sans for UI and data
   Layout  : 1280px shell, two-column with a sticky rail
   Perf    : zero webfont requests — LCP gates ad RPM, so fonts cost nothing.
             All ad slots carry fixed heights so CLS stays at 0.
   ========================================================================= */

/* ---------------------------------------------------------------- TOKENS  */
:root {
  --ground:    #FDFBF6;
  --card:      #FFFFFF;
  --card-2:    #F6F1E7;
  --ink:       #26201B;
  --ink-2:     #574C42;
  --ink-3:     #8A7C6E;
  --rule:      #E4DACA;
  --rule-2:    #F0E9DC;

  --marigold:  #B87514;
  --marigold-2:#D89428;
  --mari-wash: #FBF1DE;

  --teal:      #1F5E5B;
  --teal-wash: #E3EDEB;

  --alert:     #A44A2E;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           "Sitka Text", Charter, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --measure: 70ch;
  --radius: 8px;
  --gutter: clamp(1.15rem, 3.5vw, 2.25rem);
  --shell: 1280px;
}

/* 2am mode — warm-shifted and low-luminance, not a cold inversion.
   This audience does its most anxious searching on a phone in a dark room. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground:#14100D; --card:#1D1813; --card-2:#241E17;
    --ink:#EDE4D8; --ink-2:#BCAF9F; --ink-3:#8A7F72;
    --rule:#33291F; --rule-2:#261F18;
    --marigold:#E0A63C; --marigold-2:#F0BC5C; --mari-wash:#2C2113;
    --teal:#63AFA8; --teal-wash:#172A28;
    --alert:#D98060;
  }
}
:root[data-theme="dark"] {
  --ground:#14100D; --card:#1D1813; --card-2:#241E17;
  --ink:#EDE4D8; --ink-2:#BCAF9F; --ink-3:#8A7F72;
  --rule:#33291F; --rule-2:#261F18;
  --marigold:#E0A63C; --marigold-2:#F0BC5C; --mari-wash:#2C2113;
  --teal:#63AFA8; --teal-wash:#172A28; --alert:#D98060;
}
:root[data-theme="light"] {
  --ground:#FDFBF6; --card:#FFFFFF; --card-2:#F6F1E7;
  --ink:#26201B; --ink-2:#574C42; --ink-3:#8A7C6E;
  --rule:#E4DACA; --rule-2:#F0E9DC;
  --marigold:#B87514; --marigold-2:#D89428; --mari-wash:#FBF1DE;
  --teal:#1F5E5B; --teal-wash:#E3EDEB; --alert:#A44A2E;
}

/* ------------------------------------------------------------------ BASE  */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.35rem, 4.6vw, 3.45rem); letter-spacing: -0.026em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1.1em; }
a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
  border-radius: 4px;
}

.label {
  font-family: var(--sans);
  font-size: .72rem; font-weight: 660;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow {
  font-family: var(--sans); font-size: .73rem; font-weight: 660;
  letter-spacing: .14em; text-transform: uppercase; color: var(--marigold);
}
.num { font-variant-numeric: tabular-nums; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
.prose h2 { margin: 2.3rem 0 .75rem; }
.prose h3 { margin: 1.75rem 0 .5rem; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

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

/* ------------------------------------------------------- MASTHEAD / MARK  */
.masthead {
  background: var(--card); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
}
.masthead__bar { display: flex; align-items: center; gap: 1.75rem; height: 74px; }

.brand { display: inline-flex; align-items: center; gap: .62rem; text-decoration: none; }
.brand__mark { flex: none; display: block; }
.brand__mark .ring { transform-origin: 50% 50%; animation: sweep .9s cubic-bezier(.4,0,.2,1) both; }
@keyframes sweep { from { stroke-dashoffset: 62; } to { stroke-dashoffset: 0; } }
.brand__word {
  position: relative;
  font-family: var(--serif); font-size: 1.62rem; font-weight: 600;
  letter-spacing: -.03em; color: var(--ink); line-height: 1; white-space: nowrap;
}
.brand__word em { font-style: italic; font-weight: 500; letter-spacing: -.012em; }
.brand__swash {
  position: absolute; left: 46%; right: -6px; bottom: -9px; height: 8px;
  overflow: visible; pointer-events: none;
}
.brand__swash path { stroke: var(--marigold); stroke-width: 2; fill: none; stroke-linecap: round; }

.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a {
  font-family: var(--sans); font-size: .93rem; font-weight: 520;
  color: var(--ink-2); text-decoration: none; padding: .35rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--marigold); }
@media (max-width: 940px) { .nav { display: none; } }

.lamp {
  font-family: var(--sans); font-size: .82rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .42rem;
  background: var(--card-2); color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 100px;
  padding: .45rem .9rem; cursor: pointer;
}
.lamp:hover { color: var(--ink); border-color: var(--marigold); }

/* ------------------------------------------------------------ WEEK RULER  */
.ruler { background: var(--card); border-bottom: 1px solid var(--rule); padding: .7rem 0 .8rem; }
.ruler__inner { display: flex; align-items: flex-end; height: 28px; }
.ruler__tick { flex: 1 1 0; min-width: 0; border-left: 1px solid var(--rule); height: 9px; position: relative; }
.ruler__tick[data-major] { height: 17px; border-left-color: var(--ink-3); }
.ruler__tick[data-major]::after {
  content: attr(data-major); position: absolute; top: -15px; left: -1px;
  font-family: var(--sans); font-size: .66rem; font-weight: 640;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.ruler__tick[data-state="past"] { background: var(--marigold); opacity: .2; }
.ruler__tick[data-state="now"] {
  background: var(--marigold); height: 24px; opacity: 1; border-left-color: var(--marigold);
}
.ruler__legend {
  display: flex; justify-content: space-between; margin-top: .35rem;
  font-family: var(--sans); font-size: .7rem; color: var(--ink-3);
  letter-spacing: .07em; text-transform: uppercase;
}
@media (max-width: 700px) { .ruler { display: none; } }

/* ------------------------------------------------------ BREADCRUMB /GRID  */
/* Ordered list, because a breadcrumb trail is a sequence and the order carries
   meaning. Separators are generated, so they never reach the accessibility
   tree or get copied with the text. */
.crumb { padding: 1.1rem 0 0; }
.crumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-family: var(--sans); font-size: .84rem; color: var(--ink-3);
}
.crumb li { display: flex; align-items: center; gap: .45rem; }
.crumb li + li::before { content: "›"; color: var(--rule); }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--marigold); text-decoration: underline; }
.crumb [aria-current="page"] { color: var(--ink-2); }

.grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(1.75rem, 3.5vw, 3.5rem);
  align-items: start; padding-block: 1.4rem 4rem;
}
@media (max-width: 1060px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 58ch; margin-top: .85rem; }

/* ------------------------------------------------------- REVIEWER STRIP   */
/* Sits ABOVE the tool or article body — the placement quality raters and
   the strongest competitors (Flo) both use on YMYL pages. */
.reviewed {
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.1rem;
  background: var(--card-2); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 1.5rem 0 2rem;
  font-family: var(--sans); font-size: .9rem; color: var(--ink-2);
}
.reviewed__pic {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--mari-wash); color: var(--marigold);
  display: grid; place-items: center; font-weight: 700; font-size: .88rem;
}
.reviewed b { color: var(--ink); font-weight: 650; }
.pill {
  font-family: var(--sans); font-size: .76rem; font-weight: 640;
  background: var(--teal-wash); color: var(--teal);
  border-radius: 100px; padding: .25rem .7rem;
}

/* ------------------------------------------------------------ CALCULATOR  */
.calc {
  background: var(--card); border: 1px solid var(--rule);
  border-top: 3px solid var(--marigold); border-radius: var(--radius); overflow: hidden;
}
.calc__head {
  padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid var(--rule-2);
  background: var(--card-2);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.calc__head h2 { font-size: 1.35rem; }
.calc__body { padding: 1.6rem 1.5rem; }

.methods { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.6rem; }
.methods input { position: absolute; opacity: 0; pointer-events: none; }
.methods label {
  font-family: var(--sans); font-size: .89rem; font-weight: 550;
  padding: .52rem 1rem; border: 1px solid var(--rule); border-radius: 100px;
  cursor: pointer; color: var(--ink-2); background: var(--card);
}
.methods label:hover { border-color: var(--marigold); color: var(--ink); }
.methods input:checked + label {
  background: var(--mari-wash); border-color: var(--marigold);
  color: var(--marigold); font-weight: 640;
}
.methods input:focus-visible + label { outline: 2px solid var(--marigold); outline-offset: 3px; }

.field { margin-bottom: 1.35rem; }
.field__label {
  display: block; font-family: var(--sans); font-size: .95rem;
  font-weight: 620; color: var(--ink); margin-bottom: .5rem;
}
.hint {
  font-family: var(--sans); font-size: .85rem; color: var(--ink-3);
  margin-top: .45rem; line-height: 1.55; max-width: 56ch;
}

/* Discrete D / M / Y. Never a single date field — "03/04" is two different
   dates depending on the reader's country, and a due date is the wrong place
   for a parsing bug. Same approach the NHS uses. */
.dmy { display: flex; gap: .55rem; align-items: flex-end; }
.dmy__u { display: flex; flex-direction: column; gap: .3rem; }
.dmy__u span {
  font-family: var(--sans); font-size: .7rem; font-weight: 620;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.dmy input, .sel {
  font-family: var(--sans); font-size: 1.08rem; font-variant-numeric: tabular-nums;
  padding: .68rem .6rem; text-align: center;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--ground); color: var(--ink);
}
.dmy input:hover, .sel:hover { border-color: var(--ink-3); }
.dmy .w2 { width: 70px; }
.dmy .w4 { width: 96px; }
.sel { text-align: left; min-width: 210px; padding-inline: .85rem; }

.result {
  margin-top: 1.6rem; padding: 1.4rem 1.5rem;
  background: var(--mari-wash);
  border: 1px solid color-mix(in srgb, var(--marigold) 30%, transparent);
  border-radius: var(--radius);
  display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center;
}
@media (max-width: 620px) { .result { grid-template-columns: 1fr; gap: 1.1rem; } }

/* Tools with no progress dial — hCG doubling, implantation, semen analysis,
   Rh compatibility. The default .result grid is shaped for dial + text, so
   without this their output renders into a narrow auto-sized column. */
.result--plain { display: block; }

.arc { width: 116px; height: 116px; position: relative; flex: none; }
.arc svg { transform: rotate(-90deg); display: block; }
.arc__n {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--sans); font-weight: 700; font-size: 1.65rem;
  letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1;
}
.arc__n small {
  display: block; font-size: .62rem; font-weight: 640;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: .25rem;
}

.result__say { font-family: var(--sans); font-size: .95rem; color: var(--ink-2); margin: 0; }
.result__date {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 2.6rem); letter-spacing: -.025em;
  line-height: 1.12; margin: .18rem 0 .45rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.result__sub { font-family: var(--sans); font-size: .95rem; color: var(--ink-2); margin: 0; }
.result__sub b { color: var(--ink); font-weight: 650; }

.terms { margin-top: 1.35rem; }
.terms__bar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.terms__seg {
  flex: 1; display: grid; place-items: center;
  font-family: var(--sans); font-size: .72rem; font-weight: 640;
  color: var(--ink-2); background: var(--card-2);
}
.terms__seg[data-t="full"] { background: var(--marigold); color: #fff; flex: 1.6; }
.terms__seg[data-t="early"], .terms__seg[data-t="late"] {
  background: color-mix(in srgb, var(--marigold) 30%, var(--card-2));
}
.terms__scale {
  display: flex; justify-content: space-between; margin-top: .35rem;
  font-family: var(--sans); font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.reassure {
  margin-top: 1.4rem; padding: 1rem 1.2rem;
  background: var(--teal-wash); border-radius: 6px; font-size: 1rem; color: var(--ink-2);
}
.reassure b { color: var(--ink); }

.privacy {
  font-family: var(--sans); font-size: .85rem; color: var(--ink-3);
  margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--rule-2);
}

/* ----------------------------------------------------------- ANSWER-FIRST */
/* States the answer before the essay. Serves reassurance-seeking readers and
   is also what wins featured snippets and AI citations. */
.answer {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.4rem 1.6rem; margin: 1.9rem 0; position: relative;
}
.answer::before {
  content: ""; position: absolute; left: 0; top: 1.4rem; bottom: 1.4rem;
  width: 3px; background: var(--marigold); border-radius: 0 3px 3px 0;
}
.answer .eyebrow { display: block; margin-bottom: .5rem; }
.answer p { font-size: 1.08rem; margin-bottom: 0; }
.answer p + p { margin-top: .75rem; }

/* ---------------------------------------------------------- JURISDICTION  */
/* The §2.1 adaptive block. Server-side default comes from CF-IPCountry;
   the tabs let the reader override. Always name the source body. */
.juris {
  border: 1px solid var(--rule); border-left: 3px solid var(--teal);
  border-radius: var(--radius); background: var(--card);
  padding: 1.2rem 1.4rem; margin: 1.9rem 0;
}
.juris__head { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.juris__tabs { display: flex; gap: .32rem; margin-left: auto; flex-wrap: wrap; }
.juris__tabs button {
  font-family: var(--sans); font-size: .8rem; font-weight: 620;
  padding: .32rem .75rem; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-3);
}
.juris__tabs button[aria-selected="true"] {
  background: var(--teal); border-color: var(--teal); color: var(--ground);
}
.juris p:last-of-type { margin-bottom: 0; }
.juris__src { font-family: var(--sans); font-size: .82rem; color: var(--ink-3); margin-top: .7rem; }

/* -------------------------------------------------------------- AD SLOTS  */
/* Fixed heights, always. Ad RPM depends on the Core Web Vitals that
   unreserved slots destroy. */
.ad {
  display: grid; place-items: center; background: var(--card-2);
  border: 1px dashed var(--rule); border-radius: var(--radius); color: var(--ink-3);
  font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
}
.ad--leader { height: 250px; margin: 2rem 0; }
.ad--rail { height: 600px; }
@media (max-width: 600px) { .ad--leader { height: 280px; } }

/* ------------------------------------------------------------------ RAIL  */
.rail { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 1.6rem; }
@media (max-width: 1060px) { .rail { position: static; } }
.rail__block {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 1.2rem 1.35rem;
}
.rail__block h3 { font-size: 1.05rem; margin-bottom: .75rem; }

.toollist { list-style: none; margin: 0; padding: 0; }
.toollist li + li { border-top: 1px solid var(--rule-2); }
.toollist a {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  padding: .62rem 0; font-family: var(--sans); font-size: .93rem;
  color: var(--ink-2); text-decoration: none;
}
.toollist a:hover { color: var(--marigold); }
.toollist .arw { color: var(--ink-3); font-size: .85rem; }

.btn {
  display: block; width: 100%; text-align: center;
  font-family: var(--sans); font-size: .9rem; font-weight: 620;
  background: var(--marigold); color: #fff; border: 1px solid var(--marigold);
  border-radius: 6px; padding: .65rem 1rem; cursor: pointer;
}
.btn:hover { background: var(--marigold-2); border-color: var(--marigold-2); }

/* -------------------------------------------------------- SECTIONS/TOOLS  */
.section { padding-block: 3.5rem; border-top: 1px solid var(--rule); }
.section--tint { background: var(--card-2); }
.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}

.tools {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden;
}
.tool {
  background: var(--card); padding: 1.2rem 1.35rem 1.3rem; text-decoration: none;
  color: inherit; display: flex; flex-direction: column; gap: .38rem;
  transition: background .13s ease;
}
.tool:hover { background: var(--mari-wash); }
.tool__grp {
  font-family: var(--sans); font-size: .68rem; font-weight: 660;
  letter-spacing: .12em; text-transform: uppercase; color: var(--marigold);
}
.tool__name { font-size: 1.16rem; font-weight: 600; letter-spacing: -.015em; }
.tool__desc { font-family: var(--sans); font-size: .88rem; color: var(--ink-3); line-height: 1.55; }

/* --------------------------------------------------------------- ARTICLE  */
.byline { font-family: var(--sans); font-size: .88rem; color: var(--ink-3); margin-top: .9rem; line-height: 1.72; }
.byline b { color: var(--ink-2); font-weight: 640; }

blockquote {
  margin: 2rem 0; padding-left: 1.3rem; border-left: 3px solid var(--marigold);
  font-style: italic; color: var(--ink-2);
}

table.data { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .92rem; min-width: 480px; }
table.data th, table.data td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--rule-2); }
table.data th {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 660; border-bottom-color: var(--rule);
}
table.data td.n { font-variant-numeric: tabular-nums; }

.sources { border-top: 1px solid var(--rule); margin-top: 2.4rem; padding-top: 1.2rem; }
.sources ol { font-family: var(--sans); font-size: .88rem; color: var(--ink-2); padding-left: 1.2rem; margin: .65rem 0 0; }
.sources li { margin-bottom: .45rem; }

/* ---------------------------------------------------------------- FOOTER  */
.foot { background: var(--card-2); border-top: 1px solid var(--rule); padding-block: 3rem 3.5rem; }
.foot__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 2rem; }
.foot h2 {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 .8rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .45rem; }
.foot a { font-family: var(--sans); font-size: .92rem; color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--marigold); }
.foot__note {
  margin-top: 2.25rem; padding-top: 1.4rem; border-top: 1px solid var(--rule);
  font-size: .98rem; color: var(--ink-3); max-width: 66ch;
}

/* ------------------------------------------------------------- UTILITIES  */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--marigold); color: #fff; padding: .7rem 1.1rem;
  font-family: var(--sans); font-size: .9rem; font-weight: 620;
}
.skip-link:focus { left: 0; }
