/*
 * Aussehen der Fotoseiten - dieselbe Farbwelt wie die Standardlayouts der
 * Fotobox: heller Cremegrund, Beige und Taupe, ein weiches Braun.
 *
 * Bewusst eine Datei ohne Baukasten: Der Webspace soll nichts bauen
 * muessen, und wer hier etwas aendert, sieht es sofort.
 */

:root {
  --creme: #f5efe5;
  --beige: #e6d9c7;
  --beige-hell: #eee5d8;
  --taupe: #b5a18c;
  --taupe-dunkel: #9c8672;
  --braun: #7b6453;
  --braun-dunkel: #5e4b3e;
  --text: #3e3128;
  --text-leise: #7a6a5c;
  --auf-braun: #fbf6ee;
  --karte: #fffdf9;
  --schatten: rgba(74, 56, 42, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--creme) url('hintergrund.svg') no-repeat center / cover fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.huelle {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

/* ---- Kopf ------------------------------------------------------------ */

.kopf {
  text-align: center;
  padding: 26px 0 22px;
}

.kopf h1 {
  margin: 0;
  font-size: clamp(24px, 5.5vw, 54px);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Ein langer Titel ohne Leerzeichen darf die Seite nicht breiter machen */
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .kopf h1 {
    letter-spacing: 0.06em;
  }
}

.trenner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px auto 10px;
  max-width: 320px;
  color: var(--braun);
}

.trenner::before,
.trenner::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--taupe);
}

.kopf p {
  margin: 0;
  color: var(--text-leise);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---- Bilder ---------------------------------------------------------- */

.raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 44vw), 1fr));
  gap: 18px;
  margin-top: 26px;
}

.bild {
  display: block;
  background: var(--karte);
  border: 8px solid var(--karte);
  outline: 1px solid var(--taupe);
  border-radius: 6px;
  box-shadow: 0 6px 18px var(--schatten);
  overflow: hidden;
  transition: transform 0.12s ease;
}

.bild:active {
  transform: scale(0.985);
}

.bild img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--karte);
}

.gross {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  background: var(--karte);
  border: 12px solid var(--karte);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(74, 56, 42, 0.32);
}

/* ---- Knoepfe --------------------------------------------------------- */

.knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 26px 0 8px;
}

.knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 26px;
  border: 2px solid var(--taupe);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8f2e9, #ebe1d4);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 6px 18px var(--schatten);
  cursor: pointer;
}

.knopf.haupt {
  border: 3px solid rgba(251, 246, 238, 0.92);
  border-radius: 999px;
  background: linear-gradient(160deg, #8e7663, var(--braun-dunkel));
  color: var(--auf-braun);
}

.knopf.gefahr {
  border-color: #c98b7a;
  color: #8d3a25;
}

.knopf:active {
  transform: translateY(1px);
}

/* ---- Karten und Meldungen -------------------------------------------- */

.karte {
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--taupe);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 8px 26px var(--schatten);
  margin: 22px auto;
  max-width: 640px;
}

.leise {
  color: var(--text-leise);
  font-size: 14px;
}

.meldung {
  margin: 18px auto;
  max-width: 640px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--taupe);
  background: rgba(255, 253, 249, 0.9);
  text-align: center;
}

.meldung.fehler {
  border-color: #c98b7a;
  color: #8d3a25;
}

/* ---- Formular -------------------------------------------------------- */

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-leise);
}

input[type='text'],
input[type='password'],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--taupe);
  border-radius: 12px;
  background: var(--karte);
  color: var(--text);
  font: inherit;
}

/* ---- Verwaltung ------------------------------------------------------ */

.bild.versteckt {
  opacity: 0.45;
}

.bildzeile {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0 2px;
}

.bildzeile button {
  flex: 1;
  min-height: 42px;
  border: 1px solid var(--taupe);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8f2e9, #ebe1d4);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.fuss {
  margin-top: 40px;
  text-align: center;
  color: var(--text-leise);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---- Lichtkasten ------------------------------------------------------
 *
 * Das Foto gross, schwarz drumherum, gewischt wird zum Blaettern. Darunter
 * nur zwei Knoepfe: speichern und weiterschicken - mehr will an dieser
 * Stelle niemand.
 *
 * Steht bewusst hier und nicht im Aussehen aus der Fotobox: Das ist
 * Bedienung, keine Farbwahl. Ein eigenes Design soll den Lichtkasten nicht
 * versehentlich abschalten koennen.
 */

.lichtkasten {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px;
  background: rgba(12, 10, 9, 0.93);
  overscroll-behavior: contain;
}

.lichtkasten[hidden] {
  display: none;
}

/* Der Hintergrund soll nicht mitscrollen, waehrend der Kasten offen ist */
body.lichtkasten-offen {
  overflow: hidden;
}

.lk-mitte {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lk-mitte img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.lk-knoepfe {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 44 Pixel hoch: die Flaeche, die ein Daumen sicher trifft. */
.lk-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.lk-knopf:hover,
.lk-knopf:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
}

.lk-knopf[hidden] {
  display: none;
}

/* Schliessen und Blaettern: grosszuegige Flaechen, auch mit nassen
   Fingern auf einer Feier zu treffen. */
.lk-zu,
.lk-vor {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 400 27px/1 system-ui, sans-serif;
  display: grid;
  place-items: center;
}

.lk-vor[hidden] {
  display: none;
}

.lk-zu {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 30px;
  z-index: 1;
}

.lk-zaehler {
  position: absolute;
  bottom: 16px;
  left: 50%;
  translate: -50% 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.lk-zaehler[hidden] {
  display: none;
}

/* Auf dem Handy liegen die Pfeile unten statt seitlich - am Rand
   verdecken sie sonst das halbe Bild. Gewischt wird ohnehin. */
@media (max-width: 560px) {
  .lichtkasten {
    padding: 12px 10px 64px;
  }

  .lk-vor {
    position: absolute;
    bottom: 10px;
  }

  .lk-zurueck {
    left: 24%;
  }

  .lk-weiter {
    right: 24%;
  }

  .lk-zaehler {
    bottom: 26px;
  }

  .lk-mitte img {
    max-height: 58vh;
  }

  .lk-knopf {
    padding: 0 14px;
    font-size: 14px;
  }
}
