/* ─── Archiv-Seite (/archive) ─────────────────────── */
/* Eigenständig, damit style.css und die anderen Seiten unberührt bleiben. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Schwarz auch auf html, damit beim Überscrollen (iOS) kein Weiß durchblitzt */
html {
  font-size: clamp(16px, 1.4vw, 22px);
  background: #000000;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'STIX Two Math', Georgia, serif;
  font-weight: 400;
  line-height: 1.6;
  color: #ffffff;
  background: #000000;
  overflow-x: hidden;
}

/* ─── Logo oben mittig (wie auf der RSVP-Seite, invertiert für Schwarz) ── */
.archive-head {
  padding: calc(max(14px, env(safe-area-inset-top)) + 2.5rem)
           max(18px, env(safe-area-inset-right))
           2rem
           max(18px, env(safe-area-inset-left));
}

.archive-logo {
  display: block;
  height: clamp(5.5rem, 12vw, 8.5rem);
  width: auto;
  margin: 0 auto;
  filter: invert(1);
}

/* ─── Zurück-Button ganz unten mittig ────────────── */
.archive-foot {
  display: flex;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem
           max(18px, env(safe-area-inset-right))
           calc(max(18px, env(safe-area-inset-bottom)) + 2rem)
           max(18px, env(safe-area-inset-left));
}

/* Gleiche Form wie der Register-Button im RSVP-Formular, nur weißer Rahmen und weiße Schrift */
.archive-back {
  display: inline-block;
  max-width: 100%;
  padding: .45em 1.6em;
  border: 1px solid #ffffff;
  background: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
}

.archive-back:hover {
  background: rgba(255,255,255,.12);
}

.archive-back:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Raster: immer zwei Kacheln nebeneinander ───── */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.6vw, 24px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0
           max(18px, env(safe-area-inset-right))
           0
           max(18px, env(safe-area-inset-left));
}

.archive-tile {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: none;
  background: #111111;
  cursor: zoom-in;
  overflow: hidden;
}

.archive-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s ease;
}

.archive-tile:hover img { opacity: .82; }

.archive-tile:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.archive-message {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 max(18px, env(safe-area-inset-left));
  font-style: italic;
  text-align: center;
}

/* ─── Große Ansicht ──────────────────────────────── */
html.lb-open { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000000;
}

.lb[hidden] { display: none; }

.lb-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(max(14px, env(safe-area-inset-top)) + 5.5rem)
           calc(max(18px, env(safe-area-inset-right)) + 5.5rem)
           calc(max(18px, env(safe-area-inset-bottom)) + 3rem)
           calc(max(18px, env(safe-area-inset-left)) + 5.5rem);
}

.lb-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 72vh;
  min-height: 72dvh;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  max-height: 72dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lb-info {
  max-width: 54ch;
  margin: 1.8rem auto 0;
}

.lb-count {
  font-size: .9rem;
  opacity: .7;
  min-height: 1.6em;
}

.lb-title {
  font-size: 2rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  margin-top: .3em;
}

.lb-artist {
  font-size: 1.3rem;
  font-style: italic;
  margin-top: .2em;
}

/* pre-line erhält die Zeilenumbrüche aus der TXT-Datei */
.lb-text {
  margin-top: 1.4rem;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* Fester Bildrahmen: das Bild wird darin eingepasst, die Pfeile hängen am Rahmen
   und bleiben deshalb beim Durchklicken immer an derselben Stelle */
.lb-figure {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: min(100%, 80vh);
  width: min(100%, 80dvh);
  height: 72vh;
  height: 72dvh;
}

.lb-figure .lb-img {
  max-height: 100%;
}

.lb-single .lb-arrow { display: none; }

.lb-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: .3em .35em;
}

.lb-btn:hover { opacity: .7; }

.lb-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.lb-close {
  position: fixed;
  z-index: 1;
  top: calc(max(14px, env(safe-area-inset-top)) + 1rem);
  right: calc(max(18px, env(safe-area-inset-right)) + 1.4rem);
  font-size: 3.2rem;
  padding: .1em .25em;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.2rem;
  font-style: normal;
  padding: .15em .2em;
}

.lb-prev { right: 100%; margin-right: .4rem; }
.lb-next { left: 100%; margin-left: .4rem; }

/* Handy/Touch: keine Pfeile, Blättern per Wischen; Bild nutzt die volle Breite */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  .lb-arrow { display: none; }
  .lb-figure { width: 100%; }
  .lb-scroll {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
}

@media (max-width: 600px) {
  .lb-btn { font-size: 1.7rem; }
  .lb-close {
    font-size: 2.6rem;
    top: calc(max(14px, env(safe-area-inset-top)) + .4rem);
    right: calc(max(18px, env(safe-area-inset-right)) + .2rem);
  }
  .lb-scroll { padding-top: calc(max(14px, env(safe-area-inset-top)) + 4.8rem); }
  .lb-title { font-size: 1.6rem; }
}

/* Links im Objekttext */
.lb-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .15em;
}

.lb-text a:hover { opacity: .7; }

.lb-text a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
