/* Layout: jeden sloupec – ovládání, mřížkový roční kalendář (měsíce × dny), pod ním filtrovaný seznam akcí.
   Mřížka: oranžová = peak date, tyrkysová = kongres/akce v KCP (Towers), tečka = jiná akce.
   Seznam: proužek podle přínosu (oranžová nejvyšší, modrá střední, fialová nízký). */
:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --ink: #18202e;
  --muted: #5d6676;
  --line: #d6dae1;
  --accent: #1d3557;
  --accent-ink: #ffffff;
  --weekend: #e9ecf1;

  --top: #c8442f;   --top-bg: #f8d5cd;  --top-ink: #7a1f10;
  --mid: #2e6fb7;   --mid-bg: #d3e3f6;  --mid-ink: #123f73;
  --low: #7d5bbd;   --low-bg: #e6ddf5;  --low-ink: #45297a;
  --info-bg: #dfe2e8;
  --peak: #f2a516; --peak-bg: #ffd166; --peak-ink: #4a3000;
  --kcp: #1e6b34; --kcp-bg: #a9d8b4; --kcp-ink: #0b3a17;
  --stadium: #2563c9; --stadium-bg: #cfe0fa; --stadium-ink: #0d2f6b;
  --football: #d42a2a; --football-bg: #f8cccc; --football-ink: #6e0b0b;
  --worldsport: #7b3fbf; --worldsport-bg: #e3d2f6; --worldsport-ink: #3a1466;
  --river: #9cc3e4; --map-bg: #f6f7f9;
  --acc-bg: #dcefe9; --acc-ink: #135a49;
  --warn-bg: #fff1c7; --warn-ink: #6b4d00;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141b; --surface: #171c25; --ink: #e5e9f0; --muted: #98a1b1; --line: #2b3240;
    --accent: #9cc0ec; --accent-ink: #0f1520; --weekend: #1b212c;
    --top: #ec7a64; --top-bg: #4f1f17; --top-ink: #ffd0c6;
    --mid: #6ea6e6; --mid-bg: #183152; --mid-ink: #cfe2fb;
    --low: #a98ae0; --low-bg: #2e2448; --low-ink: #e1d4fb;
    --info-bg: #262d39;
    --peak: #f5b031; --peak-bg: #6b4a05; --peak-ink: #ffe7ad;
    --kcp: #5fbf78; --kcp-bg: #174a26; --kcp-ink: #cdf2d6;
    --stadium: #6fa3f0; --stadium-bg: #173866; --stadium-ink: #d6e6ff;
    --football: #f06464; --football-bg: #551717; --football-ink: #ffd2d2;
    --worldsport: #b48af0; --worldsport-bg: #3a1f5e; --worldsport-ink: #ecdcff;
    --river: #2c4f70; --map-bg: #141a23;
    --acc-bg: #143a33; --acc-ink: #a8e6d4;
    --warn-bg: #3d3210; --warn-ink: #f6dd8b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141b; --surface: #171c25; --ink: #e5e9f0; --muted: #98a1b1; --line: #2b3240;
  --accent: #9cc0ec; --accent-ink: #0f1520; --weekend: #1b212c;
  --top: #ec7a64; --top-bg: #4f1f17; --top-ink: #ffd0c6;
  --mid: #6ea6e6; --mid-bg: #183152; --mid-ink: #cfe2fb;
  --low: #a98ae0; --low-bg: #2e2448; --low-ink: #e1d4fb;
  --info-bg: #262d39;
  --peak: #f5b031; --peak-bg: #6b4a05; --peak-ink: #ffe7ad;
  --kcp: #5fbf78; --kcp-bg: #174a26; --kcp-ink: #cdf2d6;
  --stadium: #6fa3f0; --stadium-bg: #173866; --stadium-ink: #d6e6ff;
  --football: #f06464; --football-bg: #551717; --football-ink: #ffd2d2;
  --worldsport: #b48af0; --worldsport-bg: #3a1f5e; --worldsport-ink: #ecdcff;
  --river: #2c4f70; --map-bg: #141a23;
  --acc-bg: #143a33; --acc-ink: #a8e6d4;
  --warn-bg: #3d3210; --warn-ink: #f6dd8b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
}
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 900px) { .wrap { padding-inline: 28px; } }

h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

/* ---------- hlavička ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* Logo Czech Inn Hotels je bílé, proto na tmavém štítku (v obou motivech) */
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px; background: #1d3557; flex: none;
}
.mark img { display: block; width: 22px; height: auto; }
.brand-name { font: 800 clamp(16px, 2vw, 20px)/1 var(--f-display); font-stretch: 100%; letter-spacing: .01em; }
.brand-name::after { content: ""; display: inline-block; width: 1px; height: 1.1em; background: var(--line); margin-left: 10px; vertical-align: -.2em; }
.brand h1 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; font-stretch: 88%; letter-spacing: -.01em; }
@media (max-width: 600px) { .brand-name::after { display: none; } .brand h1 { flex-basis: 100%; } }
.lang { flex: none; display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lang button { border: 0; background: var(--surface); padding: 6px 10px; font: 500 12px/1 var(--f-mono); letter-spacing: .06em; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- ovládání ---------- */
.controls {
  display: grid; gap: 14px 28px;
  grid-template-columns: 1fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
@media (min-width: 1000px) { .controls { grid-template-columns: auto 1fr auto; align-items: start; } }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl-lbl, .flbl {
  font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.tabs, .segs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 8px 14px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: baseline; gap: 6px;
}
.tab small { font: 400 10px/1 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tab[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab:disabled { cursor: not-allowed; opacity: .65; }
.seg {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 7px 12px; font-size: 14px; font-weight: 500;
}
.seg[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.view-desc { margin: 0; font-size: 13px; color: var(--muted); max-width: 60ch; }

/* ---------- panely ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.sec-head h2 { font-size: 20px; font-weight: 700; font-stretch: 90%; }
.sec-head p { margin: 0; font-size: 13px; }
.sec-head .export { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sec-head .export .ctl-lbl { margin-right: 2px; }
.export .chip[aria-busy="true"] { opacity: .6; cursor: progress; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.legend li { display: flex; align-items: flex-start; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; flex: none; margin-top: 3px; border: 1px solid var(--line); }
.swatch.sw-peak { background: var(--peak-bg); border-color: var(--peak); }
.swatch.sw-kcp { background: var(--kcp-bg); border-color: var(--kcp); }
.swatch.sw-stadium { background: var(--stadium-bg); border-color: var(--stadium); }
.swatch.sw-expo { background: var(--kcp-bg); border-color: var(--kcp); }
.swatch.sw-football { background: var(--football-bg); border-color: var(--football); }
.swatch.sw-worldsport { background: var(--worldsport-bg); border-color: var(--worldsport); }
.swatch.sw-note { background: var(--surface); }
.outlook { margin: 0; font-size: 13px; padding: 8px 10px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- mřížka měsíce × dny ---------- */
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.grid {
  border-collapse: collapse; width: 100%;
  min-width: calc(var(--months) * 116px);
  table-layout: fixed;
  font-stretch: 80%;
}
.grid th {
  position: sticky; top: 0; z-index: 1;
  background: var(--accent); color: var(--accent-ink);
  font: 700 12px/1 var(--f-display); font-stretch: 100%; text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 6px; text-align: left;
  border-right: 1px solid var(--line);
}
.grid td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 28px; vertical-align: top; }
.grid td.void { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--weekend) 4px 5px); }
.grid td.we { background: var(--weekend); }
/* Jeden typ = celá buňka v jeho barvě. Více typů ve stejný den = buňka rozdělená
   na stejné díly (pořadí: peak, KCP, fotbal, světový sport, koncerty). */
.grid td.pk { background: var(--peak-bg); color: var(--peak-ink); }
.grid td.hl { background: var(--kcp-bg); color: var(--kcp-ink); }
.grid td.gc-expo { background: var(--kcp-bg); color: var(--kcp-ink); }
.grid td.gc-football { background: var(--football-bg); color: var(--football-ink); }
.grid td.gc-worldsport { background: var(--worldsport-bg); color: var(--worldsport-ink); }
.grid td.gc-stadium { background: var(--stadium-bg); color: var(--stadium-ink); }
.grid td.multi { background: var(--split); color: var(--ink); }
.grid td.multi .lbl { text-shadow: 0 0 3px var(--surface), 0 0 1px var(--surface); }
.grid td.sel .cell { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell {
  display: grid; grid-template-columns: 2.1ch 2.3ch minmax(0, 1fr) auto; align-items: center; gap: 4px;
  width: 100%; min-height: 28px; height: 100%; border: 0; background: transparent; padding: 4px 5px; text-align: left;
  font-size: 12px; line-height: 1; align-items: start;
}
.cell:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dn { font: 500 11px/1.15 var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; }
.wd { font: 400 10px/1.3 var(--f-mono); color: var(--muted); }
.pk .wd, .hl .wd, .gc .wd, .multi .wd { color: inherit; opacity: .75; }
.lbl {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
  font-weight: 650; font-stretch: 72%; text-transform: uppercase; font-size: 11px; line-height: 1.15; letter-spacing: .01em; min-width: 0;
  overflow-wrap: anywhere;
}
.cont { display: block; height: 2px; width: 60%; margin-top: 4px; background: currentColor; opacity: .35; border-radius: 1px; }
.meta { display: inline-flex; align-items: center; gap: 4px; }
.sz { font: 600 10px/1.3 var(--f-mono); }


.day-panel { border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; }
.dp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.dp-head h3 { font-size: 16px; }
.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; font-size: 13px; }

/* ---------- filtry ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: start; }
@media (min-width: 720px) { .frow { grid-template-columns: 78px 1fr; } .flbl { padding-top: 9px; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 11px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.chip .cnt { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[aria-pressed="true"] .cnt { color: inherit; opacity: .8; }
.chip.has-acc::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acc-ink); }
.chip.reset { border-style: dashed; }
#f-q {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius);
  padding: 6px 10px; font: inherit; font-size: 14px; width: min(280px, 100%);
}
.count { margin: 4px 0 0; font-size: 12px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* ---------- seznam ---------- */
.month header { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 8px; border-bottom: 1px solid var(--line); }
.month h3 { font-size: 18px; font-weight: 700; font-stretch: 90%; }
.month header .mono { font-size: 12px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 1fr; gap: 6px 16px;
  padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line);
  position: relative;
}
.row::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--line); }
.row.lv-top::before { background: var(--top); }
.row.lv-mid::before { background: var(--mid); }
.row.lv-low::before { background: var(--low); }
.row.lv-peak::before { background: var(--peak); }
.row.is-hl::before { background: var(--kcp); }
.row.is-hl .r-name::before { content: "KCP"; font: 600 10px/1 var(--f-mono); letter-spacing: .06em; background: var(--kcp-bg); color: var(--kcp-ink); padding: 3px 5px; border-radius: 3px; margin-right: 8px; vertical-align: 2px; }
@media (min-width: 760px) { .row { grid-template-columns: 120px minmax(0, 1fr) 210px; } }
.r-date { font: 500 13px/1.4 var(--f-mono); font-variant-numeric: tabular-nums; padding-top: 2px; }
/* Pozor: název "r-main" skrývá blokovač reklam (EasyList Czech and Slovak), proto ev-body */
.ev-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.r-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.r-desc { margin: 0; font-size: 14px; color: var(--muted); max-width: 70ch; }
.r-src { font-size: 12px; color: var(--muted); }
.r-src a { color: var(--muted); }
.r-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
@media (min-width: 760px) { .r-side { align-items: flex-end; text-align: right; } }
.r-size { font: 500 12px/1.4 var(--f-mono); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .04em;
  border: 1px solid var(--line); border-radius: 3px; padding: 4px 6px; color: var(--muted);
}
.tag.acc { background: var(--acc-bg); color: var(--acc-ink); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag.gc-tag { border-color: transparent; }
.tag.gc-stadium { background: var(--stadium-bg); color: var(--stadium-ink); }
.tag.gc-expo { background: var(--kcp-bg); color: var(--kcp-ink); }
.tag.gc-football { background: var(--football-bg); color: var(--football-ink); }
.tag.gc-worldsport { background: var(--worldsport-bg); color: var(--worldsport-ink); }

/* ---------- mapa ---------- */
.map-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 980px) { .map-layout { grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); align-items: start; } }
.map-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--map-bg); overflow: hidden; }
#map-svg svg { display: block; width: 100%; height: auto; }
.map-river { fill: none; stroke: var(--river); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.map-river-lbl { fill: var(--river); font: italic 600 13px var(--f-body); letter-spacing: .2em; }
.map-venue rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.map-venue text { fill: var(--muted); font: 500 11px var(--f-mono); }
.map-hotel circle { fill: var(--surface); stroke: var(--muted); stroke-width: 2; }
.map-hotel text { fill: var(--muted); font: 700 11px var(--f-mono); }
.map-hotel.on circle { fill: var(--accent); stroke: var(--accent); }
.map-hotel.on text { fill: var(--accent-ink); }
.map-district { fill: var(--muted); opacity: .55; font: 500 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.map-note { margin: 0; font-size: 12px; color: var(--muted); }
.hotel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hotel-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.hotel-list .num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 11px var(--f-mono); border: 2px solid var(--muted); color: var(--muted);
}
.hotel-list li.on .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hotel-list .hn { font-weight: 700; }
.hotel-list .ha { font-size: 13px; color: var(--muted); }
.hotel-list .near { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.pill {
  font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 8px; border-radius: 3px; background: var(--info-bg); color: var(--muted);
}
.pill.lv-top { background: var(--top-bg); color: var(--top-ink); }
.pill.lv-mid { background: var(--mid-bg); color: var(--mid-ink); }
.pill.lv-low { background: var(--low-bg); color: var(--low-ink); }
.pill.lv-peak { background: var(--peak-bg); color: var(--peak-ink); }
.empty { color: var(--muted); padding: 24px 0; }

.foot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; font-family: var(--f-mono); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---------- Leaflet mapa ---------- */
.map-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.map-leaflet { height: clamp(380px, 62vh, 620px); width: 100%; background: var(--map-bg); }
:root[data-theme="dark"] .map-leaflet .leaflet-tile-pane { filter: brightness(.8) contrast(1.1) saturate(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map-leaflet .leaflet-tile-pane { filter: brightness(.8) contrast(1.1) saturate(.8); } }
.hotel-pin span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: #c2410c; color: #fff; font: 700 12px/1 var(--f-mono);
  border: 3px solid #fff; box-shadow: 0 0 0 2px #c2410c, 0 2px 6px rgba(0,0,0,.35);
}
.map-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font: 500 11px/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.map-legend li { display: flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lg-hotel { background: #c2410c; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px #c2410c; }
.lg-walk { background: #1f4e5f; }
.lg-far { background: #8a8f98; }
.lg-ring { border: 1.5px dashed #c2410c; }
.leaflet-container { font-family: var(--f-body); }
.mp { font-size: 13px; min-width: 200px; }
.mp-a { color: #5d6676; font-size: 12px; margin-top: 2px; }
.mp ul { margin: 6px 0 0; padding-left: 16px; }
.mp-d { font-family: var(--f-mono); font-size: 11px; color: #5d6676; }
.leaflet-tooltip.venue-label {
  background: rgba(255,255,255,.9); border: 0; box-shadow: none; padding: 1px 5px; border-radius: 3px;
  font: 600 11px/1.3 var(--f-mono); color: #3b4250;
}
.leaflet-tooltip.venue-label.walk { color: #1f4e5f; }
.leaflet-tooltip.venue-label::before { display: none; }
.r-times { font: 400 11px/1.3 var(--f-mono); color: var(--muted); margin-top: 3px; }
