﻿/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: #f4f5f7;
  color: #2c3e50;
  line-height: 1.65;
  font-size: 16px;
}

/* ── Header ──────────────────────────────────────────── */
header {
  background: linear-gradient(160deg, #1a3a5c 0%, #0d2137 100%);
  color: #fff;
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.rings {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: #c8963c;
  margin-bottom: 0.6rem;
}

header h1 a {
  color: #c8963c;
  text-decoration: none;
  font-size: 2.8rem;
  letter-spacing: 0.12em;
  font-weight: bold;
}

#site-subtitle {
  color: #a8c4df;
  font-style: italic;
  font-size: 1rem;
  margin-top: 0.4rem;
}

/* ── Navigation ──────────────────────────────────────── */
nav {
  background: #122840;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.nav-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}

nav a {
  color: #b0c8e0;
  text-decoration: none;
  padding: 0.75rem 1.1rem;
  display: inline-block;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  background: rgba(200,150,60,0.2);
  color: #fff;
}

nav a.nav-active {
  background: #c8963c;
  color: #fff;
}

/* ── Main content ────────────────────────────────────── */
main {
  max-width: 920px;
  margin: 2rem auto 3rem;
  padding: 0 1rem;
  min-height: 50vh;
}

/* ── Page hero banner ─────────────────────────────────── */
.page-hero {
  width: calc(100% + 2rem);
  margin: 0 -1rem 2rem;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-grass { background-image: url('../photos/bg/grass.jpg'); }
.hero-kto   { background-image: url('../photos/bg/kto.jpg'); }

@media (max-width: 640px) {
  .page-hero { height: 140px; }
}

/* ── Loading ─────────────────────────────────────────── */
.loading {
  text-align: center;
  color: #888;
  padding: 4rem 0;
  font-style: italic;
}

/* ── Home: event cards ───────────────────────────────── */
.home-intro {
  text-align: center;
  color: #555;
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.4rem;
}

.event-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 1.8rem 1.4rem;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.event-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.event-card .ev-year {
  font-size: 2.4rem;
  font-weight: bold;
  color: #1a3a5c;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.event-card .ev-title { font-size: 0.9rem; color: #555; }
.event-card .ev-loc   { font-size: 0.82rem; color: #888; margin-top: 0.3rem; }
.event-card .ev-photos { font-size: 0.78rem; color: #c8963c; margin-top: 0.5rem; }

/* ── Event page ──────────────────────────────────────── */
.event-page h2 {
  font-size: 2rem;
  color: #1a3a5c;
  border-bottom: 3px solid #c8963c;
  padding-bottom: 0.45rem;
  margin-bottom: 1.4rem;
}

.event-info-box {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.8rem;
  line-height: 1.8;
}

.event-info-box strong { color: #1a3a5c; }
.event-description { margin-top: 0.6rem; color: #444; }

/* ── Section headings ────────────────────────────────── */
.section { margin-bottom: 2.2rem; }

.section-title {
  font-size: 1.15rem;
  color: #1a3a5c;
  border-left: 4px solid #c8963c;
  padding-left: 0.65rem;
  margin-bottom: 1rem;
  font-family: Georgia, serif;
}

/* ── Participants ─────────────────────────────────────── */
.participants-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.participants-group h4 {
  font-size: 0.9rem;
  color: #1a3a5c;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: sans-serif;
}

.participants-group ul { list-style: none; column-count: 2; column-gap: 1rem; }
.participants-group ul li { padding: 0.18rem 0; font-size: 0.9rem; break-inside: avoid; }
.participants-group ul li::before { content: "▸ "; color: #c8963c; font-size: 0.75em; }

/* ── Disciplines grid ────────────────────────────────── */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
}

.discipline-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 6px;
  padding: 0.9rem;
}

.discipline-card h4 {
  font-size: 0.88rem;
  color: #1a3a5c;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: sans-serif;
}

.discipline-card ol { padding-left: 1.2rem; font-size: 0.88rem; color: #444; }
.discipline-card ol li { padding: 0.1rem 0; }
.discipline-card ol li:first-child  { color: #c8963c; font-weight: bold; }
.discipline-card ol li:nth-child(2) { color: #888; }
.discipline-card ol li:nth-child(3) { color: #9c7050; }

/* ── Standings table ─────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.93rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.standings-table thead th {
  background: #1a3a5c;
  color: #fff;
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-family: sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.standings-table tbody td { padding: 0.5rem 0.9rem; border-bottom: 1px solid #f0f0f0; }
.standings-table tbody tr:last-child td { border-bottom: none; }
.standings-table tbody tr:nth-child(even) td { background: #fafbfc; }
.standings-table tbody tr:nth-child(1) td { font-weight: bold; color: #c8963c; }
.standings-table tbody tr:nth-child(2) td { font-weight: bold; color: #777; }
.standings-table tbody tr:nth-child(3) td { font-weight: bold; color: #9c7050; }

.standings-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }

/* ── Photo gallery ───────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.photo-grid img {
  width: 100%;
  height: 115px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  display: block;
}

.photo-grid img:hover { opacity: 0.82; transform: scale(1.03); }

/* ── Lightbox ────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lb-hidden { display: none !important; }

#lb-img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 4px;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lb-close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  font-size: 2.8rem;
  background: none; border: none;
  color: #fff; cursor: pointer;
  line-height: 1; opacity: 0.8;
}

.lb-close:hover { opacity: 1; }

.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 3.5rem;
  background: none; border: none;
  color: #fff; cursor: pointer;
  padding: 0.5rem 1rem;
  line-height: 1; opacity: 0.6;
  user-select: none;
}

.lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }

.lb-counter {
  position: absolute;
  bottom: 1rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-family: sans-serif;
}

/* ── Notes box ───────────────────────────────────────── */
.notes-box {
  background: #fffbf0;
  border-left: 4px solid #c8963c;
  padding: 0.9rem 1.2rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.92rem;
  color: #555;
}

.notes-box p { margin-bottom: 0.7rem; }
.notes-box p:last-child { margin-bottom: 0; }

/* ── Static pages shared ─────────────────────────────── */
.static-page h2 {
  font-size: 2rem;
  color: #1a3a5c;
  border-bottom: 3px solid #c8963c;
  padding-bottom: 0.45rem;
  margin-bottom: 1.6rem;
}

/* ── Pravidlá page ───────────────────────────────────── */
.pravidla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}

.pravidla-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 1.3rem 1.5rem;
}

.pravidla-card h3 {
  font-size: 1.05rem;
  color: #1a3a5c;
  margin-bottom: 0.7rem;
  border-bottom: 2px solid #c8963c;
  padding-bottom: 0.3rem;
  font-family: sans-serif;
}

.pravidla-equipment {
  font-size: 0.87rem;
  color: #555;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.7rem;
}

.pravidla-desc p {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

.pravidla-desc p:last-child { margin-bottom: 0; }

/* ── Kto je kto page ─────────────────────────────────── */
.kto-intro {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.8rem;
}

.kto-intro p { margin-bottom: 0.6rem; }
.kto-intro p:last-child { margin-bottom: 0; }

.kto-note {
  font-size: 0.9rem;
  color: #777;
  font-style: italic;
}

.kto-tree-link a {
  font-size: 0.88rem;
  color: #1a3a5c;
  text-decoration: none;
}
.kto-tree-link a:hover { text-decoration: underline; }

/* ── Family Tree ─────────────────────────────────────── */
.family-tree-wrap {
  overflow-x: auto;
  padding: 0.5rem 0 2rem;
}

.family-tree {
  display: inline-block;
  min-width: 100%;
  text-align: center;
}

.family-tree ul {
  display: flex;
  flex-direction: row;
  justify-content: center;
  list-style: none;
  padding: 22px 0 0;
  margin: 0;
  position: relative;
}

/* Vertical line from parent down to horizontal bar */
.family-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: #b0c8e0;
}

.family-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 6px 0;
  position: relative;
  list-style: none;
}

/* Left half of horizontal sibling connector */
.family-tree li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 2px;
  background: #b0c8e0;
}

/* Right half of horizontal sibling connector */
.family-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 2px;
  background: #b0c8e0;
}

.family-tree li:first-child::before { display: none; }
.family-tree li:last-child::after   { display: none; }
.family-tree li:only-child::before,
.family-tree li:only-child::after   { display: none; }

/* Vertical line from horizontal bar down to each node */
.tree-node {
  position: relative;
  display: inline-block;
  border: 1px solid #b0c8e0;
  border-radius: 6px;
  padding: 6px 14px;
  background: #eaf2fb;
  font-size: 0.82rem;
  color: #1a3a5c;
  font-family: sans-serif;
  min-width: 120px;
  max-width: 260px;
  white-space: nowrap;
  text-align: center;
  line-height: 1.35;
  cursor: default;
}

.tree-node::before {
  content: '';
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: #b0c8e0;
}

/* Root node — no vertical line above it */
.family-tree > ul > li > .tree-node::before { display: none; }

.tree-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #c8963c;
  font-weight: bold;
  margin-bottom: 3px;
}

.tree-branch-root > .tree-node {
  background: #d5e8f7;
  border-color: #1a3a5c;
  border-width: 2px;
}

.tree-plus {
  color: #999;
  font-size: 0.75em;
  margin: 0 2px;
}

/* ── Archív page ─────────────────────────────────────── */
.archiv-intro {
  color: #666;
  font-style: italic;
  margin-bottom: 1.8rem;
}

.archiv-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.archiv-year {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 1rem 1.3rem;
}

.archiv-year-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.archiv-year-num {
  font-size: 1.4rem;
  font-weight: bold;
  color: #1a3a5c;
  font-family: sans-serif;
  min-width: 3.5rem;
}

.archiv-rocnik {
  font-size: 0.82rem;
  color: #c8963c;
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.archiv-location {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-left: auto;
}

.archiv-standings {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  padding: 0;
}

.archiv-standings li {
  font-size: 0.88rem;
  color: #444;
  white-space: nowrap;
}

.archiv-place {
  color: #c8963c;
  font-weight: bold;
  font-family: sans-serif;
  margin-right: 0.2rem;
}

.archiv-standings-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.archiv-standings-cols h5 {
  font-size: 0.78rem;
  font-family: sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a3a5c;
  margin-bottom: 0.4rem;
}

/* ── Footer ──────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.8rem 1rem;
  color: #999;
  font-size: 0.82rem;
  border-top: 1px solid #dde3ea;
  font-family: sans-serif;
}

footer a { color: #1a3a5c; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  header h1 a { font-size: 2rem; }
  .event-grid { grid-template-columns: 1fr 1fr; }
  .participants-cols { grid-template-columns: 1fr; }
  .standings-cols { grid-template-columns: 1fr; }
  .disciplines-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .photo-grid img { height: 85px; }
  .lb-prev, .lb-next { font-size: 2.5rem; }
  .pravidla-grid { grid-template-columns: 1fr; }
  .archiv-standings-cols { grid-template-columns: 1fr; }
  .archiv-location { margin-left: 0; }
}

@media (max-width: 380px) {
  .event-grid { grid-template-columns: 1fr; }
}
