:root {
  --blue: #0b3d91;
  --blue-light: #1e5bb8;
  --red: #c41e3a;
  --bg: #f4f6f9;
  --white: #fff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --border: #dde3ea;
  --radius: 10px;
  --font: "Source Sans 3", system-ui, sans-serif;
  --font-display: "Merriweather", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92vw); margin-inline: auto; }

.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue);
  line-height: 1.3;
}

.brand span { color: var(--red); }

.nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.nav a { font-weight: 600; color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--blue); }
.nav-feature-off { display: none !important; }
.feature-disabled-banner {
  background: #f0f4fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--muted);
  margin: 2rem 0;
}
.feature-disabled-banner strong { color: var(--text); }
.nav-sysarch { color: var(--muted) !important; font-size: 0.88rem; font-weight: 500; }
.nav-sysarch:hover { color: var(--blue) !important; }
.nav-state-os {
  color: var(--blue) !important;
  background: #e8f0fb;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}
.nav-state-os:hover { background: #d4e4f8; text-decoration: none; }

.lang-switch {
  display: flex;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
}

.lang-switch button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}

.lang-switch button.active,
.lang-switch a.active {
  background: var(--blue);
  color: var(--white);
}

.lang-switch a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.lang-partner {
  font-weight: 600;
  color: var(--blue-light);
  text-decoration: none;
}

.lang-partner:hover {
  text-decoration: underline;
}

.hero {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: var(--white);
  padding: 4rem 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

.hero p { opacity: 0.95; max-width: 640px; font-size: 1.1rem; }

.hero-actions { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; color: var(--white); }
.btn-state-os { background: var(--blue); color: var(--white); }
.btn-state-os:hover { filter: brightness(1.08); text-decoration: none; color: var(--white); }
.state-os-promo {
  background: linear-gradient(135deg, #0b3d91 0%, #1e5bb8 100%);
  color: var(--white);
  padding: 2.5rem 0;
}
.state-os-promo .section-title,
.state-os-promo .section-subtitle { color: var(--white); }
.state-os-promo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.state-os-promo .btn-state-os { background: var(--white); color: var(--blue); font-weight: 700; }
.state-os-promo .btn-state-os:hover { background: #f0f4fa; color: var(--blue); }
.volby-simulator-promo {
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 55%, #dc2626 100%);
  color: var(--white);
  padding: 2.5rem 0;
}
.volby-simulator-promo .section-title,
.volby-simulator-promo .section-subtitle { color: var(--white); }
.volby-simulator-promo-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.volby-simulator-promo .btn-volby-simulator { background: var(--white); color: #7f1d1d; font-weight: 700; }
.volby-simulator-promo .btn-volby-simulator:hover { background: #fef2f2; color: #7f1d1d; text-decoration: none; }
.ferovy-meter-promo {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 55%, #40916c 100%);
  color: var(--white);
  padding: 2.5rem 0;
}
.ferovy-meter-promo .section-title,
.ferovy-meter-promo .section-subtitle { color: var(--white); }
.ferovy-meter-promo-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.ferovy-meter-promo .btn-ferovy-meter { background: var(--white); color: #1b4332; font-weight: 700; }
.ferovy-meter-promo .btn-ferovy-meter:hover { background: #f0fdf4; color: #1b4332; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.8);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); text-decoration: none; color: var(--white); }

.btn-secondary { background: var(--blue); color: var(--white); }

section { padding: 3rem 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.section-subtitle { color: var(--muted); margin-bottom: 2rem; max-width: 640px; }

#overview-root {
  text-align: center;
}

#overview-root .section-subtitle {
  margin-inline: auto;
}

#overview-root .pdf-fallback {
  text-align: center;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(11, 61, 145, 0.08);
  border: 1px solid var(--border);
}

.card h3 { font-family: var(--font-display); color: var(--blue); margin-bottom: 0.5rem; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.badge-published { background: #e6f4ea; color: #1e7e34; }
.badge-draft { background: #fff3cd; color: #856404; }
.badge-planned { background: #e8eef5; color: var(--blue); }

.prose { max-width: 72ch; }
.prose p { margin-bottom: 1rem; }
.prose h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  color: var(--blue);
}
.prose ol {
  margin: 0 0 1.25rem 1.25rem;
  padding: 0;
}
.prose ol li { margin-bottom: 1rem; }
.prose .compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}
.prose .compare-table th,
.prose .compare-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.prose .compare-table thead th {
  background: var(--surface-alt, #f4f7fb);
  font-weight: 600;
}
.prose .compare-table tbody th {
  font-weight: 600;
  background: #fafbfc;
}
@media (max-width: 720px) {
  .prose .compare-table { display: block; overflow-x: auto; }
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-embed {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-embed iframe { width: 100%; height: 100%; border: 0; }

.comments-box .card { margin-top: 1rem; }
.text-meta { font-size: 0.85rem; color: var(--muted); }
.prose--mt { margin-top: 1.5rem; }

.comments-box {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comment {
  background: var(--white);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.comment-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.35rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.alert-info { background: #e8f0fa; color: var(--blue); }
.alert-success { background: #e6f4ea; color: #1e7e34; }

.file-protocol-banner {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffecb5;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.file-protocol-banner code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.file-protocol-banner a {
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,0.9);
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer a { color: var(--white); }

.page-hero {
  background: var(--white);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.btn-outline-dark {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  margin-left: 0.5rem;
}
.btn-outline-dark:hover {
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
}

.section--white-bg {
  background: var(--white);
}

.section--pad-top {
  padding-top: 2rem;
}

.overview-actions {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pdf-slideshow {
  margin: 0 auto 1.5rem;
  max-width: 100%;
  text-align: center;
}

.pdf-slideshow__stage {
  width: 100%;
  height: min(72vh, 720px);
  min-height: min(72vh, 720px);
  max-height: min(72vh, 720px);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #1a1d21;
  box-shadow: 0 4px 24px rgba(11, 61, 145, 0.12);
  overflow: hidden;
  position: relative;
}

.pdf-slideshow__stage > [hidden] {
  display: none !important;
}

.pdf-slideshow__stage canvas,
.pdf-slideshow__stage .pdf-slideshow__image {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center center;
}

.pdf-slideshow__image {
  background: transparent;
}

.pdf-slideshow__preview {
  display: none !important;
}

.pdf-slideshow__loading {
  color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  text-align: center;
  animation: slideshow-pulse 1.6s ease-in-out infinite;
}

@keyframes slideshow-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.pdf-slideshow__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.slideshow-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--blue);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}

.slideshow-btn:hover {
  background: var(--bg);
}

.slideshow-btn--text {
  width: auto;
  min-width: 6.5rem;
  padding: 0 1rem;
  font-size: 0.95rem;
}

.slideshow-counter {
  font-weight: 600;
  min-width: 12rem;
  text-align: center;
}

.pdf-slideshow__hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.pdf-full-doc {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}

.pdf-full-doc summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}

.pdf-full-doc .pdf-viewer {
  margin: 0 1rem 1rem;
}

.pdf-viewer {
  width: 100%;
  height: min(85vh, 900px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #525659;
  box-shadow: 0 4px 24px rgba(11, 61, 145, 0.12);
}

.pdf-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.pdf-fallback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.mt-15 {
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .pdf-viewer { height: 70vh; }
  .btn-outline-dark { margin-left: 0; margin-top: 0.5rem; display: inline-block; }
}
