/* Cantus Choceň — vzhled veřejné části webu. Bez build kroku, prostý CSS. */

@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/merriweather-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/merriweather-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;
}

:root {
    --bg: #faf6f0;
    --paper: #ffffff;
    --tint: #f3e9dc;
    --ink: #2a211d;
    --muted: #6d5f56;
    --line: #e6d9c9;
    --accent: #7d1d2c;
    --accent-hover: #621522;
    --accent-soft: #f4e3e3;
    --warn: #9a5b00;
    --serif: 'Merriweather', Georgia, 'Times New Roman', serif;
    --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius: 10px;
    --wrap: 1120px;
    --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 17px/1.6 var(--sans);
}
body.has-player { padding-bottom: 88px; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.plain { list-style: none; margin: 0; padding: 0; }

/* ---------- Hlavička ---------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 12px; }

.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.brand__sub { font-size: .8rem; color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-inline: -10px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: var(--tint); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav a.nav__lang { color: var(--muted); font-size: .92rem; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; margin-left: 6px; align-self: center; }
.nav a.nav__lang:hover { color: var(--accent); border-color: var(--accent); background: transparent; }

.nav-toggle { display: none; }

/* ---------- Úvodní fotka ---------- */

/* Úvodní fotka se neořezává a je přes celou šířku. Tmavá barva sekce (#29211d)
   je pod textem na počítači a pod fotkou na telefonu. */
.hero { --hero-band: #29211d; --header-h: 68px; background: var(--hero-band); color: #f3ece6; }
/* Na počítači leží celý text přes spodek fotky jako v první verzi — díky tmavému pruhu
   a přechodu nahoru zasahuje jen do nohou, ne do obličejů. */
.hero__media { position: relative; }
.hero__img { width: 100%; height: auto; }
/* Nadpis musí být vidět hned po otevření stránky. Dokud je fotka vyšší než okno,
   drží se text u spodku okna; když se fotka vejde celá, sedí u jejího spodku.
   (bottom v % se počítá z výšky fotky, 100svh je výška okna, hlavička je lepivá.) */
.hero__text {
    position: absolute; left: 0; right: 0; z-index: 1;
    bottom: max(0px, calc(100% - (100vh - var(--header-h))));
    bottom: max(0px, calc(100% - (100svh - var(--header-h))));
    padding: clamp(70px, 9vw, 150px) clamp(20px, 4vw, 56px) clamp(22px, 3.2vw, 44px);
    background: linear-gradient(to top, rgba(41, 33, 29, .9) 0%, rgba(41, 33, 29, .72) 45%, rgba(41, 33, 29, 0) 100%);
}
/* Pod textem až ke spodku fotky souvislá tmavá plocha — jinak by při rolování
   pod textem prosvítal světlý kus podlahy. Výška = o kolik je fotka vyšší
   než okno, tedy přesně od spodku textu dolů. */
.hero__media::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: max(0px, calc(100% - (100vh - var(--header-h))));
    height: max(0px, calc(100% - (100svh - var(--header-h))));
    background: rgba(41, 33, 29, .9);
    pointer-events: none;
}
.hero__title { font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem); margin-bottom: .1em; color: #fff; line-height: 1.05; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero__tagline { font-family: var(--serif); font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem); margin-bottom: .6em; color: #eadfd8; }
.hero__intro { max-width: 36rem; color: #eadfd8; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.1em 0 0; }

.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; padding: 12px 22px; border-radius: 999px; font-weight: 600; border: 2px solid var(--accent); }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.hero .btn { background: #a3283a; border-color: #a3283a; }
.hero .btn:hover { background: #bb3347; border-color: #bb3347; }
.hero .btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .75); color: #fff; }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

/* ---------- Sekce ---------- */

.section { padding-block: clamp(36px, 6vw, 64px); }
.section .section { padding-block: 32px 0; }
.section--tint { background: var(--tint); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section__head h2 { margin: 0; }
.section__head h2 a { color: inherit; text-decoration: none; }
.section__head h2 a:hover { color: var(--accent); }
.section__lead { color: var(--muted); margin-top: -8px; }
.more { font-weight: 600; white-space: nowrap; }
.more::after { content: ' →'; }

.page-head { padding-block: clamp(32px, 6vw, 56px) 0; }
.page-head > p { color: var(--muted); font-size: 1.1rem; }
.crumbs { margin-bottom: 12px; font-size: .95rem; }
.crumbs a { text-decoration: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.lead { font-size: 1.15rem; }
.empty { color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; }
.year { font-family: var(--sans); font-size: .95rem; color: var(--muted); letter-spacing: .08em; margin: 28px 0 8px; }

.badge { display: inline-block; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 10px; margin: 0; white-space: nowrap; }
.badge--warn { background: #fbecd6; color: var(--warn); }

.prose { max-width: 42rem; }
.prose img { border-radius: var(--radius); }

/* ---------- Karta akce ---------- */

.event-card { display: flex; gap: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; }
.event-card__date { flex: 0 0 72px; text-align: center; border-right: 1px solid var(--line); padding-right: 16px; display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.event-card__day { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--accent); }
.event-card__month { text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.event-card__year { font-size: .8rem; color: var(--muted); }
.event-card__body { min-width: 0; }
.event-card__title { margin-bottom: 4px; }
.event-card__title a { color: var(--ink); text-decoration: none; }
.event-card__title a:hover { color: var(--accent); }
.event-card__meta { color: var(--muted); margin-bottom: 6px; }
.event-card__perex { margin: 0; }
.event-card.is-cancelled .event-card__title a { text-decoration: line-through; }
.event-card__body { flex: 1; }
.event-card__poster { flex: 0 0 96px; align-self: flex-start; display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--tint); cursor: zoom-in; }
.event-card__poster img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: opacity .2s; }
.event-card__poster:hover img { opacity: .85; }

.past-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.past-item { display: grid; grid-template-columns: 13rem 1fr auto; gap: 4px 16px; align-items: baseline; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.past-item:hover { background: var(--paper); color: var(--ink); }
.past-item__date { color: var(--muted); font-size: .95rem; }
.past-item__title { font-weight: 600; }
.past-item__place { grid-column: 2; color: var(--muted); font-size: .95rem; }
.past-item__place:empty { display: none; }
.past-item__badges { grid-column: 3; grid-row: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Detail akce ---------- */

.event-detail { padding-block: clamp(32px, 6vw, 56px); }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 16px 0 28px; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-size: 1.05rem; }
.event-detail__body.has-poster { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.poster img { border-radius: var(--radius); box-shadow: 0 8px 30px rgba(42, 33, 29, .15); }

/* ---------- Nahrávky ---------- */

.tracks { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.track { display: grid; grid-template-columns: auto 1.6rem 1fr auto; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-bottom: 1px solid var(--line); }
.track:last-child { border-bottom: 0; }
.track__num { color: var(--muted); font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.track__title { font-weight: 500; min-width: 0; }
.track__title small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.track__dur { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.track__play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; display: grid; place-items: center; padding: 0; }
.track__play svg { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }
.track__play:hover { background: var(--accent); color: #fff; }
.track.is-current { background: var(--accent-soft); }
.track.is-current .track__play { background: var(--accent); color: #fff; }
.track.is-playing .track__play svg { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); } }

/* Bez JavaScriptu jen nativní přehrávače, s ním naše tlačítka. */
.track__native { grid-column: 1 / -1; width: 100%; height: 40px; }
.js .track__native { display: none; }
html:not(.js) .track__play { display: none; }
html:not(.js) .track { grid-template-columns: 1.6rem 1fr auto; padding-left: 16px; }

.player { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(720px, calc(100% - 24px)); z-index: 40; display: flex; align-items: center; gap: 14px; background: #2a211d; color: #fff; border-radius: 16px; padding: 10px 14px 10px 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.player[hidden] { display: none; }
.player__toggle { flex: 0 0 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.player__toggle svg { width: 24px; height: 24px; fill: currentColor; }
.player .i-pause, .player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player__info { flex: 1; min-width: 0; }
.player__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__bar { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .85; }
.player__seek { flex: 1; min-width: 0; accent-color: #e8a3ad; }
.player__close { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .7; padding: 4px 6px; }
.player__close:hover { opacity: 1; }

/* ---------- Fotogalerie ---------- */

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.album-card { display: block; text-decoration: none; color: var(--ink); }
.album-card__img { display: block; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; background: var(--tint); margin-bottom: 10px; }
.album-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.album-card:hover .album-card__img img { transform: scale(1.04); }
.album-card__title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.album-card:hover .album-card__title { color: var(--accent); }
.album-card__meta { display: block; color: var(--muted); font-size: .9rem; }

/* Řádky fotek se zachovaným poměrem stran — nic se neořezává. */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid::after { content: ''; flex-grow: 999; }
.photo { flex: calc(var(--ratio) * 200) 1 calc(var(--ratio) * 200px); aspect-ratio: var(--ratio); border-radius: 6px; overflow: hidden; background: var(--tint); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.photo:hover img { opacity: .88; }

.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(12, 9, 8, .95); color: #fff; }
.lightbox::backdrop { background: rgba(12, 9, 8, .95); }
.lightbox__fig { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px; }
.lightbox__fig img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.lightbox__fig figcaption { margin-top: 10px; min-height: 1.5em; text-align: center; opacity: .85; }
.lightbox__btn { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__close { right: 12px; top: 12px; }
.lightbox.is-single .lightbox__prev, .lightbox.is-single .lightbox__next { display: none; }
.lightbox__count { position: absolute; left: 16px; top: 22px; font-size: .9rem; opacity: .75; }

/* ---------- Patička ---------- */

.site-footer { background: #2a211d; color: #e9e0d8; margin-top: 40px; }
.section--tint + .site-footer, main > .section--tint:last-child { margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-block: 48px 32px; }
.site-footer__name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: .4em; }
.site-footer__h { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #bfae9f; margin-bottom: 10px; }
.site-footer li { margin-bottom: 4px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); padding-block: 16px; font-size: .85rem; color: #bfae9f; }
.site-footer__bottom a { color: #bfae9f; }

/* ---------- Mobil ---------- */

@media (max-width: 760px) {
    body { font-size: 16px; }
    .site-header__in { padding-block: 10px; }

    /* Menu jako harmonika: tlačítko rozbalí seznam pod hlavičkou. */
    .js .nav-toggle { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 600 .95rem var(--sans); color: var(--ink); cursor: pointer; }
    .nav-toggle__icon { position: relative; width: 18px; height: 12px; }
    .nav-toggle__icon::before, .nav-toggle__icon::after, .nav-toggle__icon span { content: ''; position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease, top .25s ease; }
    .nav-toggle__icon::before { top: 0; }
    .nav-toggle__icon span { top: 5px; }
    .nav-toggle__icon::after { top: 10px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { top: 5px; transform: rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__icon span { opacity: 0; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { top: 5px; transform: rotate(-45deg); }

    .nav-panel { width: 100%; }
    .js .nav-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .3s ease, visibility 0s linear .3s; }
    .js .nav-panel.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .3s ease, visibility 0s; }
    .nav { flex-direction: column; gap: 0; margin: 0; min-height: 0; overflow: hidden; }
    .nav a { padding: 13px 4px; border-radius: 0; border-top: 1px solid var(--line); font-size: 1.05rem; }
    .nav a:first-child { margin-top: 8px; }
    .nav a:hover { background: transparent; color: var(--accent); }
    .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
    .nav a.nav__lang { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; padding: 13px 4px; align-self: stretch; }

    /* Na telefonu je fotka nízká — celý text je až pod ní, na tmavém pozadí sekce. */
    .hero__media::after { display: none; }
    .hero__text { position: static; padding: 20px var(--gutter) 28px; background: none; }
    .hero__title { font-size: 2rem; text-shadow: none; }
    .hero__intro { margin-top: 10px; }
    .event-card { gap: 14px; padding: 14px; }
    .event-card__date { flex-basis: 58px; padding-right: 12px; }
    .event-card__day { font-size: 1.6rem; }
    .event-card__poster { flex-basis: 72px; }
    .past-item { grid-template-columns: 1fr; }
    .past-item__place, .past-item__badges { grid-column: 1; grid-row: auto; justify-content: flex-start; }
    .event-detail__body.has-poster { grid-template-columns: 1fr; }
    .poster { max-width: 360px; }
    .site-footer__grid { grid-template-columns: 1fr; gap: 20px; }
    .photo { flex-basis: calc(var(--ratio) * 120px); }
    .track { padding-right: 12px; gap: 10px; }
    .track__num { display: none; }
    .js .track { grid-template-columns: auto 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
