/* ========================================
   200 Jahre Schloss-Schule Ilvesheim
   Dark Theme - Wertig & Historisch
   ======================================== */

:root {
  --bg-primary:    #0a0a0f;
  --bg-secondary:  #12121a;
  --bg-card:       #1a1a25;
  --bg-elevated:   #222230;
  --text-primary:  #f0e6d2;
  --text-secondary:#b8a88a;
  --text-muted:    #7a6e5a;
  --accent:        #c9a84c;
  --accent-hover:  #e0c066;
  --accent-dim:    rgba(201, 168, 76, 0.15);
  --border:        rgba(201, 168, 76, 0.2);
  --border-subtle: rgba(201, 168, 76, 0.08);
  --shadow:        rgba(0, 0, 0, 0.6);
  --focus-ring:    #e0c066;
  --font-serif:    'Cinzel', Georgia, 'Times New Roman', serif;
  --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition:    0.3s ease;
  --slide-width:   100vw;
  --slide-max:     1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ========================================
   TOP NAVIGATION (Punkte-Leiste)
   ======================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-primary) 0%, rgba(10,10,15,0.85) 70%, transparent 100%);
  padding: 0 2rem;
}

.nav-line {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  z-index: 0;
}

.nav-dots {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
}

.nav-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 8px;
  text-decoration: none;
  border-radius: 50%;
  transition: var(--transition);
}

.nav-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--text-muted);
  transition: var(--transition);
}

.nav-dot:hover::before,
.nav-dot:focus::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-dim);
  transform: scale(1.3);
}

.nav-dot.active::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(201, 168, 76, 0.4);
  transform: scale(1.4);
}

.nav-dot:hover .dot-label,
.nav-dot:focus .dot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
}

.dot-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  letter-spacing: 0.02em;
}

.dot-label::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--border);
}

/* ========================================
   SIDE NAVIGATION ARROWS
   ======================================== */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 80px;
  background: rgba(26, 26, 37, 0.7);
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.nav-arrow:hover,
.nav-arrow:focus {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.nav-arrow:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
}

.nav-arrow-left {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.nav-arrow-right {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.nav-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========================================
   TTS TOGGLE
   ======================================== */
.tts-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--shadow);
}

.tts-toggle:hover,
.tts-toggle:focus {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.tts-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.tts-toggle.playing {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 2s infinite;
}

.tts-toggle svg {
  width: 24px;
  height: 24px;
}

.tts-status {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tts-toggle.playing .tts-status,
.tts-toggle:hover .tts-status {
  opacity: 1;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(201, 168, 76, 0); }
}

/* ========================================
   SLIDER CONTAINER
   ======================================== */
.slider-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.slider-container::-webkit-scrollbar {
  display: none;
}

/* ========================================
   ASPECT SECTIONS
   ======================================== */
.aspect-section {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 80px 80px 40px;
}

.aspect-inner {
  max-width: var(--slide-max);
  margin: 0 auto;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

/* Header */
.aspect-header {
  text-align: center;
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.aspect-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.aspect-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  font-weight: 400;
  font-style: italic;
}

/* Hero Image */
.aspect-hero {
  margin: 0 auto 2.5rem;
  max-width: 900px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px var(--shadow);
}

.aspect-hero img {
  width: 100%;
  height: auto;
  max-height: 50vh;
  object-fit: cover;
  display: block;
}

.aspect-hero figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-secondary);
  font-style: italic;
}

/* Content */
.aspect-content {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.aspect-content p {
  margin-bottom: 1.25rem;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-primary);
}

.aspect-content p.lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.aspect-content h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--accent);
  margin: 2rem 0 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aspect-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}

.aspect-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.aspect-content strong {
  color: var(--accent-hover);
  font-weight: 600;
}

.aspect-content em {
  color: var(--text-secondary);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem auto;
  max-width: 900px;
  width: 100%;
}

.gallery figure {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}
.aspect-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.gallery figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-secondary);
  font-style: italic;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: linear-gradient(0deg, var(--bg-primary) 0%, transparent 100%);
  z-index: 800;
  pointer-events: none;
}

.site-footer p {
  pointer-events: auto;
}

/* ========================================
   FOCUS & ACCESSIBILITY
   ======================================== */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.aspect-section:focus {
  outline: none;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast */
@media (prefers-contrast: more) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --accent: #ffd700;
    --border: rgba(255, 215, 0, 0.5);
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .aspect-section {
    padding: 70px 60px 40px;
  }
  
  .nav-arrow {
    width: 40px;
    height: 64px;
  }
}

@media (max-width: 768px) {
  html {
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .slider-container {
    flex-direction: column;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
  }
  
  .aspect-section {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 100vh;
    scroll-snap-align: none;
    padding: 70px 1.5rem 3rem;
  }
  
  .aspect-inner {
    min-height: auto;
  }
  
  .nav-arrow {
    display: none;
  }
  
  .top-nav {
    height: 50px;
    padding: 0 1rem;
  }
  
  .nav-dot {
    width: 28px;
    height: 28px;
    margin: 0 4px;
  }
  
  .nav-dot::before {
    width: 8px;
    height: 8px;
  }
  
  .dot-label {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
  
  .tts-toggle {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
  
  .gallery {
    grid-template-columns: 1fr;
  }
  
  .aspect-hero {
    margin-bottom: 1.5rem;
  }
  
  .aspect-header {
    padding: 1.5rem 0 1rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .aspect-section {
    padding: 60px 1rem 2rem;
  }
  
  .aspect-content p {
    font-size: 0.9rem;
  }
  
  .aspect-content blockquote {
    padding: 1rem 1.25rem;
  }
  
  .nav-dots {
    gap: 0;
  }
  
  .nav-dot {
    margin: 0 2px;
  }
}

/* Print */
@media print {
  .top-nav,
  .nav-arrow,
  .tts-toggle,
  .site-footer {
    display: none !important;
  }
  
  .slider-container {
    display: block;
    overflow: visible;
  }
  
  .aspect-section {
    width: 100%;
    height: auto;
    page-break-after: always;
    padding: 2rem;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 5, 10, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.lightbox-caption {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  max-width: 600px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(201, 168, 76, 0.3);
  transform: scale(1.1);
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: var(--text-secondary);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

