/* ========================================
   PHOTOBLOG THEME - Flickr-inspiriert
   Schwarzer Hintergrund, Fullscreen-Gefühl
   ======================================== */

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

@supports (height: 100dvh) {
  html, body {
    height: 100dvh;
  }
}

body {
  background-color: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === PHOTO CONTAINER (Einzelansicht) === */
.photo-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* === HOMEPAGE: Nur erstes Foto anzeigen === */
.homepage-container .homepage-photo {
  display: none;
}

.homepage-container .homepage-photo:first-child {
  display: flex;
}

/* === NAVIGATIONS-BEREICHE (Links & Rechts) === */
.nav-area {
  flex: 0 0 15%;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 10;
  -webkit-tap-highlight-color: transparent; /* Kein Standard-Touch-Highlight */
}

.nav-area:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-area:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-area.nav-disabled {
  cursor: default;
  pointer-events: none;
}

.nav-arrow {
  font-size: 3rem;
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nav-area:hover .nav-arrow {
  opacity: 0.8;
}

/* === FOTO-CONTENT (Zentral) === */
.photo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
}

.photo-wrapper {
  max-width: 95%;
  max-height: calc(100vh - 120px); /* Fallback für ältere Browser */
  max-height: calc(100dvh - 120px); /* Dynamische Viewport Height für Mobile */
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-wrapper img {
  max-width: 100%;
  max-height: calc(100vh - 120px); /* Fallback */
  max-height: calc(100dvh - 120px); /* Besser für Mobile */
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* === FOTO-METADATEN === */
.photo-meta {
  position: absolute;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.photo-meta:hover {
  opacity: 1;
}

.photo-date {
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: #ccc;
}

.archive-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.archive-link:hover {
  opacity: 1;
}

.archive-link svg {
  color: #fff;
}

/* === ARCHIV-SEITE === */
body.archive-page {
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #111;
  height: auto; /* Wichtig für scrollbare Archiv-Seite */
  min-height: 100vh;
}

.archive-header {
  text-align: center;
  padding: 4rem 2rem 2rem;
}

.archive-header h1 {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.archive-header h1 a {
  color: #fff;
  transition: opacity 0.2s ease;
}

.archive-header h1 a:hover {
  opacity: 0.7;
}

.archive-subtitle {
  font-size: 0.875rem;
  color: #888;
  font-weight: 300;
}

/* === ARCHIV-GRID === */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.archive-item {
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.archive-item:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.archive-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background-color: #222;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.archive-thumb p {
  display: none;
}

.archive-item:hover .archive-thumb img {
  transform: scale(1.05);
}

.archive-date {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #888;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* === ARCHIV-FOOTER === */
.archive-footer {
  text-align: center;
  padding: 3rem 2rem 4rem;
}

.back-link {
  font-size: 0.875rem;
  color: #888;
  transition: color 0.2s ease;
  font-weight: 300;
}

.back-link:hover {
  color: #fff;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .nav-area {
    flex: 0 0 15%;
    min-width: 60px;
    padding-bottom: 80px;  /* <-- Diese Zeile hinzufügen und Wert anpassen */
  }
  
  .nav-arrow {
    font-size: 2rem;
    opacity: 0.5;
  }
  
  .nav-area:active .nav-arrow {
    opacity: 1;
  }
  
  .photo-content {
    padding: 0 1rem;
    justify-content: center;
    padding-bottom: 80px; /* Platz für fixed Footer */
  }
  
  .photo-wrapper {
    max-height: calc(100dvh - 140px);
  }
  
  .photo-wrapper img {
    max-height: calc(100dvh - 140px);
  }
  
  /* Footer fixiert am unteren Rand */
  .photo-meta {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
  }
  
  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-area {
    flex: 0 0 10%;
    min-width: 40px;
  }
  
  .nav-arrow {
    opacity: 0.5; /* Noch etwas sichtbarer auf kleinen Screens */
  }
  
  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}