/* ====================== BASISLAYOUT ====================== */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #848284;
  color: #ffffff;
  line-height: 1.6;
  font-size: 1.05rem;
}

header {
  text-align: center;
  padding: 2em 1em 1em;
}
header h1 {
  margin: 0;
  font-weight: bold;
  font-size: 1.8rem;
}
header h3 {
  margin-top: 0.3em;
  color: #eee;
  font-weight: normal;
  font-size: 1.1rem;
}

/* ====================== NAVIGATION ====================== */

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background-color: #9b9b9b;
  border-top: 1px solid #777;
  border-bottom: 1px solid #777;
}
nav a {
  padding: 0.8em 1.2em;
  color: #ffff66;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease-in;
}
nav a:hover {
  background: #777;
}

/* ====================== MAIN ====================== */

main {
  max-width: 900px;
  margin: 2em auto;
  padding: 0 1.5em;
  text-align: left;
}

main img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

footer p {
  text-align: center;
  font-size: 0.9em;
  color: #ddd;
  padding-top: 2em;
}

/* ====================== GALERIE ====================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
  margin-top: 2em;
}

/* Links ohne Unterstrich */
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: #ffff99;
}

.item {
  cursor: pointer;
  background: transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s ease;
}
.item:hover {
  transform: scale(1.02);
}

.item img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
}

.caption {
  background: #777;
  padding: 0.5em;
  font-size: 1rem;
  color: #fff;
  text-align: center;
}

/* ====================== LIGHTBOX ====================== */

/* ---------- Lightbox ---------- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #808080;
  justify-content: center;
  align-items: center;
  overflow: auto;
  padding: 2vh 2vw;
}

/* Grundlayout: mobil zuerst */
.lightbox-content {
  display: flex;
  flex-direction: column;   /* mobil untereinander */
  gap: 1.5em;
  align-items: center;
  width: 100%;
  padding-top: 2vh;        /* Abstand nach oben */
  max-height: 90vh;
  justify-content: center;
}

/* Bild im Popup */
.lightbox img {
  display: block;
  margin: 0 auto;
  max-width: 90vw;
  max-height: 100 %;        /* mehr Höhe für hohe Bilder */
  flex-shrink: 1;
  min-height: 0;
  object-fit: contain;
  border: 2px solid #666;
  border-radius: 4px;
}

/* Text */
.info-text {
  color: #ffffff;
  text-align: left;
  max-width: 90%;
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-text span {
  color: #ffff80;
  font-weight: bold;
}

/* Button */
.buy-info {
  margin-top: 1em;
  width: 90%;
  text-align: left;
}

.buy-button {
  display: inline-block;
  background-color: #ffff66;
  color: #333;
  font-weight: bold;
  padding: 0.5em 1em;
  border-radius: 4px;
  transition: 0.3s;
}
.buy-button:hover {
  background-color: #ffea33;
}

/* X-Symbol */
.close {
  position: fixed;
  top: 15px;
  right: 25px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

/* ---------- Desktop: Bild links, Text rechts ---------- */
@media (min-width: 900px) {

  .lightbox-content {
    display: grid;
    grid-template-columns: 55vw 35vw;
    justify-content: center;
    column-gap: 50px;
    align-items: start;
  }

  .lightbox img {
    grid-row: 1/3;
    max-width: 100%;           /* passt große Bilder an */
    max-height: 80vh;
    object-fit: contain;
  }

  .info-text {
    grid-column: 2;grid-row: 1;
    align-self: start;
  }

  .buy-info {
    grid-column: 2;
    grid-row: 2;
    width: 100%;               /* Button unter dem Text */
    margin-top: 20px;
    width: fit-content;
  }
}

/* ---------- Spezialklasse für extreme Querformate ---------- */
.extra-wide {
  max-height: 55vh !important;
  max-width: 80vw !important;
  object-fit: contain !important;
}


/* Speziell für Mobilgeräte mit einer Breite bis 600px */
@media screen and (max-width: 600px) {
  .gallery {
    /* Verkleinert die Mindestbreite, damit 2 Bilder nebeneinander passen */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5em; /* Optional: Verringert den Abstand zwischen den Bildern mobil */
  }

  main img {
    /* Verhindert, dass die Bilder über ihre natürliche Größe hinaus pixelig werden */
    max-width: 100%;
    height: auto;
    object-fit: cover; /* Sorgt dafür, dass sie trotzdem sauber ausgerichtet bleiben */
  }
}

