/* ============================================
   FSG Ormalingen - Fotoarchiv
   ============================================ */

:root {
  --color-dark: #1a1a2e;
  --color-dark-lighter: #22223a;
  --color-dark-card: #262640;
  --color-light: #f5f2eb;
  --color-white: #ffffff;
  --color-white-rgb: 255, 255, 255;
  --color-yellow: #FFD700;
  --color-blue: #6AAFE6;
  --color-blue-rgb: 106, 175, 230;
  --color-red: #CC3333;
  --color-text: #f5f2eb;
  --color-text-muted: #a0a0b4;
  --color-border: rgba(245, 242, 235, 0.1);
  --transition-fast: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--color-text);
  background-color: var(--color-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-yellow);
}

/* ==================== HEADER ==================== */

.archiv-header {
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--color-border);
}

.archiv-header__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.archiv-header__back:hover {
  color: var(--color-yellow);
}

.archiv-header__back svg {
  stroke: currentColor;
}

.archiv-header__title h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 6px;
}

.archiv-header__title p {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.archiv-header__subtitle {
  font-size: 0.85rem !important;
  font-style: italic;
  opacity: 0.7;
  margin-top: 4px;
}

/* ==================== YEAR NAVIGATION ==================== */

.archiv-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-dark);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.archiv-nav__years {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

.archiv-nav__years::-webkit-scrollbar {
  display: none;
}

.archiv-nav__year {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(var(--color-white-rgb), 0.05);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.archiv-nav__year:hover {
  border-color: var(--color-blue);
  color: var(--color-white);
}

.archiv-nav__year--active {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-dark);
  font-weight: 600;
}

.archiv-nav__year--active:hover {
  color: var(--color-dark);
}

.archiv-nav__year--all {
  background: rgba(var(--color-blue-rgb), 0.1);
  border-color: rgba(var(--color-blue-rgb), 0.3);
  color: var(--color-blue);
}

/* ==================== MAIN CONTENT ==================== */

.archiv-main {
  padding: 32px 0 60px;
}

.archiv-loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: 60px 20px;
  font-size: 1rem;
}

/* Year Section */

.archiv-year {
  margin-bottom: 48px;
}

.archiv-year__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.archiv-year__number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-yellow);
  line-height: 1;
}

.archiv-year__count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Gallery Card */

.archiv-gallery {
  background: var(--color-dark-lighter);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.archiv-gallery__header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background var(--transition-fast);
}

.archiv-gallery__header:hover {
  background: rgba(var(--color-white-rgb), 0.03);
}

.archiv-gallery__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-white);
}

.archiv-gallery__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.archiv-gallery__count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: rgba(var(--color-white-rgb), 0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

.archiv-gallery__toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.archiv-gallery--open .archiv-gallery__toggle {
  transform: rotate(180deg);
}

.archiv-gallery__body {
  display: none;
  padding: 0 24px 24px;
}

.archiv-gallery--open .archiv-gallery__body {
  display: block;
}

/* Gallery Text */

.archiv-gallery__text {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-line;
  font-style: italic;
  padding: 16px 20px;
  background: rgba(var(--color-white-rgb), 0.02);
  border-left: 3px solid var(--color-yellow);
  border-radius: 0 8px 8px 0;
}

/* Photo Grid */

.archiv-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.archiv-gallery__img {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-dark-card);
}

.archiv-gallery__img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Text-only gallery (no images) */

.archiv-gallery__text-only {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 12px;
  opacity: 0.6;
}

/* ==================== LIGHTBOX ==================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.lightbox--active {
  display: flex;
}

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

.lightbox__content img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__caption {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 16px;
  max-width: 600px;
  font-style: italic;
  line-height: 1.5;
}

.lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(var(--color-white-rgb), 0.1);
  border: none;
  color: var(--color-white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  z-index: 1001;
}

.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(var(--color-white-rgb), 0.2);
}

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

.archiv-footer {
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.archiv-footer p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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

@media (max-width: 768px) {
  .archiv-header__title h1 {
    font-size: 1.6rem;
  }

  .archiv-gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
  }

  .archiv-gallery__header {
    padding: 16px 18px;
  }

  .archiv-gallery__body {
    padding: 0 18px 18px;
  }

  .archiv-gallery__text {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  .lightbox__prev,
  .lightbox__next {
    width: 40px;
    height: 40px;
  }

  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
}

@media (max-width: 480px) {
  .archiv-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .archiv-nav__year {
    padding: 5px 11px;
    font-size: 0.8rem;
  }
}
