/* =========================
   Foto-Nummern-Overlay
========================= */
.photo-item {
  position: relative;
  display: inline-block;
  margin: 8px;
  z-index: 0; /* Baseline */
}

.photo-item img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  position: relative; /* eigener Layer */
  z-index: 1;
}

.photo-number {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: var(--fotos-nrbackground);
  color: var(--fotos-nrtext);
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 2;          /* über dem Bild */
  pointer-events: none; /* Klicks gehen aufs Bild */
}

/* Galerie-Container */
.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

/* Querformat-Reihe */
.photo-row.landscape {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}
.photo-row.landscape img {
  width: 300px;
  height: 225px;
  object-fit: cover;
  border: 1px solid #aaa;
  box-shadow: var(--fotos-boxshadow1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.photo-row.landscape img:hover {
  transform: scale(1.05);
  box-shadow: var(--fotos-boxshadow2);
  border-color: #666;
}

/* Hochformat-Reihe */
.photo-row.portrait {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}
.photo-row.portrait img {
  width: 225px;
  height: 300px;
  object-fit: cover;
  border: 1px solid #aaa;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.photo-row.portrait img:hover {
  transform: scale(1.05);
  box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
  border-color: #666;
}

/* Responsive Anpassung für kleine Bildschirme */
@media (max-width: 600px) {
  .photo-row.landscape,
  .photo-row.portrait {
    flex-direction: column;
    align-items: center;
  }

  .photo-row.landscape img {
    width: 90%;
    max-width: 300px;
    height: auto;
  }

  .photo-row.portrait img {
    width: 60%;
    max-width: 225px;
    height: auto;
  }
}

/* =========================
   Foto-Overlay
========================= */

/* Hintergrund für Foto-Overlay */
#photo-overlay.overlay {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* halbtransparent */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Fenster im Foto-Overlay */
#photo-overlay .overlay-box {
  position: relative;
  display: inline-block;      /* Box passt sich exakt dem Bild an */
  background: transparent;    /* kein zusätzlicher Hintergrund */
  border: 5px solid #666666;  /* Rahmen */
  border-radius: 12px;        /* abgerundete Ecken */
  box-shadow: none;           /* kein Schimmer */
  padding: 0;
  margin: 0;
}

/* Bild im Foto-Overlay */
#photo-overlay .overlay-content {
  display: block;                 /* Bild als Blockelement */
  margin: 0;
  line-height: 0;                 /* verhindert Zeilenlücke */
  max-width: calc(100vw - 40px);  /* mit Randabstand */
  max-height: calc(90vh - 40px);
  width: auto;
  height: auto;
  background-color: transparent !important; /* Überschreibt style.css */
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Schließen-Kreuz im Foto-Overlay */
#photo-overlay .overlay-box .close {
  position: absolute;   /* relativ zur Box */
  top: 10px;            /* Abstand vom oberen Bildrand */
  right: 20px;          /* Abstand vom rechten Bildrand */
  color: var(--color-cross-close);
  text-shadow: 
    0 0 3px var(--color-cross-shadow),
    0 0 6px var(--color-cross-shadow),
    0 0 12px var(--color-cross-shadow);
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;          /* über dem Bild */
}
