/* TJ Sokol Drásov — custom styles
   Colors: Sokol red + white + ink. Headings Zilla Slab, body Source Sans 3. */

@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3-latin-ext.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("/fonts/zilla-slab-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("/fonts/zilla-slab-600-latin-ext.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}

:root {
  --red: #c8102e;
  --red-dark: #9c0c23;
  --ink: #1c1b1a;
  --text-muted: #5c5955;
  --paper: #ffffff;
  --paper-muted: #f6f5f3;
  --rule: #e5e2de;
  --font-heading: "Zilla Slab", "Georgia", serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

.container {
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main.container {
  padding-block: 2.5rem 4rem;
  min-height: 55vh;
}

/* ---------- header: red bar = Sokol shirt ---------- */

.header {
  background: var(--red);
  color: #fff;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  padding-block: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover { color: inherit; }

.brand img {
  display: block;
  background: #fff;
  border-radius: 50%;
  padding: 3px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-text span {
  font-size: 0.82rem;
  opacity: 0.85;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  margin-left: auto;
}

.menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
}

.menu a:hover {
  background: var(--red-dark);
  color: #fff;
}

.menu a[aria-current="page"] {
  background: #fff;
  color: var(--red);
}

/* ---------- content typography ---------- */

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.65rem; margin-top: 1.8em; }
/* h3 musí být zřetelně větší než tučný text v odstavci, jinak se v delším
   článku (výsledkové listiny) ztrácí, co je nadpis a co jen zvýrazněný řádek */
h3 { font-size: 1.35rem; margin-top: 1.7em; }

a { color: var(--red); }
a:hover { color: var(--red-dark); }

p, ul, ol { margin: 0 0 1em; }

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.2em;
  font-size: 1rem;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th { font-weight: 600; }

/* ---------- news list ---------- */

.news-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.news-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.news-list time {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-list .title {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
}

.news-list .title:hover { text-decoration: underline; }

/* zbytek fotek schovaný pod rozbalovacím řádkem */
.more-photos {
  margin-bottom: 1.5rem;
}

.more-photos summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--red);
  padding: 0.4rem 0;
}

.more-photos summary:hover { text-decoration: underline; }

.more-photos[open] summary { margin-bottom: 0.8rem; }

/* fotka vložená do textu shortcodem {% photo %} */
.photo {
  margin: 1.8rem 0;
}

.photo img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.photo figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

/* datum konání ve výpisu: řadí se podle data vydání, ale u akce je podstatné,
   kdy se koná — proto červeně a tučně hned za názvem */
.event-inline {
  color: var(--red);
  font-weight: 600;
  white-space: nowrap;
}

/* „Proběhlo“ — širší sloupec na rozsah datumů (11.–13. 9. 2026) */
.past-list li {
  grid-template-columns: 9.5rem 1fr;
}

/* proběhlé akce drží zpátky — nemají soupeřit s tím, co teprve bude */
.past-list .title {
  font-weight: 500;
}

.gallery-link {
  font-size: 0.9rem;
  color: var(--red);
  margin-left: 0.5em;
  white-space: nowrap;
}

/* ---- prohlížeč fotek (lightbox) ----------------------------------------
   Nativní <dialog>: prohlížeč sám drží fokus uvnitř, zavírá na Esc a ztmaví
   pozadí přes ::backdrop. Ovládání dopňuje /js/lightbox.js. */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(12, 11, 10, 0.92);
}

.lb-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: min(94vw, 1600px);
  max-height: 84dvh;
  object-fit: contain;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.5);
}

.lb-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.lightbox button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.lightbox button:hover { background: var(--red); }

.lightbox button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3.25rem;
  height: 3.25rem;
  font-size: 2.4rem;
  padding-bottom: 0.18em;
}

.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }

.lb-close {
  top: 1.25rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.9rem;
  padding-bottom: 0.08em;
}

/* jediná fotka v galerii → listovat není kam */
.lightbox.is-single .lb-prev,
.lightbox.is-single .lb-next { display: none; }

@media (max-width: 40rem) {
  .lb-image { max-width: 100vw; max-height: 78dvh; }
  .lb-prev, .lb-next { width: 2.5rem; height: 2.5rem; font-size: 1.9rem; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}

/* odkaz z galerie na zprávu o akci (protějšek pole gallery ve zprávě) */
.article-link {
  font-weight: 600;
  color: var(--red);
}

/* datum konání akce v hlavičce článku */
.event-date {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--red);
  margin: 0 0 0.2rem;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 0.55em;
  margin-left: 0.6em;
  vertical-align: 0.12em;
  white-space: nowrap;
}

/* ---------- article ---------- */

.article-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* pod datem konání už se nahoru přitahovat nesmí (počítá s tím, že jde hned za h1) */
.event-date + .article-meta { margin-top: 0; }

.article-body img {
  border-radius: 6px;
  margin-block: 0.5rem;
}

.attachments {
  background: var(--paper-muted);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 2rem;
}

.attachments h2 {
  margin: 0 0 0.5em;
  font-size: 1.05rem;
}

.attachments ul { margin: 0; padding-left: 1.2em; }

.back {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.95rem;
}

/* ---------- photo galleries ---------- */

.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.gallery-grid a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper-muted);
}

.gallery-grid .name {
  display: block;
  font-weight: 600;
  margin-top: 0.4rem;
}

.gallery-grid .when {
  display: block;
  color: var(--red);
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.gallery-grid .count {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.photo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.8rem;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper-muted);
}

/* ---------- documents ---------- */

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

.doc-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.doc-list .size {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 0.5em;
  white-space: nowrap;
}

/* ---------- home page ---------- */

.hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  background: var(--paper-muted);
}

.hero img {
  display: block;
  width: 100%;
  height: clamp(240px, 34vw, 420px);
  object-fit: cover;
  object-position: center 38%;
}

.hero-slogan {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: 2.2rem 1.4rem 0.9rem;
  background: linear-gradient(to top, rgba(28, 27, 26, 0.65), transparent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (max-width: 44rem) {
  .hero img { height: 220px; }
}

.intro {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2.5rem;
  align-items: start;
}

/* vlevo bloky s obrázky (Co nás čeká, Z našich akcí), vpravo Naše činnost a Zprávy */
.intro-main {
  min-width: 0;
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

.intro-side {
  display: grid;
  gap: 1.5rem;
  align-content: start;
  font-size: 1rem;
}

.side-box {
  background: var(--paper-muted);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.side-box h2 { margin-top: 0; }

/* „Co nás čeká“ — boxík jako ostatní bloky na titulce */
.upcoming-card {
  background: var(--paper-muted);
  border-radius: 10px;
  padding: 1.25rem 1.4rem 0.4rem;
}

.upcoming-card h2 { margin-top: 0; }

.upcoming-list {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
}

.upcoming-list li { border-bottom: 1px solid var(--rule); }
.upcoming-list li:last-child { border-bottom: 0; }

/* celá položka je jeden odkaz. S obrázkem (cover): náhled vlevo, stejně široký
   jako sloupec v „Z našich akcí“ pod ním (čtyři sloupce s mezerou 0.9rem) */
.upcoming-list .event {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
  color: inherit;
  text-decoration: none;
}

.upcoming-list .event.has-cover {
  grid-template-columns: calc((100% - 3 * 0.9rem) / 4) 1fr;
}

.upcoming-list time {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.upcoming-list .title {
  color: var(--red);
  font-size: 1.1rem;
  font-weight: 600;
}

.upcoming-list .event:hover .title { text-decoration: underline; }

/* perex = pole description z hlavičky položky (zároveň meta description) */
.upcoming-list .perex {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.upcoming-list img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top; /* plakáty mají datum a název nahoře */
  border-radius: 6px;
  display: block;
}

/* proběhlé akce: náhledy, ne další seznam */
.recent-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

/* Zprávy v užším pravém sloupci: datum nad názvem */
.news-block .news-list li {
  grid-template-columns: 1fr;
  gap: 0.1rem;
}

.recent-grid a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.recent-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.recent-grid .name {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}

.recent-grid .when {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.recent-grid a:hover .name { text-decoration: underline; }

/* jednotná velikost nadpisů na titulce (Aktuality, Naše činnost, Rozpis…) */
.home-title { font-size: 1.5rem; }

.more-link { font-weight: 600; }

/* weekly schedule grid */
.schedule { margin-top: 3rem; }

.schedule-scroll { overflow-x: auto; padding-bottom: 0.5rem; }

.schedule-grid {
  display: grid;
  grid-template-columns: 4.5rem repeat(60, minmax(13px, 1fr));
  grid-auto-rows: 2.6rem;
  gap: 3px;
  min-width: 920px;
}

.sg-corner { grid-row: 1; grid-column: 1; }

.sg-hour {
  grid-row: 1;
  align-self: end;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-left: 1px solid var(--rule);
  padding-left: 3px;
}

.sg-day {
  grid-column: 1;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid var(--rule);
}

.sg-event {
  border-radius: 4px;
  padding: 2px 5px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.1;
}

.sg-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-coach {
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

/* ---------- footer ---------- */

.footer {
  background: var(--ink);
  color: #d9d6d2;
  font-size: 0.95rem;
}

.footer a { color: #fff; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ---------- misc ---------- */

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.header :focus-visible {
  outline-color: #fff;
}

@media (max-width: 44rem) {
  body { font-size: 1.05rem; }

  .intro { grid-template-columns: 1fr; gap: 0; }
  /* display: contents rozpustí oba sloupce, aby šlo řadit jednotlivé bloky */
  .intro-main, .intro-side { display: contents; }
  .upcoming-card { order: 1; margin-bottom: 1.5rem; }
  .side-recent { order: 2; margin-bottom: 1.5rem; }
  .side-activity { order: 3; margin-bottom: 1.5rem; }
  .news-block { order: 4; }
  .recent-grid { grid-template-columns: 1fr 1fr; }
  .upcoming-list .event.has-cover { grid-template-columns: calc((100% - 0.9rem) / 2) 1fr; gap: 0.9rem; }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gallery-grid img,
  .photo-grid img {
    transition: filter 0.15s ease;
  }
  .gallery-grid a:hover img,
  .photo-grid a:hover img {
    filter: brightness(1.06);
  }
}
