/* --- BASIS & RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Sticky Footer Vorbereitung. Wichtig: html/body brauchen eine FESTE
   Höhe (nicht min-height), damit "flex: 1" auf <main> (s.u.) die
   Restfläche nach Header/Footer korrekt berechnen kann - mit einer
   variablen Höhe würde das auf breiten Bildschirmen zu riesigen,
   falsch berechneten Flächen führen. Das mobile Bilder-Raster wird
   stattdessen gezielt aus diesem Mechanismus herausgenommen (siehe
   .gallery-page in der Mobile-Media-Query weiter unten), damit es dort
   trotzdem mitwachsen kann, statt den Footer zu verdecken. */
html, body {
  height: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: white;
  color: black;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Main dehnt sich aus, um Footer unten zu halten */
main {
  flex: 1;
}

/* --- HEADER --- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 60px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo a {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 3px;
  text-decoration: none;
  color: black;
  text-transform: uppercase;
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  text-decoration: none;
  color: black;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

/* LÖSUNG: Fixer Abstand vor About auf allen Seiten */
.nav-item-spacer {
  margin-left: 40px !important;
}

/* --- STARTSEITE: BILDER-GRID --- */
.home-main {
  padding: 20px 60px 20px 60px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  height: 75vh;
  min-height: 450px;
}

.category-card {
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
}

.category-image {
  width: 100%;
  height: 100%;
}

.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.category-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
}

.category-overlay span {
  color: white;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: bold;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

/* Desktop Hover-Effekte */
@media (min-width: 1025px) {
  .category-card:hover .category-image img { transform: scale(1.05); }
  .category-card:hover .category-overlay { background: rgba(0, 0, 0, 0.3); }
  .category-card:hover .category-overlay span { opacity: 1; transform: translateY(0); }
}

/* --- FOOTER --- */
.site-footer {
  padding: 40px 60px;
  background-color: white;
  border-top: 1px solid #eee;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content p {
  font-size: 12px;
  color: #888;
  letter-spacing: 1px;
}

.footer-nav {
  display: flex;
  gap: 25px;
}

.footer-nav a {
  text-decoration: none;
  color: black;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* --- BILD FADE-IN BEIM LADEN --- */
.fade-img {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-img.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .fade-img { transition: none; }
}

/* --- HAMBURGER-BUTTON (nur auf Mobile sichtbar) --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1600;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: black;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.nav-toggle.is-open span:nth-child(1) { width: 100%; transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { width: 100%; transform: translateY(-7px) rotate(-45deg); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) and (min-width: 641px) {
  .site-header { flex-direction: column; padding: 20px; gap: 20px; }
  .main-nav ul { gap: 15px; flex-wrap: wrap; justify-content: center; }
  .nav-item-spacer { margin-left: 0 !important; }
}

@media (max-width: 1024px) {
  .category-grid { grid-template-columns: 1fr; height: auto; }
  .category-card { height: 300px; }

  /* Mobile: Text & Overlay sofort sichtbar */
  .category-overlay { background: rgba(0, 0, 0, 0.25); }
  .category-overlay span { opacity: 1; transform: translateY(0); }

  .footer-content { flex-direction: column; gap: 20px; text-align: center; }
}

/* --- MOBILE NAV: Hamburger öffnet Vollbild-Menü ---
   Gilt auch im Querformat (breiter als 640px, aber wenig Höhe) - sonst
   würde die mehrzeilige Tablet-Navigation den Großteil des knappen
   Platzes auf dem gedrehten Handy fressen. */
@media (max-width: 640px), (max-height: 500px) and (orientation: landscape) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
  }

  .logo a { font-size: 13px; letter-spacing: 2px; }

  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1500;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .main-nav a {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .nav-item-spacer {
    margin-left: 0 !important;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee;
  }
}

/* Querformat mit wenig Höhe: Menüpunkte als umbrechende Reihe statt
   langer senkrechter Liste, damit das Vollbild-Menü nicht höher als der
   Bildschirm wird. */
@media (max-height: 500px) and (orientation: landscape) {
  .main-nav {
    overflow-y: auto;
    padding: 20px 0;
  }

  .main-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 28px;
  }

  .main-nav a {
    font-size: 15px;
  }

  .nav-item-spacer {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}




/* --- OPTIMIERTE DIANA LIM STYLE GALLERY (Größere Bilder) --- */
.gallery-page {
  padding: 0;
  /* Nutzt die volle Höhe, abzüglich eines kleinen Puffers für Titel/Header */
  height: 100vh;
  height: 100dvh; /* korrekte Höhe auf Mobile trotz Adressleiste */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-title {
  /* Padding oben/unten reduziert, um Platz zu sparen */
  padding: 20px 60px 0px; 
}

.gallery-title h1 {
  font-size: 15px; 
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #000;
  /* Kleinerer Abstand nach unten zum Bild */
  margin-bottom: 10px; 
}

.photo-grid-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  /* Padding unten reduziert, damit Bilder tiefer gehen */
  padding: 0 60px 20px 60px;
  gap: 10px;
  cursor: grab;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.photo-grid-horizontal::-webkit-scrollbar {
  display: none;
}

.photo-item-horizontal {
  flex: 0 0 auto;
  /* Erhöht auf 92%, damit die Bilder fast den ganzen Platz einnehmen */
  height: 92%;
}

.photo-item-horizontal img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

/* Anpassung für kleinere Bildschirme */
@media (max-width: 1024px) {
  .photo-grid-horizontal {
    height: 85%;
    padding: 0 20px 20px;
  }
}

/* Tablet: sanftes Einrasten pro Bild statt freiem Scrollen */
@media (max-width: 768px) and (min-width: 641px) {
  .photo-grid-horizontal {
    scroll-snap-type: x proximity;
  }

  .photo-item-horizontal {
    scroll-snap-align: center;
  }
}

/* Handy: Raster statt horizontalem Scrollen - man sieht alle Bilder einer
   Rubrik auf einen Blick und tippt eins an, um es groß zu sehen.
   Masonry (CSS-Spalten) statt festem Seitenverhältnis, damit schmale
   (Hochformat) und breite (Querformat) Bilder beide unbeschnitten in
   ihrem echten Seitenverhältnis dargestellt werden - unabhängig davon,
   welche Bilder später eingefügt werden. Gilt auch im Querformat mit
   wenig Höhe - sonst würde die alte, auf Bildschirmhöhe gequetschte
   Scroll-Reihe greifen. */
@media (max-width: 640px), (max-height: 500px) and (orientation: landscape) {
  .gallery-page {
    /* Aus dem flex:1-Mechanismus von <main> herausnehmen (siehe Kommentar
       oben bei html/body) - sonst würde die Höhe auf Basis des (bei
       Prozent-Flex-Basis nötigen) umgebenden Kontexts falsch berechnet.
       Stattdessen einfach normal mit dem Inhalt mitwachsen. */
    flex: none;
    height: auto;
    min-height: 100dvh;
    display: block;
    overflow: visible;
  }

  .gallery-title {
    padding: 20px 20px 0;
  }

  .photo-grid-horizontal {
    display: block;
    column-count: 2;
    column-gap: 10px;
    height: auto;
    overflow: visible;
    padding: 16px 16px 50px;
    cursor: default;
  }

  .photo-item-horizontal {
    height: auto;
    width: 100%;
    /* Platzhalter-Mindesthöhe, solange das Bild noch nicht geladen ist -
       sonst hat das Element Höhe 0 und loading="lazy" erkennt es nie als
       sichtbar, wodurch das Bild gar nicht erst nachgeladen wird. */
    min-height: 60px;
    break-inside: avoid;
    margin-bottom: 10px;
  }

  .photo-item-horizontal img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: initial;
  }
}

/* --- LIGHTBOX (groß angezeigtes Bild, Klick/Tap zum Öffnen) --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox-img.is-loaded {
  opacity: 1;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 12px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 10px;
  right: 15px;
  font-size: 30px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 34px;
}

.lightbox-prev { left: 5px; }
.lightbox-next { right: 5px; }

@media (max-width: 768px) {
  .lightbox-close { top: 6px; right: 6px; font-size: 26px; }
  .lightbox-prev, .lightbox-next { font-size: 26px; padding: 16px 10px; }
}