/* Open Menopause Data Elements: shared styles, version 0.1.0 (see STYLE_GUIDE.md). Light theme only.
   Global rules stay small (tokens, base, header, footer, focus) so section pages under evidence/ and reach/ can
   scope their own. Content rules for the main pages sit under main.page. */
:root {
  --ink: #1a1d23;
  --muted: #5b6270;
  --line: #d9dde3;
  --surface: #ffffff;
  --tint: #f4f6f9;
  --link: #1757ac;
  --link-ink: #ffffff;
  --core: #1757ac;
  --supplemental: #0f6b5c;
  --exploratory: #7a4b00;
  --warn: #fff4d6;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 10; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--surface); color: var(--link); }
.skip:focus { top: 8px; }

/* Site header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); font-family: var(--font); }
.site-header-inner {
  max-width: 80rem; margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px;
}
.site-brand {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; letter-spacing: -0.01em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0 -8px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 8px;
  color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; border-radius: 8px;
}
.site-nav a:hover { color: var(--ink); background: var(--tint); }
.site-nav a[aria-current="page"] { color: var(--link); box-shadow: inset 0 -2px 0 var(--link); border-radius: 0; }

/* Site footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; font-family: var(--font); }
.site-footer-inner { max-width: 80rem; margin: 0 auto; padding: 24px 16px 32px; color: var(--muted); font-size: 14px; }
.site-footer-inner p { margin: 0 0 8px; max-width: 72ch; }
.site-footer a { color: var(--link); display: inline-flex; align-items: center; min-height: 44px; }

/* Main pages */
.page { max-width: 80rem; margin: 0 auto; padding: 0 16px; }
.page a { color: var(--link); }
.page h1 { margin: 32px 0 16px; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; max-width: 24ch; }
.page h2 { margin: 48px 0 12px; font-size: clamp(22px, 3vw, 28px); line-height: 1.25; font-weight: 600; }
.page h3 { margin: 24px 0 8px; font-size: 18px; line-height: 1.35; font-weight: 600; }
.page p, .page li { max-width: 72ch; }
.lede { font-size: clamp(17px, 2vw, 20px); margin: 0 0 24px; max-width: 60ch; }
.label { margin: 32px 0 0; color: var(--muted); font-weight: 500; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.9em; background: var(--tint); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--surface); }
.card.tinted { background: var(--tint); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.num { font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid var(--link); background: var(--link); color: var(--link-ink);
}
.page a.btn { color: var(--link-ink); }
.btn.secondary, .page a.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.tag-core { color: var(--core); }
.tag-supplemental { color: var(--supplemental); }
.tag-exploratory { color: var(--exploratory); }
.tag-plain { color: var(--muted); }

.note { background: var(--warn); border-radius: 12px; padding: 16px 20px; margin: 16px 0; max-width: 72ch; }
.note p { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 16px 0; }
.page table { border-collapse: collapse; width: 100%; font-size: 15px; }
.page th, .page td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.page th { background: var(--tint); font-weight: 600; }
.page tr:last-child td { border-bottom: 0; }
.page td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; }
.field > label, .field > legend, fieldset.field legend { font-weight: 600; }
.field .hint { color: var(--muted); font-size: 14px; }
.page select, .page input[type="search"], .page input[type="text"], .page input[type="number"], .page input[type="month"] {
  min-height: 44px; padding: 8px 12px; border: 1px solid #8a919c; border-radius: 8px; background: var(--surface);
  color: var(--ink); font: 16px var(--font); width: 100%; max-width: 28rem;
}
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.field > .choice { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 400; }
.choice input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--link); }

/* Browse */
.filters { display: grid; gap: 0 16px; grid-template-columns: 1fr; margin: 16px 0 8px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.results { list-style: none; padding: 0; margin: 8px 0; }
.results li { border-top: 1px solid var(--line); padding: 12px 0; max-width: none; }
.results .head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.results .head a { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
.results .q { margin: 0; color: var(--muted); font-size: 15px; }

/* Element view */
.answers { padding-left: 0; list-style: none; margin: 8px 0; }
.answers li { padding: 4px 0; }
.answers .v { display: inline-block; min-width: 3ch; color: var(--muted); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 1fr; gap: 4px 24px; margin: 8px 0; }
@media (min-width: 720px) { .kv { grid-template-columns: 12rem 1fr; } }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0 0 8px; }

/* Calculator */
.calc { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .calc { grid-template-columns: 3fr 2fr; } .calc .result { position: sticky; top: 16px; } }
.result h2 { margin-top: 0; }
.result .stage { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
.page details { margin: 8px 0; }
.page summary { display: list-item; padding: 10px 0; cursor: pointer; color: var(--link); font-weight: 500; }
[hidden] { display: none !important; }
