:root {
  --bg: #f5f5f3; --fg: #18181b; --muted: #6b6b73; --card: #ffffff; --line: #e4e4e0;
  --accent: #2f6fdf; --accent-fg: #fff; --error: #c62828; --radius: 18px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --fg: #ededf0; --muted: #9a9aa3; --card: #1c1c1f; --line: #2c2c31; --accent: #7aa7ff; --accent-fg: #0b1020; --error: #ff8a80; --shadow: 0 8px 24px rgb(0 0 0 / .4); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
main { max-width: 1080px; margin: 0 auto; padding: 56px 16px 80px; }
a { color: var(--accent); }

.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.02em; margin: 0; }
.lead { color: var(--muted); margin: .25rem 0 2rem; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 28px; }
.tabs a { padding: 8px 18px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; transition: background .2s, color .2s; }
.tabs a[aria-selected="true"] { background: var(--fg); color: var(--bg); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid--albums { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.tile { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease; }
.tile:hover { transform: translateY(-3px); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile--service { padding: 20px; border: 1px solid var(--line); box-shadow: none; }
.tile-title { font-weight: 650; letter-spacing: -.01em; }
.tile-text { color: var(--muted); font-size: .9rem; }

.tile--album { position: relative; aspect-ratio: 4 / 5; }
.tile--album img, .tile-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tile-placeholder { background: linear-gradient(135deg, var(--accent), #8e5bd9); }
.tile--album:hover img { transform: scale(1.04); }
.tile-caption { position: absolute; inset: auto 0 0 0; padding: 60px 18px 16px; display: flex; flex-direction: column; color: #fff; background: linear-gradient(to top, rgb(0 0 0 / .75), rgb(0 0 0 / 0)); }
.tile--album .tile-title { font-size: 1.15rem; }
.tile--album .tile-text { color: rgb(255 255 255 / .8); }
/* Ordner: zwei angedeutete Karten dahinter */
.tile--ordner { overflow: visible; margin-top: 14px; }
.tile--ordner img, .tile--ordner .tile-placeholder, .tile--ordner .tile-caption { border-radius: var(--radius); }
.tile--ordner::before, .tile--ordner::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: color-mix(in srgb, var(--fg) 30%, var(--bg)); box-shadow: var(--shadow); transform-origin: 50% 0; transition: transform .25s ease; }
.tile--ordner::before { transform: translateY(-14px) scale(.88); opacity: .35; }
.tile--ordner::after { transform: translateY(-7px) scale(.94); opacity: .6; }
.tile--ordner:hover::before { transform: translateY(-18px) scale(.88); }
.tile--ordner:hover img { transform: none; }
.tile--ordner > * { z-index: 1; }

.ordner-kopf { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.ordner-kopf h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.zurueck { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.zurueck:hover { color: var(--fg); }
.leer { color: var(--muted); }

dialog { border: 0; padding: 0; border-radius: 22px; width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 24px); background: var(--card); color: var(--fg); box-shadow: 0 24px 80px rgb(0 0 0 / .35); overflow: auto; }
dialog::backdrop { background: rgb(0 0 0 / .55); backdrop-filter: blur(8px); }
#passwort-form { display: grid; }
/* Das ganze Foto ohne Beschnitt, der Rest der Fläche wird mit einer unscharfen Kopie gefüllt. */
.dialog-media { position: relative; overflow: hidden; background: #111; height: min(58dvh, 520px); }
.dialog-media[hidden] { display: none; }
.dialog-media::before { content: ""; position: absolute; inset: -40px; background: var(--bild) center / cover; filter: blur(32px) brightness(.65); }
.dialog-media img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
dialog:has(.dialog-media:not([hidden])) { width: min(1000px, calc(100% - 24px)); }
@media (min-width: 760px) {
  #passwort-form:has(.dialog-media:not([hidden])) { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
  .dialog-media { height: min(80dvh, 680px); }
  .dialog-body { align-self: center; padding: 36px 32px; }
}
.dialog-body { padding: 20px 22px 22px; }
.dialog-body h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.dialog-hint { color: var(--muted); margin: 4px 0 16px; font-size: .95rem; }
dialog input { width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
dialog input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.dialog-error { color: var(--error); font-size: .9rem; margin: 8px 0 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.btn--ghost { background: transparent; color: var(--muted); }

.redirect { text-align: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Galerie eines Albums */
.galerie-info { color: var(--muted); margin: 0; font-size: .95rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.galerie-info a { font-weight: 600; }
.fotos { --zeile: 200px; display: flex; flex-wrap: wrap; gap: 4px; }
.fotos[data-groesse="klein"] { --zeile: 130px; }
.fotos[data-groesse="gross"] { --zeile: 340px; }
@media (max-width: 600px) {
  .fotos { --zeile: 110px; gap: 3px; }
  .fotos[data-groesse="klein"] { --zeile: 70px; }
  .fotos[data-groesse="gross"] { --zeile: 200px; }
}
/* Jede Kachel wächst im Verhältnis ihres Seitenverhältnisses, so wird jede Zeile genau voll und kein Foto
   beschnitten. Das unsichtbare Element am Ende fängt den Rest der letzten Zeile auf. */
.fotos::after { content: ""; flex-grow: 1000000; }
.foto { position: relative; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--zeile)); aspect-ratio: var(--r); overflow: hidden; border-radius: 4px; background: var(--line); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.foto:hover img { transform: scale(1.03); }
.foto:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.foto--video::after { content: "▶"; position: absolute; right: 8px; bottom: 6px; color: #fff; font-size: .9rem; text-shadow: 0 1px 4px rgb(0 0 0 / .7); }
/* Ein einzelnes Hochformat in einer Zeile soll nicht riesig werden; lieber bleibt rechts etwas frei. */
.foto { max-width: calc(var(--r) * var(--zeile) * 1.8); }

.groessen { display: inline-flex; flex: none; gap: 2px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; width: fit-content; }
.groessen button { font: inherit; font-size: .85rem; font-weight: 600; padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.groessen button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.fuss { margin-top: 48px; text-align: center; color: var(--muted); font-size: .85rem; }

/* Großansicht */
#lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; background: rgb(0 0 0 / .94); color: #fff; overflow: hidden; touch-action: pan-y; }
#lightbox::backdrop { background: #000; }
#lb-bild { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: calc(100% - 56px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-knopf { position: absolute; border: 0; background: rgb(255 255 255 / .12); color: #fff; font: 600 1.6rem/1 system-ui, sans-serif; width: 48px; height: 48px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.lb-knopf:hover { background: rgb(255 255 255 / .25); }
.lb-zu { top: 14px; right: 14px; font-size: 1.1rem; }
.lb-zurueck, .lb-weiter { top: 50%; translate: 0 -50%; }
.lb-zurueck { left: 14px; }
.lb-weiter { right: 14px; }
.lb-leiste { position: absolute; inset: auto 0 0 0; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: rgb(255 255 255 / .8); font-size: .95rem; }
.lb-leiste a { color: #fff; font-weight: 600; }
@media (max-width: 600px) { .lb-zurueck, .lb-weiter { display: none; } }

/* Auswahl zum Herunterladen */
.link-knopf { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.galerie--auswahl #galerie-alle, .galerie--auswahl #auswahl-start { display: none; }
.galerie--auswahl .foto img { transition: transform .2s ease; }
.galerie--auswahl .foto:hover img { transform: none; }
.galerie--auswahl .foto::before { content: ""; position: absolute; z-index: 1; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 999px; border: 2px solid #fff; background: rgb(0 0 0 / .25); box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.galerie--auswahl .foto--gewaehlt::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font: 700 .85rem/1 system-ui, sans-serif; }
.galerie--auswahl .foto--gewaehlt img { transform: scale(.9); border-radius: 8px; }
.galerie--auswahl .foto--gewaehlt { outline: 3px solid var(--accent); outline-offset: -3px; }
.auswahl-leiste { position: sticky; bottom: 16px; z-index: 2; margin: 20px auto 0; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--card); box-shadow: 0 8px 32px rgb(0 0 0 / .25); border: 1px solid var(--line); }
.auswahl-leiste .btn { text-decoration: none; }
.btn--aus { opacity: .45; pointer-events: none; }
#auswahl-zahl { font-weight: 600; white-space: nowrap; }
#auswahl-ende { padding: 10px 12px; }
@media (max-width: 480px) { .auswahl-leiste { gap: 4px; padding: 6px 6px 6px 16px; } }

/* Die Galerie nutzt die ganze Fensterbreite (bis 1800px), nicht nur die 1080px der übrigen Seite. */
.galerie { --breite: min(1800px, 100vw - 32px); width: var(--breite); margin-inline: calc((100% - var(--breite)) / 2); }
/* Die Leiste mit Anzahl, Download, Auswahl und Größe läuft beim Scrollen oben mit. */
.galerie-leiste { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; padding: 10px 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.galerie .ordner-kopf { margin-bottom: 6px; }
