/* Klečetné – styly. Písma Fraunces a Inter jsou hostovaná u nás (SIL Open Font License, viz /fonts/OFL-*.txt). */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Barvy: papír, inkoust, švestková (sušárny švestek) a okrová (třešně, pole). Tmavý režim podle nastavení systému. */
:root {
  color-scheme: light dark;
  --bg: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f2ede1;
  --ink: #221d18;
  --muted: #5f564c;
  --line: #e3dccd;
  --plum: #7a3b69;          /* sloupce grafu, ověřeno validátorem proti --bg */
  --plum-ink: #6a2f5b;      /* text a odkazy */
  --plum-soft: #f3e8ef;
  --ochre: #9a6416;
  --ochre-soft: #f6ead3;
  --shadow: 0 1px 2px rgba(34, 29, 24, 0.05), 0 10px 30px rgba(34, 29, 24, 0.07);
  --radius: 14px;
  --wrap: 1100px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1916;
    --surface: #24201c;
    --surface-2: #2b2621;
    --ink: #f1ebe2;
    --muted: #b9ae9f;
    --line: #3a332c;
    --plum: #b8649f;        /* ověřeno validátorem proti tmavému --bg */
    --plum-ink: #e3a6d0;
    --plum-soft: #3a2433;
    --ochre: #e0b05e;
    --ochre-soft: #3a2f1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

/* Základ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--plum-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--plum); color: #fff; }
.skip:focus { top: 10px; }
.muted { color: var(--muted); }
small, .small { font-size: 0.875rem; }

/* Štítky spolehlivosti údajů */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: 0.15em;
  white-space: nowrap;
}
.tag-ok { background: var(--surface-2); color: var(--muted); }
.tag-unsure { background: var(--ochre-soft); color: var(--ochre); }
.tag-conflict { background: var(--plum-soft); color: var(--plum-ink); }

/* Hlavička */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand span { color: var(--muted); font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; margin-left: 8px; }
.nav ul { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--muted); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* Úvod: kresba přes celou šířku nahoře, plynule přechází do papíru; pod ní nadpis a úvodní text */
.hero { background: var(--bg); border-bottom: 1px solid var(--line); }
.hero-art { position: relative; height: clamp(230px, 40vw, 580px); }
.hero-art img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 64%;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
.hero-text {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(32px, 5vw, 72px); align-items: end;
  padding: 4px 0 clamp(32px, 5vw, 56px);
}
.hero .kicker { color: var(--plum-ink); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.hero h1 { font-size: clamp(3rem, 7vw, 5.75rem); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.hero h1 em { display: block; font-style: italic; font-weight: 400; font-size: 0.42em; letter-spacing: 0; color: var(--muted); margin-top: 6px; }
.hero .lead { margin: 0 0 6px; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 34rem; }
@media (prefers-color-scheme: dark) { .hero-art img { filter: brightness(0.62) saturate(0.85); } }
@media (max-width: 860px) {
  .hero-text { grid-template-columns: 1fr; padding-top: 0; }
  .hero .lead { margin-top: 8px; }
}

/* Rychlá fakta */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: -1px; background: var(--line); border-bottom: 1px solid var(--line); }
.fact { background: var(--surface); padding: 22px clamp(16px, 2.4vw, 28px); }
.fact b { display: block; font-family: var(--serif); font-size: clamp(1.625rem, 3vw, 2.125rem); font-weight: 600; line-height: 1.1; }
.fact span { color: var(--muted); font-size: 0.875rem; }

/* Sekce */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-alt { background: var(--surface-2); }
.eyebrow { color: var(--plum-ink); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.section h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 20px; }
.section h3 { font-size: 1.375rem; margin: 32px 0 10px; }
.intro { font-size: 1.1875rem; color: var(--muted); max-width: 44rem; }
.cols { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.note {
  border-left: 3px solid var(--ochre); background: var(--ochre-soft); color: var(--ink);
  padding: 14px 18px; border-radius: 0 10px 10px 0; font-size: 0.9375rem; margin: 20px 0;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }

/* Fotky s popiskem */
figure { margin: 0; }
.photo img { border-radius: var(--radius); box-shadow: var(--shadow); }
.photo figcaption { margin-top: 8px; color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }

/* Tabulky */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.02em; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Časová osa */
.timeline { list-style: none; margin: 28px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 92px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 76px 1fr; gap: 0 34px; padding: 0 0 26px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 86px; top: 7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--plum);
}
.section-alt .timeline li::before { background: var(--surface-2); }
.timeline .year { font-family: var(--serif); font-weight: 600; font-size: 1.125rem; text-align: right; font-variant-numeric: tabular-nums; }
.timeline h3 { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; margin: 0 0 4px; }
.timeline p { color: var(--muted); font-size: 0.9875rem; margin: 0; }
.era { font-family: var(--serif); font-size: 1.5rem; margin: 40px 0 18px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Graf obyvatel */
.chart-card { padding: 22px 22px 14px; }
.chart-title { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0 0 2px; }
.chart-sub { color: var(--muted); font-size: 0.8125rem; margin: 0 0 14px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text, .chart .xlab { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--plum); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .is-active .bar { opacity: 1; }
.chart .dim .bar { opacity: 0.45; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--sans); }
.chart .era-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .era-text { fill: var(--muted); font-size: 10.5px; font-family: var(--sans); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px 12px; font-size: 0.8125rem; line-height: 1.4;
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity 0.12s;
}
.tooltip.show { opacity: 1; }
.tooltip b { display: block; font-size: 0.9375rem; }
details.data { margin-top: 12px; }
details.data summary { cursor: pointer; color: var(--plum-ink); font-size: 0.875rem; font-weight: 600; }
details.data .table-wrap { margin-top: 10px; }

/* Památky */
.monuments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 28px; }
.monument { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.monument > img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.monument .body { padding: 18px 20px 20px; }
.monument h3 { font-size: 1.25rem; margin: 0 0 6px; }
.monument p { font-size: 0.9375rem; color: var(--muted); }
.monument .meta { font-size: 0.8125rem; color: var(--muted); margin-top: 10px; }
.monument .credit { font-size: 0.75rem; color: var(--muted); padding: 0 20px 14px; margin-top: auto; }
.names { columns: 2; gap: 28px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.names li { break-inside: avoid; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.names small { color: var(--muted); }

/* Staré pohlednice */
.postcards { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; margin: 32px 0 10px; }
.postcards img { border-radius: 6px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .postcards { grid-template-columns: 1fr; } }

/* Ukázka ze školní kroniky */
.chronicle { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px; align-items: center; margin: 28px 0 10px; }
.chronicle img { border-radius: 6px; box-shadow: var(--shadow); }
.chronicle h3 { font-size: 1.25rem; margin: 0 0 8px; }
.chronicle p { color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 600px) { .chronicle { grid-template-columns: 1fr; } }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }

/* Srovnání leteckých snímků 1953 a dnes: horní snímek se ořezává podle --pos */
.compare { margin: 20px 0 8px; }
.compare-frame { --pos: 50%; position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1440 / 1120; background: var(--surface-2); touch-action: pan-y; }
.compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none; }
.compare-handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #2a2119;
  display: grid; place-items: center; font-weight: 700; font-size: 1rem; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.compare-label { position: absolute; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(20, 16, 12, 0.7); color: #fff; font-size: 0.8125rem; font-weight: 600; pointer-events: none; }
.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-range:focus-visible + .compare-handle, .compare-frame:focus-within .compare-handle::after { outline: 2px solid var(--plum); }
.compare figcaption { margin-top: 10px; }

/* Mapa */
.map { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface-2); }

/* Prameny */
.sources { columns: 2; gap: 32px; padding-left: 1.1em; font-size: 0.9375rem; }
.sources li { break-inside: avoid; margin-bottom: 8px; }
.gaps td:first-child { font-weight: 500; }

/* Patička */
.site-footer { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.site-footer p { max-width: 52rem; }
.footer-brand { color: var(--ink); margin-bottom: 20px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.site-footer h2 { font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }
.site-footer h2:not(:first-child) { margin-top: 20px; }


/* Tablet a mobil */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .monuments, .gallery { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: 10px 0; font-size: 1.0625rem; color: var(--ink); }
  .site-header.open .nav { display: block; }
  .sources { columns: 1; }
  .footer-cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .monuments, .gallery { grid-template-columns: 1fr; }
  .names { columns: 1; }
  .timeline::before { left: 58px; }
  .timeline li { grid-template-columns: 46px 1fr; gap: 0 26px; }
  .timeline li::before { left: 52px; }
  .timeline .year { font-size: 1rem; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
