/**
 * Branham.cz - Hlavní CSS
 * Clean, modern, responsive design
 */

/* ========================================
   CSS PROMĚNNÉ
   ======================================== */

:root {
  /* Light mode */
  --primary-color: #1e40af;
  --primary-dark: #1e3a8a;
  --secondary-color: #e8a87c;
  --accent-color: #d4845c;

  --bg-light: #ffffff;
  --bg-light-alt: #f8f9fa;
  --bg-dark: #0f1419;
  --bg-dark-alt: #1a1a1a;

  --text-light: #222;
  --text-light-secondary: #666;
  --text-dark: #e0e0e0;
  --text-dark-secondary: #aaa;

  --border-color-light: #ddd;
  --border-color-dark: #333;

  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

  --spacing: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

html[data-theme="dark"] {
  --bg-light: #0f1419;
  --bg-light-alt: #1a1a1a;
  --text-light: #e0e0e0;
  --text-light-secondary: #aaa;
  --border-color-light: #333;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-light);
  background: var(--bg-light);
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: 0.5em;
  font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: var(--spacing);
  color: var(--text-light-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ========================================
   HEADER & NAV
   ======================================== */

header {
  background: var(--primary-color);
  color: white;
  padding: 1rem var(--spacing);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: white;
  transition: opacity 0.2s ease;
}

nav a:hover {
  opacity: 0.8;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 0.25rem;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

#app {
  min-height: calc(100vh - 60px);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* ========================================
   HERO SECTION (HOME)
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: 0.5rem;
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: white;
}

.hero .subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--spacing-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-color);
  color: white;
}

/* ========================================
   TIMELINE (BIOGRAPHY) - INTERACTIVE MIND MAP
   ======================================== */

.timeline {
  position: relative;
  width: 100%;
  padding: 7rem 2rem 5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 0;
  border-top: 3px solid var(--primary-color);
  transform: translateY(-50%);
  z-index: 0;
  opacity: 0.6;
}

.timeline-endpoint {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.timeline-endpoint-dot {
  width: 12px;
  height: 12px;
  background: var(--primary-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

.timeline-endpoint-year {
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.85rem;
}

.timeline-wrapper {
  position: relative;
  width: 100%;
  min-height: 520px;
  padding: 0 5%;
}

.timeline-item {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateX(-50%);
  width: auto;
  z-index: 1;
}

.timeline-anchor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
}

.timeline-anchor--top {
  margin-bottom: 0.75rem;
}

.timeline-anchor--bottom {
  margin-top: 0.75rem;
}

.timeline-point {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

.timeline-connector {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--primary-color);
  opacity: 0.65;
  z-index: 1;
}

.timeline-item.timeline-item--top .timeline-connector {
  bottom: 12px;
  height: 90px;
}

.timeline-item.timeline-item--bottom .timeline-connector {
  top: 12px;
  height: 90px;
}

.timeline-item.timeline-item--top .timeline-bubble,
.timeline-item.timeline-item--bottom .timeline-bubble {
  position: absolute;
  left: 50%;
  width: min(260px, 22vw);
  max-width: 260px;
  padding: 1rem 1.1rem;
  background: var(--bg-light-alt);
  border: 2px solid var(--primary-color);
  border-radius: 1rem;
  z-index: 2;
}

.timeline-item.timeline-item--top .timeline-bubble {
  bottom: calc(90px + 14px);
}

.timeline-item.timeline-item--bottom .timeline-bubble {
  top: calc(90px + 14px);
}

.timeline-year {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
  background: rgba(255,255,255,0.95);
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(30,64,175,0.12);
}

.timeline-bubble-title {
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.timeline-bubble-text {
  font-size: 0.9rem;
  color: var(--text-light-secondary);
  line-height: 1.6;
}

/* ========================================
   CARDS GRID (SERMONS)
   ======================================== */

.quote-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-light-secondary);
}

.quote-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: var(--spacing-lg) 0;
  padding: var(--spacing);
  background: var(--bg-light-alt);
  border-radius: 0.5rem;
}

.quote-search {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.4rem;
  font-size: 1rem;
  background: #fff;
  color: var(--text-light);
  box-sizing: border-box;
}

.quote-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59, 130, 246), 0.15);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-group-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light-secondary);
  min-width: 70px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  background: #fff;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary-color);
}

.filter-chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.filter-chip .chip-count {
  font-size: 0.7rem;
  opacity: 0.7;
}

.filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: 0.25rem;
  padding-top: 0.6rem;
}

.filter-count {
  font-size: 0.85rem;
  color: var(--text-light-secondary);
}

.filter-clear {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.filter-clear:hover {
  text-decoration: underline;
}

/* Dual-range slider */
.range-slider {
  position: relative;
  flex: 1;
  height: 28px;
  min-width: 180px;
  margin: 0 0.5rem;
}

.range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  transform: translateY(-50%);
}

.range-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  background: var(--primary-color);
  border-radius: 999px;
  transform: translateY(-50%);
  pointer-events: none;
}

.range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-input::-webkit-slider-runnable-track {
  background: transparent;
  border: none;
  height: 28px;
}

.range-input::-moz-range-track {
  background: transparent;
  border: none;
  height: 28px;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-color);
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-top: 0;
}

.range-input::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-color);
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.range-input:active::-webkit-slider-thumb { cursor: grabbing; }
.range-input:active::-moz-range-thumb { cursor: grabbing; }

[data-theme="dark"] .range-track {
  background: rgba(255, 255, 255, 0.15);
}

.quote-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-light-secondary);
  font-style: italic;
}

[data-theme="dark"] .quote-search {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dark, #fff);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .filter-chip {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dark, #fff);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .quote-tag {
  background: rgba(255, 255, 255, 0.08);
}

/* ========================================
   GALLERY & LIGHTBOX
   ======================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.gallery-item {
  cursor: pointer;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  background: var(--bg-light-alt);
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.5rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
  border-radius: 0.25rem;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ========================================
   MAPA (CONTACT)
   ======================================== */

.map-section {
  margin: var(--spacing-lg) 0;
}

#map {
  width: 100%;
  height: 500px;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  margin: var(--spacing-lg) 0;
}

.church-info {
  background: var(--bg-light-alt);
  padding: var(--spacing);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.church-info p {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.church-info strong {
  color: var(--primary-color);
}

/* ========================================
   SECTION
   ======================================== */

section {
  margin-bottom: var(--spacing-xl);
}

section h2 {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing);
  border-bottom: 2px solid var(--primary-color);
}

.section-description {
  color: var(--text-light-secondary);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-lg);
  max-width: 600px;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: var(--spacing-xl) var(--spacing);
  margin-top: var(--spacing-xl);
}

footer p {
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  nav {
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .hero {
    padding: var(--spacing-lg) var(--spacing);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item {
    text-align: left !important;
    padding-left: 2rem !important;
    padding-right: 0 !important;
  }

  .timeline-item::before {
    left: -8px;
  }

  #map {
    height: 300px;
  }

  #app {
    padding: var(--spacing);
  }

  .controls {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    flex-direction: column;
    width: 100%;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
  }

  nav a {
    display: block;
    padding: 0.5rem 0;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
