/* Localități izolate din România — atlas plate: paper, ink, wax seals. */
:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f5f0e4;
  --bg-raise: #fffdf6;
  --ink: #1f2a33;
  --ink-soft: #5a6672;
  --line: #ddd3bd;
  --line-strong: #c9bd9e;
  --seal: #b3402e;
  --seal-ink: #8c2f20;
  --gold: #8a6d1f;
  --link: #8c2f20;
  --shadow: 0 1px 2px rgba(31, 42, 51, .08), 0 4px 14px rgba(31, 42, 51, .08);
  --m-sea: #dfe8ea;
  --m-neigh: #e6e0cf;
  --m-land: #f7f2e4;
  --m-county: #c9bd9e;
  --m-river: #7d9aa3;
  --m-danube: #5d7f88;
  --m-road: #a89a86;
  --m-grat: #c3cfd2;
  --m-frame: #6d6046;
  --m-label: #5a6b70;
  --m-halo: rgba(247, 242, 228, .92);
  --m-city: #3c444c;
}
html[data-theme="dark"] {
  --bg: #0c1424;
  --bg-raise: #131e33;
  --ink: #e8e2d2;
  --ink-soft: #a8b0bc;
  --line: #2a3a55;
  --line-strong: #3a5075;
  --seal: #e0664f;
  --seal-ink: #f08a72;
  --gold: #c9a227;
  --link: #f08a72;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .3);
  --m-sea: #0a1420;
  --m-neigh: #111b2e;
  --m-land: #1a2740;
  --m-county: #33456a;
  --m-river: #4e7a86;
  --m-danube: #6a9aa6;
  --m-road: #7a6a55;
  --m-grat: #1e2c44;
  --m-frame: #5a6b8c;
  --m-label: #9aa8bc;
  --m-halo: rgba(12, 20, 36, .9);
  --m-city: #c8d0dc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
main, .footer { padding-inline: max(1.1rem, 50vw - 34rem); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: .4em 0 .3em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: .3em 0 .5em; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Topbar (house pattern). */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem max(1.1rem, 50vw - 34rem);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.skip { position: absolute; left: .6rem; top: -3rem; background: var(--bg-raise); padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 6px; transition: top .15s; }
.skip:focus { top: .4rem; }
.brand { font-family: var(--serif); font-style: italic; color: var(--ink); text-decoration: none; margin-right: auto; }
.topnav { display: flex; gap: 1rem; }
.topnav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; }
.topnav a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: .15rem .8rem; font-size: .9rem; color: var(--ink); text-decoration: none; background: var(--bg-raise); }
.icon-btn { border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink); border-radius: 999px; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn .sun { fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn .moon path { fill: currentColor; }
html[data-theme="dark"] .icon-btn .sun, .icon-btn .moon[hidden] { display: none; }
html[data-theme="dark"] .icon-btn .moon { display: block; }

/* Type rhythm. */
.kicker { font-family: var(--serif); font-style: italic; color: var(--seal-ink); margin: 0; }
.lede { color: var(--ink-soft); max-width: 46rem; }
section { padding-block: 2.2rem; }
section[id] { scroll-margin-top: 4rem; }
section + section { border-top: 1px solid var(--line); }
.prose { max-width: 44rem; }

/* Buttons. */
.btn { display: inline-block; background: var(--seal); color: #fff; text-decoration: none; border: 1px solid var(--seal); border-radius: 10px; padding: .6rem 1.2rem; font-weight: 600; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.small { padding: .35rem .8rem; font-size: .9rem; border-radius: 8px; }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; }

/* Hero. */
.hero { padding-top: 2.4rem; }
.deck { font-size: 1.22rem; color: var(--ink-soft); max-width: 40rem; }
.stats { list-style: none; display: flex; gap: 2.2rem; flex-wrap: wrap; padding: 1rem 0 0; margin: 1rem 0 0; }
.stats strong { display: block; font-family: var(--serif); font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-soft); font-size: .95rem; }

/* Share row (house contract). */
.share { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; }
.share-lead { margin: 0; font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.share-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; }

/* Controls. */
.controls { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: end; margin: 1.2rem 0; }
.ctl { margin: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .95rem; }
.ctl label, .ctl legend { font-weight: 600; font-size: .85rem; color: var(--ink-soft); }
.ctl.search { flex: 1 1 16rem; position: relative; }
.ctl input[type="search"], .ctl select {
  font: inherit; color: var(--ink); background: var(--bg-raise);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: .5rem .7rem; max-width: 100%;
}
.ctl input[type="search"] { width: 100%; }
.hint { font-size: .8rem; color: var(--ink-soft); }
.seg-row { border: 0; padding: 0; margin: 0; }
.seg-row legend { padding: 0; margin-bottom: .3rem; }
.seg-row .segs { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg { display: inline-flex; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; border: 1px solid var(--line-strong); background: var(--bg-raise); padding: .45rem .9rem; border-radius: 999px; cursor: pointer; }
.seg span b { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:checked + span b { color: inherit; }
.seg input:focus-visible + span { outline: 2px solid var(--seal); outline-offset: 2px; }
.ctl.check { flex-direction: row; align-items: center; }
.ctl.check label { font-weight: 400; color: var(--ink); display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.ctl.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--seal); }
.ctl.count { font-variant-numeric: tabular-nums; color: var(--ink-soft); min-height: 2.6rem; justify-content: end; }
.sugg {
  position: absolute; z-index: 40; top: 100%; left: 0; right: 0;
  background: var(--bg-raise); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.controls { position: relative; }
.sugg button { display: flex; width: 100%; gap: .6rem; align-items: baseline; background: none; border: 0; border-bottom: 1px solid var(--line); padding: .5rem .8rem; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.sugg button:last-child { border-bottom: 0; }
.sugg button[aria-selected="true"], .sugg button:hover { background: var(--line); }
.sugg .sq { color: var(--ink-soft); font-size: .85rem; margin-left: auto; white-space: nowrap; }

/* Map. */
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.4rem; align-items: start; }
@media (max-width: 62rem) { .map-grid { grid-template-columns: minmax(0, 1fr); } }
.map-fig { margin: 0; min-width: 0; }
.map { display: block; width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--m-sea); }
.map-fig figcaption, .tnote { font-size: .85rem; color: var(--ink-soft); max-width: 60rem; }
.bm-sea { fill: var(--m-sea); }
.bm-grat { fill: none; stroke: var(--m-grat); stroke-width: 1; }
.bm-neigh { fill: var(--m-neigh); }
.bm-land { fill: var(--m-land); stroke: var(--m-frame); stroke-width: 1.5; }
.bm-county { fill: none; stroke: var(--m-county); stroke-width: .9; opacity: .8; }
.bm-river { fill: none; stroke: var(--m-river); stroke-width: 1.2; opacity: .85; }
.bm-danube { fill: none; stroke: var(--m-danube); stroke-width: 2.6; opacity: .9; }
.bm-road { fill: none; stroke: var(--m-road); stroke-width: 1; opacity: .75; }
.bm-frame { fill: none; stroke: var(--m-frame); stroke-width: 2; }
.bm-grat, .bm-land, .bm-county, .bm-river, .bm-danube, .bm-road, .bm-frame { vector-effect: non-scaling-stroke; }
.sea-label, .region-label { font-family: var(--serif); font-style: italic; font-size: 17px; fill: var(--m-label); text-anchor: middle; paint-order: stroke; stroke: var(--m-halo); stroke-width: 4px; pointer-events: none; }
.sea-label { text-transform: uppercase; letter-spacing: .18em; font-size: 14px; }
.city-dot { fill: var(--m-city); }
.city-cap { fill: var(--m-city); transform: rotate(45deg); }
.city-label { font-size: 11.5px; fill: var(--m-city); paint-order: stroke; stroke: var(--m-halo); stroke-width: 3px; pointer-events: none; }
.dot { cursor: pointer; }
.dot circle { stroke: var(--m-halo); stroke-width: 1.5px; }
.dot.iso circle { fill: var(--seal); }
.dot.dsp circle { fill: var(--gold); }
.ray { stroke: var(--seal); stroke-width: 1.6px; stroke-dasharray: 5 4; opacity: 0; vector-effect: non-scaling-stroke; pointer-events: none; }
.ray.on { opacity: .85; }
#sel-ring circle { fill: none; stroke: var(--seal); stroke-width: 2.5px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; }
#sel-ring.ping circle { animation: ping 1.1s ease-out 2; }
@keyframes ping { 0% { transform: scale(.55); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
#sel-tag text { font-size: 13.5px; font-weight: 700; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--m-halo); stroke-width: 4px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #sel-ring.ping circle { animation: none; }
}

/* Record card. */
.record { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); position: sticky; top: 4rem; }
.record h3 { margin: .2rem 0 .3rem; font-size: 1.45rem; }
.record h3 a { color: var(--ink); text-decoration: none; }
.record h3 a:hover { text-decoration: underline; }
.card-tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--seal-ink); border: 1px solid var(--seal); border-radius: 999px; padding: .1rem .6rem; margin: 0 0 .4rem; }
.card-sub { color: var(--ink-soft); margin: 0 0 .8rem; font-size: .92rem; }
.record .k { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.card-pop, .card-dist { margin: .5rem 0; font-variant-numeric: tabular-nums; }
.card-pop strong, .card-dist strong { font-family: var(--serif); font-size: 1.25rem; }
.trend { color: var(--ink-soft); font-size: .9rem; }
.card-note { font-size: .83rem; color: var(--ink-soft); margin: -.3rem 0 .6rem; }
.card-badge { display: inline-block; background: var(--line); border-radius: 6px; padding: .15rem .6rem; font-size: .85rem; margin: .4rem 0; font-variant-numeric: tabular-nums; }
.card-foot { font-size: .82rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: .6rem; }
.alias { font-weight: 400; font-size: 1rem; color: var(--ink-soft); }
.map-empty { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Legend + facts. */
.legend { list-style: none; display: flex; gap: 1.4rem; flex-wrap: wrap; padding: 0; margin: 1rem 0; font-size: .92rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend li { display: flex; gap: .5rem; align-items: center; }
.sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; }
.sw.iso { background: var(--seal); }
.sw.dsp { background: var(--gold); }
.sw.road { background: none; border-top: 2px solid var(--m-road); border-radius: 0; height: 0; width: 1.4rem; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
@media (max-width: 62rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .facts { grid-template-columns: minmax(0, 1fr); } }
.fact { background: var(--bg-raise); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; text-decoration: none; color: var(--ink); display: block; }
.fact:hover { border-color: var(--seal); }
.fact .fk { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--seal-ink); }
.fact .fv { font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Table. */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raise); }
.uat-table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
.uat-table caption { text-align: left; padding: .8rem 1rem; color: var(--ink-soft); font-size: .85rem; white-space: normal; max-width: calc(100vw - 3rem); }
.uat-table th, .uat-table td { padding: .45rem .8rem; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.uat-table thead th { position: sticky; top: 0; background: var(--bg-raise); border-top: 0; font-size: .82rem; color: var(--ink-soft); }
.uat-table tbody tr:hover { background: var(--line); }
.uat-table tbody tr.sel { background: var(--line); box-shadow: inset 3px 0 0 var(--seal); }
.uat-table .num { text-align: right; }
.uat-table small { color: var(--ink-soft); }
.uat-table .nm a { color: var(--ink); font-weight: 600; text-decoration: none; }
.uat-table .nm a:hover { text-decoration: underline; }

/* Method + footer + totop. */
.sources { columns: 2; column-gap: 2rem; max-width: 60rem; }
@media (max-width: 50rem) { .sources { columns: 1; } }
.sources li { break-inside: avoid; margin-bottom: .4rem; }
.footer { border-top: 1px solid var(--line); margin-top: 2rem; padding-block: 1.6rem 2.4rem; color: var(--ink-soft); font-size: .92rem; }
.footer .flinks { display: flex; gap: 1.2rem; }
#totop { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--ink); border-radius: 999px; padding: .5rem .9rem; cursor: pointer; box-shadow: var(--shadow); }
@media (max-width: 40rem) { .topnav { display: none; } }
@media print { .topbar, .controls, .share-row, #totop, .record { display: none; } }
@media (prefers-reduced-motion: reduce) { .btn, .fact, .seg span { transition: none; } }
