/* ==========================================================================
   Mahnwachen-Galerie — Design-Tokens
   ========================================================================== */
:root {
  --bg: #0b0a09;
  --bg-alt: #131110;
  --surface: #1b1815;
  --surface-hi: #24201c;
  --ink: #f5efe6;
  --muted: #a89e92;
  --muted-dim: #706859;
  --ember: #d7263d;
  --ember-dim: #8f1c2b;
  --flame: #f2994a;
  --line: rgba(245, 239, 230, 0.1);
  --line-strong: rgba(245, 239, 230, 0.2);

  --font-display: 'Oswald', 'Poppins', sans-serif;
  --font-body: 'Work Sans', 'Poppins', sans-serif;

  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 600;
}

/* Film-Grain-Overlay für Tiefe */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Parallax-Basis (wird von .hero und .statement genutzt)
   ========================================================================== */
.parallax-section {
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
}

.parallax-bg {
  position: absolute;
  top: -18%;
  left: 0;
  right: 0;
  height: 136%;
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
  will-change: transform;
  z-index: 0;
  transform: translateY(0);
}

@media (max-width: 700px) {
  /* Auf kleinen Screens weniger Überhang, damit die Ränder bei Bewegung
     nicht sichtbar werden. */
  .parallax-bg { top: -10%; height: 120%; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  width: 100%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.55) 0%, rgba(8, 7, 6, 0.4) 38%, rgba(8, 7, 6, 0.92) 94%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 15%, rgba(8, 7, 6, 0.15), transparent 55%);
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero__title {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.05;
  max-width: 16ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.hero__title span { color: var(--ember); }

.hero__sub {
  max-width: 46ch;
  margin: 1.5rem 0 2.25rem;
  color: var(--muted);
  font-size: 1.02rem;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__scroll {
  position: absolute;
  z-index: 2;
  bottom: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 46px;
  background: var(--line-strong);
  overflow: hidden;
}
.hero__scroll span {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ember);
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}
@media (prefers-reduced-motion: reduce) { .hero__scroll span { animation: none; top: 30%; } }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.95rem 1.8rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ember);
  color: #fff;
}
.btn--primary:hover { background: #c01f34; }
.btn--primary:disabled { background: var(--muted-dim); cursor: not-allowed; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ember); color: var(--ember); }

.btn--wide { width: 100%; }
.btn--small { padding: 0.55rem 1rem; font-size: 0.72rem; }

/* ==========================================================================
   Statement / Beschreibung
   ========================================================================== */
.statement {
  border-top: none;
  padding: 7rem 1.5rem;
}

.statement__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Löst sich oben aus dem Hero-Schwarz, gibt in der Mitte das Foto frei
     und blendet unten wieder sanft in die nächste Sektion über — dadurch
     wirkt der Wechsel zwischen den Bildern wie eine weiche Überblendung. */
  background:
    linear-gradient(
      180deg,
      var(--bg) 0%,
      rgba(8, 7, 6, 0.5) 16%,
      rgba(8, 7, 6, 0.62) 55%,
      rgba(8, 7, 6, 0.55) 80%,
      var(--bg) 100%
    );
}

.statement__inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.statement__inner .eyebrow { margin-bottom: 1rem; }
.statement__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 2.5rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.statement__body {
  text-align: left;
  color: var(--muted);
  font-size: 1.02rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}
.statement__body p { margin: 0; }

.statement__vow {
  margin: 2.75rem 0;
  padding: 2rem 1.5rem;
  background: rgba(8, 7, 6, 0.35);
  backdrop-filter: blur(2px);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.statement__vow p {
  margin: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.statement__closing {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}
.statement__closing span { color: var(--ember); }

@media (max-width: 600px) {
  .statement { padding: 4rem 1.25rem; }
  .statement__vow { padding: 1.75rem 1rem; }
}

/* ==========================================================================
   Intro / Ablauf
   ========================================================================== */
.intro {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.intro__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}
.intro__lead {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 2rem;
}
.intro__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.intro__num {
  display: block;
  font-family: var(--font-display);
  color: var(--ember);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}
.intro__step h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.intro__step p {
  color: var(--muted);
  font-size: 0.94rem;
  margin: 0;
}

@media (max-width: 780px) {
  .intro__steps { grid-template-columns: 1fr; gap: 2rem; }
}

/* ==========================================================================
   Galerie
   ========================================================================== */
.gallery-section {
  padding: 5rem 0 0;
}
.gallery-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding: 0 1.5rem 1.25rem;
}
.gallery-section__header h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.gallery-section__count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Randloses Masonry: echte Spalten statt starrem Grid, damit Fotos in
   ihrem natürlichen Seitenverhältnis stehen bleiben und dicht an dicht sitzen. */
.gallery-grid {
  column-count: 4;
  column-gap: 0;
  width: 100%;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}
.gallery-card:hover img { transform: scale(1.03); filter: brightness(0.85); }

.gallery-card__tag {
  position: absolute;
  bottom: 0.9rem;
  left: 0.9rem;
  right: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.gallery-card:hover .gallery-card__tag { opacity: 1; transform: translateY(0); }

.gallery-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1.5rem;
  margin: 0 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* Skeleton-Ladezustand */
.gallery-skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-hi) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  aspect-ratio: 4/5;
  break-inside: avoid;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 1000px) {
  .gallery-grid { column-count: 3; }
}
@media (max-width: 700px) {
  .gallery-grid { column-count: 2; }
}
@media (max-width: 420px) {
  .gallery-grid { column-count: 1; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 4, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__content {
  max-width: 900px;
  max-height: 88vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox__content img {
  max-height: 74vh;
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius);
}
.lightbox__caption {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
  max-width: 60ch;
}
.lightbox__caption strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}
.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}
.lightbox__close:hover { border-color: var(--ember); color: var(--ember); }

/* ==========================================================================
   Upload-Formular
   ========================================================================== */
.upload-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
}
.upload-section__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.upload-section__intro { text-align: center; margin-bottom: 2.5rem; }
.upload-section__intro h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.75rem; }
.upload-section__intro p { color: var(--muted); max-width: 46ch; margin: 0 auto; }

.upload-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  color: var(--muted);
}
.field .req { color: var(--ember); }
.field .optional { text-transform: none; letter-spacing: 0; color: var(--muted-dim); }

.field input[type="text"],
.field input[type="date"],
.field input[type="file"],
.field textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.85rem 1rem;
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ember);
}
.field textarea { resize: vertical; }
.field__hint { margin: 0; color: var(--muted-dim); font-size: 0.8rem; }

.field--honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.file-preview {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
}
.file-preview__thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.file-preview__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.form-message {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}
.form-message.is-success { color: #7fbf7f; }
.form-message.is-error { color: var(--ember); }

.form-error { color: var(--ember); font-size: 0.85rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  color: var(--muted-dim);
  font-size: 0.82rem;
}
.site-footer p { margin: 0.3rem 0; }
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer a:hover { color: var(--ember); }
.site-footer__meta { max-width: 56ch; margin: 0.8rem auto 0; }
.site-footer__privacy {
  max-width: 56ch;
  margin: 1.1rem auto 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted-dim);
}
.site-footer__privacy strong { color: var(--muted); }

/* ==========================================================================
   Fokus-Sichtbarkeit (Barrierefreiheit)
   ========================================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 2px;
}

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-page { background: var(--bg); color: var(--ink); font-family: var(--font-body); }
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-login__form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
.admin-login__hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.5rem; }
.admin-login__form input {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.85rem 1rem;
}

.admin-dashboard { max-width: 1200px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.admin-dashboard__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}
.admin-dashboard section { margin-bottom: 3rem; }
.admin-dashboard h2 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.admin-empty { color: var(--muted); }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.admin-card__body { padding: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.admin-card__body strong { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.admin-card__body span { color: var(--muted); font-size: 0.82rem; }
.admin-card__uploader { font-size: 0.76rem !important; color: var(--muted-dim) !important; word-break: break-word; }
.admin-card__uploader a { color: var(--muted-dim); text-decoration: underline; }
.admin-card__body p { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0; }
.admin-card__actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.admin-card__actions form { flex: 1; }
