/* NOBL. One stylesheet, no framework, no third-party requests.
   Colours come from the N.O.B.L. wall lettering (see the --nobl-* tokens).
   Change the tokens here, not the rules below. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #2b2528;
  --link: var(--nobl-violet-dark);
  --accent: var(--nobl-teal);      /* decorative only, never text */
  --hl: rgb(137 206 194 / .4);     /* highlight behind links, text on it 5.6:1 */
  --focus: #b35c00;
  --line: rgb(43 37 40 / .22);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 42rem;
  --wide: 72rem;
  --page: 96rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --tint: 32%;                     /* how much of its colour a band carries */
  /* Palette measured from the N.O.B.L. wall lettering painted by children
     (photo IMG_9119, dim light, so approximate). Fills only: the pale ones fail
     AA as text on white. */
  --nobl-charcoal: #51494d; /* N, 8.7:1 on white, safe as text */
  --nobl-teal: #89cec2;     /* O */
  --nobl-lilac: #9b95b4;    /* B */
  --nobl-olive: #828b38;    /* L */
  --nobl-lime: #b2cd4b;     /* dot after N */
  --nobl-orange: #e2a258;   /* dot after O */
  --nobl-plum: #443a3e;     /* heart, 11:1 on white, safe as text */
  /* Darker derivatives for text and links on white, AA 5.9 to 7.2:1 */
  --nobl-teal-dark: #2f6f66;
  --nobl-violet-dark: #5b4f86;
  --nobl-olive-dark: #5d6428;
  /* Flag colours, measured from the painted flag in IMG_9134 (temporary,
     until a better picture). Green passes AA as text on white (5.1:1). */
  --flag-green: #007d59;
  --flag-black: #20272d;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1e1a1c; --text: #ececec; --link: var(--nobl-teal); --focus: #ffb454; --hl: rgb(137 206 194 / .22); --tint: 17%; --line: rgb(236 236 236 / .28); --hl-band: rgb(255 255 255 / .13); }
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.6 var(--font);
  /* the four lettering colours as a stripe, decoration only */
  border-top: .5rem solid;
  border-image: linear-gradient(90deg, var(--nobl-teal) 0 25%, var(--nobl-lilac) 25% 50%, var(--nobl-lime) 50% 75%, var(--nobl-orange) 75%) 1;
}
main, header { max-width: var(--page); margin: 0 auto; padding: 2rem var(--gutter); }
header { padding-bottom: 0; }
main { padding-top: 1.5rem; padding-bottom: 6rem; }
/* text keeps a readable line length, the logo and pictures run wider */
main > * { box-sizing: border-box; max-width: var(--measure); margin-left: auto; margin-right: auto; }
/* the home page: full-bleed colour bands, each holding a .wrap */
main.wide { max-width: none; padding: 0; }
main.wide > * { max-width: none; margin-left: 0; margin-right: 0; }
.wrap { box-sizing: border-box; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2 { line-height: 1.15; text-wrap: balance; }
.logo { margin-bottom: 1rem; } /* never the `margin:` shorthand on h1 or .logo */
.tagline { margin-top: 0; margin-bottom: clamp(2rem, 6vw, 4rem); font-size: clamp(1.25rem, 3.2vw, 2rem); font-weight: 700; line-height: 1.2; text-wrap: balance; } /* longhand margins only, main > * centres with auto */
.logo img { display: block; width: 100%; height: auto; }
h1 { font-size: clamp(2.5rem, 8vw, 4rem); margin-top: 0; margin-bottom: 1.5rem; letter-spacing: -.01em; }
/* subpages: a short bar in the four lettering colours under the h1, as on the home page */
main:not(.wide) > h1::after {
  content: ""; display: block; width: 5rem; height: .5rem; margin-top: 1rem; border-radius: .25rem;
  background: linear-gradient(90deg, var(--nobl-teal) 0 25%, var(--nobl-lilac) 25% 50%, var(--nobl-lime) 50% 75%, var(--nobl-orange) 75%);
}
p { text-wrap: pretty; margin-bottom: 1.35rem; }
::selection { background: var(--accent); color: #2b2528; }
@media (max-width: 30rem) { body { font-size: 1.0625rem; } nav ul { gap: .25rem 1rem; } nav a { font-size: .875rem; } main, header { padding-left: 1.25rem; padding-right: 1.25rem; } }

nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
nav a {
  display: inline-block; padding: .5rem 0; color: var(--text);
  text-decoration: none; border-bottom: 3px solid transparent;
}
nav a:hover { border-bottom-color: var(--accent); }
nav li:nth-child(2) a:hover { border-bottom-color: var(--nobl-lilac); }
nav li:nth-child(3) a:hover { border-bottom-color: var(--nobl-lime); }
nav li:nth-child(4) a:hover { border-bottom-color: var(--nobl-orange); }
nav a[aria-current] { font-weight: 700; border-bottom-color: var(--link); }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a.hl { background: var(--hl); border-radius: .2em; padding: 0 .15em; -webkit-box-decoration-break: clone; box-decoration-break: clone; text-decoration: underline; text-decoration-thickness: .12em; }

/* intro: logo and opening paragraph, on the same left edge as every band below */
.intro { padding-top: 1.5rem; padding-bottom: clamp(3rem, 7vw, 6rem); }
.lead {
  max-width: 54rem; margin-top: 0; margin-bottom: 0; padding-left: 1.5rem;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem); font-weight: 500; line-height: 1.5;
  border-left: .5rem solid;
  border-image: linear-gradient(180deg, var(--nobl-teal) 0 25%, var(--nobl-lilac) 25% 50%, var(--nobl-lime) 50% 75%, var(--nobl-orange) 75%) 1;
}

/* colour bands: --tone tints the background, --pop colours the link highlight */
.band {
  --tone: var(--nobl-teal); --pop: var(--nobl-orange);
  background: color-mix(in srgb, var(--tone) var(--tint), var(--bg));
  padding: clamp(3rem, 8vw, 7rem) 0;
}
.band.lilac  { --tone: var(--nobl-lilac);  --pop: var(--nobl-lime); }
.band.orange { --tone: var(--nobl-orange); --pop: var(--nobl-teal); }
.band.lime   { --tone: var(--nobl-lime);   --pop: var(--nobl-lilac); --hl-mix: 32%; }
.band a.hl { background: var(--hl-band, color-mix(in srgb, var(--pop) var(--hl-mix, 40%), transparent)); }
.split { display: grid; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
@media (min-width: 56rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .flip .photo { order: -1; } /* text stays first in the source, so phones and screen readers read text, then photo */
}
.text > :last-child { margin-bottom: 0; }
.wrap > .text { max-width: 54rem; }
.big { font-size: clamp(1.5rem, 2.8vw, 2.25rem); font-weight: 700; line-height: 1.25; margin-bottom: 1.5rem; text-wrap: balance; }
.photo { margin: 0; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo figcaption, .credit { font-size: .9375rem; margin-top: .75rem; opacity: .9; }
.band .text + .gallery { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.gallery { list-style: none; margin: 0; padding: 0 0 1.5rem; display: grid; grid-template-columns: 1fr; gap: 1.75rem; }
@media (min-width: 30rem) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 2rem; } .gallery li:nth-child(even) { margin-top: 3rem; } }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.credit { margin-top: 1rem; margin-bottom: 0; }
a[data-lightbox] { display: block; overflow: hidden; cursor: zoom-in; border-radius: 1rem; }
a[data-lightbox] img { transition: transform .5s ease; }
a[data-lightbox]:focus-visible { outline-offset: -5px; } /* inside, because overflow:hidden clips an outer ring */
a[data-lightbox]:hover img { transform: scale(1.04); }

/* Photo overlay (src/_includes/lightbox.njk). Fixed dark colours in both themes. */
body:has(.lightbox[open]) { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgb(20 16 18 / .98); color: #ececec;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img {
  display: block; max-width: 100%; max-height: calc(100dvh - 5.5rem); width: auto; height: auto;
  touch-action: pan-y; user-select: none;
}
.lightbox figcaption { box-sizing: border-box; display: flex; justify-content: space-between; gap: 1rem; width: 100%; padding: .75rem 1rem 0; font-size: .875rem; }
.lb-btn {
  position: absolute; width: 3rem; height: 3rem; padding: 0; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .16); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.lb-btn:hover { background: rgb(255 255 255 / .3); }
.lb-btn:focus-visible { outline: 3px solid #ffb454; outline-offset: 2px; }
.lb-btn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev, .lb-next { top: 50%; margin-top: -1.5rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin-top: 3rem; margin-bottom: 1rem; }

/* Jak jde cas: a vertical line in the four lettering colours, one dot per entry */
.timeline { list-style: none; margin-top: 2rem; margin-bottom: 0; padding: 0 0 0 1.75rem; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: .3rem; top: .4rem; bottom: .4rem; width: .3rem; border-radius: .15rem;
  background: linear-gradient(180deg, var(--nobl-teal) 0 25%, var(--nobl-lilac) 25% 50%, var(--nobl-lime) 50% 75%, var(--nobl-orange) 75%);
}
.timeline li { position: relative; margin: 0; padding-bottom: 2.25rem; }
.timeline li::before {
  content: ""; position: absolute; left: -1.75rem; top: .55rem; width: .95rem; height: .95rem; border-radius: 50%;
  background: var(--bg); border: .25rem solid var(--tone, var(--nobl-teal));
}
.timeline li:nth-child(4n+2) { --tone: var(--nobl-lilac); }
.timeline li:nth-child(4n+3) { --tone: var(--nobl-lime); }
.timeline li:nth-child(4n+4) { --tone: var(--nobl-orange); }
.timeline time { display: block; font-size: .9375rem; font-weight: 700; color: var(--nobl-olive-dark); }
.timeline h2 { margin: .1rem 0 .35rem; font-size: 1.25rem; }
.timeline .zdroj { font-size: .875rem; margin: 0; opacity: .9; }
.timeline .zdroj a { overflow-wrap: anywhere; }

/* Kontakt: register data as pairs (stacked on a phone), channels as outlined buttons */
.udaje { display: grid; grid-template-columns: 1fr; gap: .15rem 2rem; margin-bottom: 2rem; }
.udaje dt { font-size: .875rem; font-weight: 700; color: var(--nobl-olive-dark); margin-top: 1rem; }
.udaje dd { margin: 0; }
@media (min-width: 40rem) {
  .udaje { grid-template-columns: 11rem 1fr; }
  .udaje dt { margin-top: 0; padding: .6rem 0; border-top: 1px solid var(--line); }
  .udaje dd { padding: .6rem 0; border-top: 1px solid var(--line); }
}
.kanaly { list-style: none; margin-bottom: 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.kanaly a { display: inline-block; padding: .75rem 1.25rem; border: 2px solid var(--link); border-radius: .75rem; text-decoration: none; font-weight: 600; }
.kanaly a:hover { background: var(--hl); }

/* Vyrocni zpravy: newest first */
.reports { list-style: none; margin-bottom: 0; padding: 0; }
.reports li { display: grid; grid-template-columns: 5rem 1fr; gap: .25rem 1.25rem; padding: 1.25rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.reports li:last-child { border-bottom: 1px solid var(--line); }
.reports .rok { font-size: 1.75rem; font-weight: 700; line-height: 1; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 1; }

/* footer: the four lettering colours again, then the links */
footer { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 3rem; }
footer div { box-sizing: border-box; margin: 0 auto; padding-top: 1.5rem; border-top: .5rem solid; border-image: linear-gradient(90deg, var(--nobl-teal) 0 25%, var(--nobl-lilac) 25% 50%, var(--nobl-lime) 50% 75%, var(--nobl-orange) 75%) 1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 2rem; }
footer strong { font-size: 1.25rem; }
footer ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
footer a { display: inline-block; padding: .5rem 0; }
main.wide + footer { padding-top: 3rem; }

@media (prefers-color-scheme: dark) { .timeline time, .udaje dt { color: var(--nobl-lime); } }

@media print {
  body { border: 0; }
  header, footer, .gallery { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.what { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
