/* ═══════════════════════════════════════════════════════════
   Foto-Website · Design "Warmes Album"
   Nach dem Claude-Design-Entwurf: erdige Brauntöne, Terrakotta-
   Akzent, Newsreader-Serifen – die Fotos bleiben die Stars.
   ═══════════════════════════════════════════════════════════ */

/* ---------- Schriften (lokal, keine externen Anfragen) ---------- */
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/newsreader-italic.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('fonts/public-sans.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Grundlagen ---------- */
:root {
  --bg: #14110d;
  --bg-deep: #0b0a08;
  --bg-raised: #201c17;
  --bg-card: #1e1a16;
  --bg-card-hover: #262019;
  --bg-thumb: #221d18;
  --text: #f0ebe2;
  --text-bright: #f6f1e8;
  --text-dim: #a89e8f;
  --text-dim2: #9a9184;
  --text-faint: #8a8175;
  --accent: #e08a5f;
  --accent-bright: #f0a077;
  --accent-fill: #d17a52;
  --accent-fill-text: #1a120c;
  --accent-soft: rgba(224, 138, 95, .2);
  --line: rgba(240, 235, 226, .09);
  --line-mid: rgba(240, 235, 226, .14);
  --line-strong: rgba(240, 235, 226, .16);
  --danger: #e06c5f;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Public Sans', -apple-system, system-ui, sans-serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-card: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-tile: 0 4px 14px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
button {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }
::selection { background: #4a3a2e; color: #fff; }

.view { animation: view-in .4s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   Login & Einrichtung
   ═══════════════════════════════════════════ */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.gate::before, .gate::after {
  content: '';
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .13;
  z-index: 0;
  pointer-events: none;
}
.gate::before {
  background: radial-gradient(circle, #e08a5f, transparent 60%);
  top: -30vmax; left: -20vmax;
  animation: drift-a 26s ease-in-out infinite alternate;
}
.gate::after {
  background: radial-gradient(circle, #7a5c3e, transparent 60%);
  bottom: -35vmax; right: -25vmax;
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(12vmax, 8vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-10vmax, -6vmax) scale(1.1); } }

.gate-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  text-align: center;
  animation: gate-in .8s var(--ease-out) both;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(18px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
.gate-emblem {
  font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.gate h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 7vw, 52px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--text-bright);
  margin-bottom: 10px;
}
.gate .sub {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 38px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}
.gate form { display: grid; gap: 14px; }
.gate .field { position: relative; }
.gate input[type="password"], .gate input[type="text"] {
  width: 100%;
  padding: 14px 48px 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-mid);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.gate input::placeholder { color: var(--text-faint); }
.gate input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gate .peek {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  padding: 10px; border-radius: 999px;
  color: var(--text-faint);
  transition: color .2s;
}
.gate .peek:hover { color: var(--text-dim); }
.btn-primary {
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--accent-fill-text);
  font-weight: 600;
  font-size: 15px;
  transition: background .2s, transform .25s var(--ease-spring), box-shadow .25s, opacity .2s;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0,0,0,.4); }
.btn-primary:active { transform: translateY(0) scale(.985); }
.btn-primary[disabled] { opacity: .55; cursor: default; transform: none; }
.gate .error {
  color: var(--danger);
  font-size: 14px;
  min-height: 21px;
  animation: shake .4s ease;
}
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.gate .hint { color: var(--text-faint); font-size: 13px; margin-top: 26px; line-height: 1.6; }

/* ═══════════════════════════════════════════
   Kopfzeile mit Suche
   ═══════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(20, 17, 13, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px max(24px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 20px;
}
.topbar .brand {
  cursor: pointer;
  display: flex; align-items: baseline; gap: 10px;
  flex-shrink: 0;
  color: var(--text-bright);
  text-decoration: none;
}
.topbar .brand:hover { color: var(--text-bright); }
.topbar .brand .name {
  font-family: var(--serif);
  font-size: 24px; font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
}
.topbar .brand .kicker {
  font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}
.topbar .spacer { flex: 1; }
.searchbox {
  position: relative;
  width: 300px; max-width: 42vw;
}
.searchbox svg {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: var(--bg-raised);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.searchbox input::placeholder { color: var(--text-faint); }
.searchbox input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.searchbox .clear {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  padding: 7px; border-radius: 999px;
  color: var(--text-faint);
  display: none;
}
.searchbox .clear:hover { color: var(--text); }
.searchbox.has-value .clear { display: inline-flex; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: background .2s, color .2s, transform .2s var(--ease-spring);
}
.iconbtn:hover { background: rgba(240,235,226,.07); color: var(--text); }
.iconbtn:active { transform: scale(.92); }
.iconbtn svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .topbar .brand .name { font-size: 20px; }
  .topbar .inner { gap: 12px; padding-left: 18px; padding-right: 18px; }
}

/* ═══════════════════════════════════════════
   Startseite
   ═══════════════════════════════════════════ */
.shell { max-width: 1240px; margin: 0 auto; padding: 0 24px 96px; }
@media (max-width: 640px) { .shell { padding: 0 18px 72px; } }

.hero {
  padding: 48px 0 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 36px;
}
.hero .intro { max-width: 640px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--text-bright);
  margin-bottom: 14px;
}
.hero p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 460px;
}

/* Tab-Umschalter Alben/Orte */
.tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-raised);
  border-radius: 999px;
  gap: 2px;
  border: 1px solid var(--line);
}
.tabs button {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  color: var(--text-dim2);
  transition: background .2s, color .2s;
}
.tabs button.active { background: #33291f; color: var(--text-bright); }

/* Filter-Chips (Jahre) */
.chip-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 30px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-mid);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 500;
  transition: all .2s var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.chip:active { transform: scale(.97); }
.chip.active {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-fill-text);
  font-weight: 600;
}
.chip svg { width: 15px; height: 15px; }

/* Alben-Raster */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px 26px;
}
@media (max-width: 640px) {
  .album-grid { grid-template-columns: 1fr; gap: 26px; }
}
.album-card {
  cursor: pointer;
  text-align: left;
  opacity: 0;
  transform: translateY(22px);
}
.album-card.revealed {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.album-card .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-thumb);
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-card);
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
.album-card.revealed:hover .thumb {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.album-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease, transform .6s var(--ease-out);
}
.album-card .thumb img.loaded { opacity: 1; }
.album-card:hover .thumb img { transform: scale(1.05); }
.album-card .thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 7, 4, .55));
  pointer-events: none;
}
.album-card .thumb .badge {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 6px;
  color: #fff;
  font-size: 12.5px; font-weight: 500;
}
.album-card .thumb .badge svg { width: 13px; height: 13px; }
.album-card .meta { padding: 12px 2px 0; }
.album-card .meta h3 {
  font-family: var(--serif);
  font-size: 20px; font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--text-bright);
}
.album-card .meta .sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-dim2);
  display: flex; align-items: center; gap: 7px;
}
.album-card .meta .sub .sep { opacity: .5; }

/* Orte-Tab */
.places {
  max-width: 560px;
  display: flex; flex-direction: column; gap: 10px;
}
.places h2 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.place-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
  text-align: left;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.place-row:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.place-row .name {
  display: flex; align-items: center; gap: 11px;
  font-size: 15px; font-weight: 500;
}
.place-row .name svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.place-row .count { font-size: 13px; color: var(--text-dim2); }

.empty-state {
  padding: 90px 20px;
  text-align: center;
  color: var(--text-dim2);
}
.empty-state .art { font-size: 40px; margin-bottom: 16px; }
.empty-state h2 {
  font-family: var(--serif);
  font-weight: 500; font-size: 24px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.empty-state code {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 7px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   Album-Ansicht
   ═══════════════════════════════════════════ */
.album-main { padding-top: 30px; }
.backlink {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-dim);
  font-size: 14px; font-weight: 500;
  padding: 6px 0;
  margin-bottom: 22px;
  transition: color .2s, gap .25s var(--ease-out);
}
.backlink:hover { color: var(--text); gap: 10px; }
.backlink svg { width: 17px; height: 17px; }

.album-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 30px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.album-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--text-bright);
  margin-bottom: 10px;
}
.album-head .meta-line {
  font-size: 14.5px;
  color: var(--text-dim2);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.album-head .meta-line .sep { opacity: .5; }
.album-head .meta-line .place {
  display: inline-flex; align-items: center; gap: 5px;
}
.album-head .meta-line .place svg { width: 14px; height: 14px; color: var(--accent); }
.album-head .desc {
  margin-top: 12px;
  color: var(--text-dim);
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.65;
}
.album-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-card);
  font-size: 14px; font-weight: 500;
  color: var(--text);
  transition: border-color .2s, color .2s, transform .2s var(--ease-out);
}
.pill-btn:hover { border-color: var(--accent); color: var(--accent-bright); }
.pill-btn:active { transform: scale(.97); }
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn.active {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-fill-text);
  font-weight: 600;
}

/* Foto-Raster (quadratische Kacheln) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
@media (max-width: 640px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  background-color: var(--bg-thumb);
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-tile);
  isolation: isolate;
  opacity: 0;
  transform: translateY(18px) scale(.99);
}
.tile.revealed {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .45s ease, transform .6s var(--ease-out);
}
.tile img.loaded { opacity: 1; }
.tile:hover img { transform: scale(1.05); }
.tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.32), transparent 40%);
  opacity: 0;
  transition: opacity .3s;
  z-index: 1;
  pointer-events: none;
}
.tile:hover::after { opacity: 1; }

.tile .badge {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(10, 7, 4, .6);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  pointer-events: none;
}
.tile .badge svg { width: 12px; height: 12px; }

.tile .fav {
  position: absolute; left: 8px; top: 8px; z-index: 3;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: #fff;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .25s, transform .3s var(--ease-spring);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
.tile:hover .fav, .tile .fav.on { opacity: 1; transform: scale(1); }
@media (hover: none) { .tile .fav { opacity: 1; transform: scale(1); } }
.tile .fav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; transition: all .2s; }
.tile .fav.on svg { fill: #ff5b77; stroke: #ff5b77; }
.tile .fav:hover svg { transform: scale(1.12); }
.tile .fav .n {
  position: absolute; bottom: 1px; right: 1px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(10,7,4,.65);
  border-radius: 99px;
  padding: 0 5px;
  line-height: 15px;
}
@keyframes heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.45); }
  60% { transform: scale(.9); }
  100% { transform: scale(1); }
}
.fav.popping svg { animation: heart-pop .5s var(--ease-spring); }

/* ═══════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 8, 5, 0);
  display: flex; flex-direction: column;
  opacity: 0;
  transition: background .3s ease, opacity .3s ease;
  touch-action: none;
}
.lightbox.open { background: rgb(10, 8, 5); opacity: 1; }
/* Wichtig: hidden-Attribut muss gegen das display:flex gewinnen,
   sonst blockiert die unsichtbare Lightbox alle Klicks auf der Seite */
.lightbox[hidden] { display: none !important; }
.lightbox .stage {
  position: absolute; inset: 0;
  overflow: hidden;
}
.lb-item {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 74px 16px 20px;
  will-change: transform, opacity;
}
.lb-item img, .lb-item video {
  /* Bewusst Viewport-Einheiten statt Prozente: prozentuale max-Höhen in
     Grid-Zellen werden von Safari nicht zuverlässig aufgelöst und das
     Foto liefe sonst über den Bildschirm hinaus (nur Ausschnitt sichtbar) */
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 94px);
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  user-select: none;
  -webkit-user-drag: none;
}
.lb-item.zoomable img { cursor: zoom-in; }
.lb-item.zoomed { padding: 0; }
.lb-item.zoomed img { cursor: grab; border-radius: 0; max-width: 100vw; max-height: 100dvh; }

.lb-item.enter-right { animation: lb-in-r .38s var(--ease-out) both; }
.lb-item.enter-left  { animation: lb-in-l .38s var(--ease-out) both; }
.lb-item.exit-right  { animation: lb-out-r .28s ease both; }
.lb-item.exit-left   { animation: lb-out-l .28s ease both; }
@keyframes lb-in-r { from { opacity: 0; transform: translateX(56px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lb-in-l { from { opacity: 0; transform: translateX(-56px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lb-out-r { to { opacity: 0; transform: translateX(48px) scale(.99); } }
@keyframes lb-out-l { to { opacity: 0; transform: translateX(-48px) scale(.99); } }

/* Kopfzeile der Lightbox */
.lb-chrome {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(8, 6, 4, .7), transparent);
  color: var(--text-bright);
  transition: opacity .3s, transform .3s var(--ease-out);
}
.lightbox.chrome-hidden .lb-chrome { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.lb-info { min-width: 0; }
.lb-info .title {
  font-family: var(--serif);
  font-size: 18px; font-weight: 500;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-info .sub {
  font-size: 12.5px;
  color: #b7ad9d;
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-buttons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 40px; height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(244, 240, 232, .25);
  border-radius: 999px;
  color: #f4f0e8;
  font-size: 13.5px; font-weight: 500;
  transition: background .2s, transform .2s var(--ease-spring);
}
.lb-btn.icon-only { padding: 0; width: 40px; }
.lb-btn:hover { background: rgba(244, 240, 232, .12); }
.lb-btn:active { transform: scale(.93); }
.lb-btn svg { width: 16px; height: 16px; flex: none; }
.lb-btn.fav-on svg { fill: #ff5b77; stroke: #ff5b77; }
.lb-btn .count { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lb-btn .label { display: none; }
  .lb-btn { padding: 0; width: 40px; }
}

.lb-arrow {
  position: absolute; top: 50%; z-index: 4;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid rgba(244, 240, 232, .2);
  border-radius: 999px;
  background: rgba(20, 16, 11, .4);
  color: #f4f0e8;
  transition: background .2s, opacity .3s;
}
.lb-arrow:hover { background: rgba(20, 16, 11, .78); }
.lb-arrow.prev { left: max(16px, env(safe-area-inset-left)); }
.lb-arrow.next { right: max(16px, env(safe-area-inset-right)); }
.lb-arrow svg { width: 22px; height: 22px; }
.lightbox.chrome-hidden .lb-arrow { opacity: 0; pointer-events: none; }
@media (hover: none) { .lb-arrow { display: none; } }

/* ═══════════════════════════════════════════
   Diashow
   ═══════════════════════════════════════════ */
.slideshow {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
  cursor: none;
}
.slideshow.show-ui { cursor: default; }
.ss-slide {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.ss-slide.visible { opacity: 1; }
.ss-slide img { width: 100%; height: 100%; object-fit: contain; }
.ss-slide.kb-a img { animation: kenburns-a 9s ease-out both; }
.ss-slide.kb-b img { animation: kenburns-b 9s ease-out both; }
@keyframes kenburns-a { from { transform: scale(1); } to { transform: scale(1.07) translate(.6%, -.5%); } }
@keyframes kenburns-b { from { transform: scale(1.07) translate(-.6%, .4%); } to { transform: scale(1); } }
.ss-slide video { width: 100%; height: 100%; object-fit: contain; }

.ss-ui {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 16px max(20px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.slideshow.show-ui .ss-ui { opacity: 1; }
.ss-ui .lb-counter {
  font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,.85);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  padding: 0 8px;
}
.ss-progress {
  position: absolute; top: 0; left: 0; height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 6;
  transition: width .2s linear;
}

/* ═══════════════════════════════════════════
   Dialoge & Meldungen
   ═══════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8, 6, 4, .6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 22px;
  animation: fade-in .25s ease both;
}
@keyframes fade-in { from { opacity: 0; } }
.dialog {
  width: 100%; max-width: 380px;
  background: var(--bg-raised);
  border: 1px solid var(--line-mid);
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: var(--shadow-lg);
  animation: dialog-in .45s var(--ease-spring) both;
  text-align: center;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.dialog .icon { font-size: 34px; margin-bottom: 14px; }
.dialog h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.dialog p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 22px; }
.dialog input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-mid);
  background: var(--bg-card);
  outline: none;
  margin-bottom: 14px;
  text-align: center;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dialog .row { display: flex; gap: 10px; }
.dialog .row > * { flex: 1; }
.btn-ghost {
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-mid);
  color: var(--text-dim);
  font-weight: 500;
  transition: all .2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.toast {
  position: fixed; bottom: 26px; left: 50%; z-index: 400;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-raised);
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .3s, transform .35s var(--ease-spring);
  pointer-events: none;
  max-width: calc(100vw - 40px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loader { min-height: 60dvh; display: grid; place-items: center; }
.loader .ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--line-mid);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
