/* rdsm.tumee.org — shared stylesheet
 *
 * One file for all six pages. No external fonts, scripts or images anywhere on
 * this site: the whole thing is HTML, this stylesheet and site.js.
 *
 * Sans throughout, not the Charter serif the main tumee.org pages use. Charter's
 * Cyrillic coverage is inconsistent across the systems it falls back through, and
 * half this site is Mongolian — a heading that silently reflows into a different
 * face mid-sentence is worse than not using a serif at all.
 *
 * The palette is the institutional white-and-blue that national health bodies
 * and the international rare-disease alliances all converge on. It is a
 * deliberate genre signal, not a copy of anyone's brand: the mark, the type and
 * the layout here are this site's own.
 *
 * Bilingual rule: every translatable node is duplicated, tagged data-l="mn" or
 * data-l="en", and the inactive one is hidden by the selector at the bottom of
 * this file. That is a CSS rule, not a script, so the page is readable in
 * Mongolian (the markup's own lang) before site.js runs or if it never does.
 */

:root {
  color-scheme: light;
  --bg:#fbfcfd; --surface:#ffffff; --surface-2:#eff4f9;
  --ink:#121821; --ink-2:#3f4c5c; --muted:#74808e;
  --line:#e0e7ef; --line-strong:#bfcada;
  --accent:#1a5fb4; --accent-ink:#154c90; --accent-soft:rgba(26,95,180,.08);
  --on-accent:#ffffff;
  /* The four Rare Disease Day stripe colours, used in the rule under section
     headings and in the mark. Never as text colour: none clears 4.5:1 here. */
  --s1:#e05c8a; --s2:#7a5cc4; --s3:#2f7fd4; --s4:#3aa06a;
  --warn-bg:#fdf3e3; --warn-line:#e8c98b; --warn-ink:#6b4c12;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#0e1319; --surface:#151b23; --surface-2:#1c242e;
    --ink:#eef2f7; --ink-2:#bac5d2; --muted:#8794a3;
    --line:#252e39; --line-strong:#39434f;
    --accent:#68a8f0; --accent-ink:#9cc8f8; --accent-soft:rgba(104,168,240,.12);
    --on-accent:#08203a;
    --s1:#f08cae; --s2:#a38ade; --s3:#6aa8e4; --s4:#63bd8c;
    --warn-bg:#2a2413; --warn-line:#5e4c1e; --warn-ink:#f0d79a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#0e1319; --surface:#151b23; --surface-2:#1c242e;
  --ink:#eef2f7; --ink-2:#bac5d2; --muted:#8794a3;
  --line:#252e39; --line-strong:#39434f;
  --accent:#68a8f0; --accent-ink:#9cc8f8; --accent-soft:rgba(104,168,240,.12);
  --on-accent:#08203a;
  --s1:#f08cae; --s2:#a38ade; --s3:#6aa8e4; --s4:#63bd8c;
  --warn-bg:#2a2413; --warn-line:#5e4c1e; --warn-ink:#f0d79a;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Noto Sans","Helvetica Neue",Arial,sans-serif;
  font-size:17px;line-height:1.62;-webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{line-height:1.18;letter-spacing:-.018em;margin:0 0 .7rem;font-weight:600;text-wrap:balance}
h1{font-size:clamp(1.9rem,4.4vw,2.75rem);letter-spacing:-.026em}
h2{font-size:clamp(1.4rem,3vw,1.85rem)}
h3{font-size:1.08rem;letter-spacing:-.012em}
p{margin:0 0 1.05rem;text-wrap:pretty}
p:last-child{margin-bottom:0}
ul,ol{margin:0 0 1.05rem;padding-left:1.25rem}
li{margin:0 0 .45rem}
li:last-child{margin-bottom:0}
strong{font-weight:600}
a{color:var(--accent-ink);text-underline-offset:3px;text-decoration-thickness:1px}
a:hover{text-decoration-thickness:2px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}

.wrap{max-width:44rem;margin:0 auto;padding-inline:1.25rem}
.wrap-wide{max-width:66rem;margin:0 auto;padding-inline:1.25rem}
.mono{
  font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;
  font-size:.7rem;letter-spacing:.14em;text-transform:uppercase;
}

.skip{position:absolute;left:-9999px;top:0;z-index:60;background:var(--accent);color:var(--on-accent);padding:.6rem 1rem;border-radius:0 0 4px 0}
.skip:focus{left:0}

/* ---- draft banner -------------------------------------------------------
   Delete this block, the .draft markup at the top of all six pages, and the
   .ph rule below once the copy has been checked by the society. */
.draft{background:var(--warn-bg);border-bottom:1px solid var(--warn-line);color:var(--warn-ink);padding:.6rem 1.25rem;font-size:.84rem;line-height:1.5}
.draft .wrap-wide{padding-inline:0}
.draft b{font-weight:700}

/* Inline marker for a specific unverified value. Deliberately loud: it should
   be impossible to publish one by accident. */
.ph{background:var(--warn-bg);color:var(--warn-ink);border-bottom:1px dashed var(--warn-line);padding:0 .22em;border-radius:2px;font-style:normal}

/* ---- top bar ---- */
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--bg) 90%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.topbar .wrap-wide{display:flex;align-items:center;gap:1rem;padding-block:.85rem}
.brand{display:flex;align-items:center;gap:.65rem;text-decoration:none;color:var(--ink);margin-right:auto;min-width:0}
.brand .mark{width:30px;height:30px;flex:0 0 auto;color:var(--accent)}
.brand .name{font-weight:650;font-size:1.02rem;letter-spacing:-.02em;line-height:1.15}
.brand .sub{display:block;font-weight:400;font-size:.72rem;color:var(--muted);letter-spacing:.01em}
.navlinks{display:flex;gap:1.05rem;flex-wrap:wrap}
.navlinks a{color:var(--ink-2);text-decoration:none;padding-bottom:2px;border-bottom:1px solid transparent}
.navlinks a:hover{color:var(--accent-ink);border-bottom-color:var(--accent)}
.navlinks a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}
.langtog{display:inline-flex;align-items:center;gap:.2rem}
.langtog button{font:inherit;font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;font-size:.7rem;letter-spacing:.12em;background:none;border:none;cursor:pointer;padding:.15rem .1rem;color:var(--muted)}
.langtog button:hover{color:var(--accent-ink)}
.langtog button[aria-pressed="true"]{color:var(--ink);font-weight:700}
.langtog .slash{color:var(--line-strong)}
/* Narrow: two rows, not three. The brand reserves 5rem for the toggle and the
   toggle is pulled ahead of the links by `order`, so row one is brand + MN/EN
   and row two is the links. Without the reorder, source order puts the
   full-width link row in between and the toggle lands alone on a third row. */
@media (max-width:860px){
  .topbar .wrap-wide{flex-wrap:wrap;row-gap:.55rem}
  .brand{margin-right:0;width:calc(100% - 5rem);order:1}
  .langtog{margin-left:auto;order:2}
  .navlinks{width:100%;gap:.85rem;font-size:.66rem;order:3}
}

/* ---- hero ---- */
.hero{padding-block:3.4rem 2.6rem}
.eyebrow{color:var(--accent-ink);margin-bottom:1rem}
.lede{font-size:1.08rem;line-height:1.7;color:var(--ink-2);border-left:2px solid var(--accent);padding-left:1.1rem;margin:1.4rem 0 0;max-width:36rem}
.cta-row{display:flex;flex-wrap:wrap;gap:.7rem;margin-top:2rem}
.btn{display:inline-block;padding:.62rem 1.15rem;border-radius:3px;text-decoration:none;font-size:.92rem;font-weight:600;border:1px solid var(--accent)}
.btn-solid{background:var(--accent);color:var(--on-accent)}
.btn-solid:hover{background:var(--accent-ink);border-color:var(--accent-ink)}
.btn-ghost{color:var(--accent-ink);background:transparent}
.btn-ghost:hover{background:var(--accent-soft)}

/* The zebra rule. The rare-disease community's own symbol is the zebra — from
   the teaching line "when you hear hoofbeats, think horses, not zebras", which
   is exactly the reasoning that delays a rare diagnosis. Four bars of unequal
   width in the Rare Disease Day colours, used as a divider and nothing else. */
.zebra{display:flex;gap:3px;height:5px;margin:0 0 1.5rem;max-width:9rem}
.zebra i{display:block;height:100%;border-radius:1px}
.zebra i:nth-child(1){width:14px;background:var(--s1)}
.zebra i:nth-child(2){width:26px;background:var(--s2)}
.zebra i:nth-child(3){width:10px;background:var(--s3)}
.zebra i:nth-child(4){width:34px;background:var(--s4)}

/* ---- sections ---- */
.sec{padding-block:2.6rem;border-top:1px solid var(--line);scroll-margin-top:5.5rem}
.sec > .kick{color:var(--accent-ink);display:block;margin-bottom:.55rem}
.sec-intro{color:var(--ink-2);max-width:38rem}

/* ---- strategic goals ----
   Three numbered blocks stating what the society is trying to change. Wide
   measure, large type, one per row on narrow. */
.goals{display:grid;gap:1px;grid-template-columns:repeat(3,minmax(0,1fr));background:var(--line);border:1px solid var(--line);border-radius:5px;overflow:hidden;margin-top:1.8rem}
@media (max-width:820px){.goals{grid-template-columns:minmax(0,1fr)}}
.goal{background:var(--surface);padding:1.5rem 1.35rem;display:flex;flex-direction:column;gap:.55rem;text-decoration:none;color:inherit}
a.goal:hover{background:var(--surface-2)}
.goal .n{font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;font-size:.72rem;letter-spacing:.14em;color:var(--accent-ink);font-weight:600}
.goal h3{font-size:1.12rem;margin:0;line-height:1.3}
.goal p{font-size:.92rem;color:var(--ink-2);margin:0}

/* ---- cards ---- */
.cards{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));margin-top:1.6rem}
.card{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:1.15rem 1.2rem}
.card h3{margin-bottom:.4rem}
.card p{font-size:.94rem;color:var(--ink-2)}
.card .tag{display:block;color:var(--muted);margin-bottom:.6rem}

/* ---- stat strip ----
   Two columns at every width, deliberately not auto-fit. The separators here
   are the grid gap showing the container's background through, so a track with
   no cell in it is a grey block rather than empty space. Two columns divides
   four evenly and cannot orphan. Keep the number of stats even. */
.stats{display:grid;gap:1px;grid-template-columns:repeat(2,minmax(0,1fr));background:var(--line);border:1px solid var(--line);border-radius:5px;overflow:hidden;margin-top:1.6rem}
.stat{background:var(--surface);padding:1.1rem 1.15rem}
.stat .n{font-size:1.75rem;font-weight:650;letter-spacing:-.03em;line-height:1.1;color:var(--ink)}
.stat .l{font-size:.86rem;color:var(--ink-2);margin-top:.3rem}
.srcnote{font-size:.8rem;color:var(--muted);margin-top:.9rem}

/* ---- callout ---- */
.callout{background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:4px;padding:1.05rem 1.2rem;margin:1.6rem 0;font-size:.95rem}
.callout h3{font-size:.98rem;margin-bottom:.35rem}

/* ---- steps / ordered prose ---- */
.steps{list-style:none;padding:0;margin:1.4rem 0 0;counter-reset:step}
.steps > li{counter-increment:step;position:relative;padding-left:2.6rem;margin-bottom:1.4rem}
.steps > li::before{content:counter(step,decimal-leading-zero);position:absolute;left:0;top:.1rem;font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;font-size:.78rem;color:var(--accent-ink);font-weight:600;letter-spacing:.04em}
.steps h3{margin-bottom:.3rem}
.steps p{font-size:.95rem;color:var(--ink-2)}

/* ---- link list (resources) ---- */
.links-list{list-style:none;padding:0;margin:1.4rem 0 0}
.links-list li{border-top:1px solid var(--line);padding:.95rem 0;margin:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.2rem}
.links-list li:last-child{border-bottom:1px solid var(--line)}
.links-list .t{font-weight:600}
.links-list .d{font-size:.9rem;color:var(--ink-2)}
.links-list .u{font-size:.78rem;color:var(--muted);word-break:break-all;font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace}

/* ---- news / events rows ---- */
.feed{list-style:none;padding:0;margin:1.4rem 0 0;border-top:1px solid var(--line)}
.feed li{margin:0;padding:1rem 0;border-bottom:1px solid var(--line);display:grid;grid-template-columns:7.5rem minmax(0,1fr);gap:.3rem 1.2rem;align-items:baseline}
.feed time{font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;font-size:.74rem;letter-spacing:.08em;color:var(--muted)}
.feed .t{font-weight:600}
.feed .d{font-size:.92rem;color:var(--ink-2);grid-column:2}
@media (max-width:560px){.feed li{grid-template-columns:minmax(0,1fr)}.feed .d{grid-column:1}}

/* ---- definition rows ---- */
.rows{border-top:1px solid var(--line);margin-top:1.4rem}
.rows div{display:grid;grid-template-columns:11rem minmax(0,1fr);gap:.4rem 1rem;padding:.85rem 0;border-bottom:1px solid var(--line)}
.rows dt{color:var(--muted);font-size:.82rem;letter-spacing:.04em}
.rows dd{margin:0}
@media (max-width:560px){.rows div{grid-template-columns:minmax(0,1fr)}}

/* ---- empty state ---- */
.empty{border:1px dashed var(--line-strong);border-radius:5px;padding:2.2rem 1.3rem;text-align:center;color:var(--ink-2);margin-top:1.6rem}
.empty .mono{color:var(--muted);display:block;margin-bottom:.6rem}

/* ---- closing call to action ---- */
.band{background:var(--surface-2);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding-block:2.8rem;margin-top:3rem}
.band h2{margin-bottom:.6rem}
.band p{color:var(--ink-2);max-width:34rem}

/* ---- footer ---- */
.site-foot{border-top:1px solid var(--line);padding-block:2.4rem 3rem;background:var(--surface-2)}
.band + .site-foot{border-top:0;margin-top:0}
.foot-grid{display:grid;gap:1.8rem;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr))}
.foot-grid h4{font-size:.78rem;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono",Menlo,Consolas,monospace;font-weight:500;margin-bottom:.6rem}
.foot-grid p,.foot-grid li{font-size:.9rem;color:var(--ink-2)}
.foot-grid ul{list-style:none;padding:0}
.foot-grid a{color:var(--ink-2)}
.colophon{display:flex;flex-wrap:wrap;gap:.4rem 1.4rem;margin-top:2rem;padding-top:1.1rem;border-top:1px solid var(--line);color:var(--muted);font-size:.8rem}

.scroll-x{overflow-x:auto}

/* ---- the bilingual switch ----------------------------------------------
   Hide the inactive language. Nothing restores a display value, so each node
   keeps whatever display it naturally had. <html lang> is "mn" in the markup,
   so Mongolian is what renders with JavaScript disabled. */
html[lang="mn"] [data-l="en"],
html[lang="en"] [data-l="mn"]{display:none!important}
