/* ============================================================
   Jazz im Hof — Design System
   Farbwelt und Typografie leiten sich vom bestehenden Logo ab:
   warmer Rot→Indigo-Verlauf mit Filmkorn, cremefarbene Serife.
   Nur System-Schriften -> keine externen Requests, kein Cookie-
   Banner nötig, schnelle Ladezeit.
   ============================================================ */

:root {
  /* Markenfarben (aus dem Logo abgeleitet) */
  --red: #b23a28;
  --red-deep: #7f2420;
  --indigo: #35316e;
  --indigo-deep: #1c1a3d;
  --cream: #f4e9d6;
  --cream-dim: #d9c9ab;
  --gold: #dba043;
  --gold-soft: #e8bd70;

  /* Oberflächen */
  --ink: #14111d;
  --ink-soft: #1d1930;
  --ink-card: #221d38;
  --line: rgba(244, 233, 214, 0.12);

  /* Typografie */
  --font-display: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1180px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--cream);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
}
p { margin: 0 0 1em; color: var(--cream-dim); }
ul { padding-left: 1.2em; }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--ink); padding: 12px 20px;
  z-index: 200; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Grain / gradient (Logo-Bildsprache) ---------- */
.brand-gradient {
  background: linear-gradient(135deg, var(--red) 0%, var(--indigo) 100%);
  position: relative;
}
.brand-gradient::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 17, 29, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.brand img { height: 40px; width: auto; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  font-size: 0.95rem; letter-spacing: 0.02em; color: var(--cream-dim);
  padding: 8px 2px; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-soft); border-color: var(--gold); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--cream);
  width: 44px; height: 44px; border-radius: 8px; font-size: 1.3rem; cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .nav {
    /* top/right/left als feste Länge statt "inset" mit bottom:0 — backdrop-filter
       auf .site-header erzeugt einen eigenen Containing Block, wodurch bottom:0
       sich auf die winzige Header-Box statt den Viewport bezog (Höhe kollabierte
       auf ~24px, Panel blieb dadurch de facto unsichtbar/transparent). */
    position: fixed; top: 76px; right: 0; left: 0; height: calc(100vh - 76px);
    background: var(--ink); overflow-y: auto; box-shadow: 0 16px 32px rgba(0,0,0,0.45);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 12px 24px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s; border-top: 1px solid var(--line);
  }
  .nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 88px;
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; color: var(--gold-soft); border: 1px solid rgba(244,233,214,0.35);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  max-width: 14ch;
  margin-bottom: 0.3em;
}
.hero .lead { font-size: 1.2rem; color: var(--cream); opacity: 0.9; max-width: 46ch; }
.hero .meta {
  display: flex; flex-wrap: wrap; gap: 28px; margin: 2rem 0;
  font-family: var(--font-display); font-size: 1.15rem;
}
.hero .meta div span { display: block; font-family: var(--font-body); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--cream-dim); margin-bottom: 4px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Türmotiv, dem Logo nachempfunden, als dekoratives SVG */
.hero-door {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  width: 360px; opacity: 0.35; z-index: 0; pointer-events: none;
}
@media (max-width: 900px) { .hero-door { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: var(--ink-deep, #1c1a3d); }
.btn-primary:hover { background: var(--gold-soft); }
.btn-outline { border-color: rgba(244,233,214,0.4); color: var(--cream); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--ink-soft); }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head .eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: 0.78rem; font-weight: 700; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-top: 0.6em; }

/* Info-Karten */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--ink-card); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(219,160,67,0.5); transform: translateY(-4px); }
.card h3 { font-size: 1.25rem; }
.card .icon { width: 42px; height: 42px; margin-bottom: 16px; display: block; color: var(--gold); }

/* Jahres-Karten (Archiv / Galerie) */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.year-card {
  position: relative; border-radius: 16px; overflow: hidden; min-height: 160px;
  display: flex; align-items: flex-end; padding: 22px;
  background: linear-gradient(135deg, var(--red) 0%, var(--indigo) 100%);
  border: 1px solid var(--line);
}
.year-card::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.3'/></svg>");
  mix-blend-mode: overlay; opacity: 0.5;
}
.year-card span { position: relative; z-index: 1; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.year-card small { position: relative; z-index: 1; display: block; color: var(--cream-dim); font-family: var(--font-body); margin-top: 4px; }
.year-card.is-disabled { opacity: 0.45; filter: grayscale(0.6); pointer-events: none; }
.year-card .badge {
  position: absolute; top: 14px; right: 14px; z-index: 1;
  background: rgba(20,17,29,0.55); border: 1px solid rgba(244,233,214,0.3);
  font-size: 0.7rem; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .08em;
}

/* Programm / Lineup */
.lineup-item {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 28px 0; border-top: 1px solid var(--line);
}
.lineup-item:first-of-type { border-top: none; }
.lineup-time { font-family: var(--font-display); font-size: 1.4rem; color: var(--gold-soft); }
.lineup-item h3 { margin-bottom: 0.2em; }
.lineup-region { color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .08em; }
.lineup-credit { font-size: 0.8rem; color: var(--cream-dim); font-style: italic; margin-bottom: 0.6em; }
.lineup-photo {
  width: 100%; max-width: 320px; border-radius: 12px; margin: 12px 0 16px;
  border: 1px solid var(--line); object-fit: cover; aspect-ratio: 4/3;
}
.lineup-members { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding: 0; list-style: none; }
.lineup-members li { font-size: 0.85rem; color: var(--cream-dim); }
.lineup-members li b { color: var(--cream); font-weight: 600; }
@media (max-width: 640px) { .lineup-item { grid-template-columns: 1fr; gap: 6px; } }

/* Geschichte-Fotoraster (Über uns) */
.history-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px;
  margin: 1.5rem 0;
}
.history-grid .gallery-item {
  width: 100%; aspect-ratio: 1/1; border-radius: 8px; border: 1px solid var(--line);
}

/* Anreise-Karte */
.map-card {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background: var(--ink-card); aspect-ratio: 16/8; max-height: 420px;
}
.map-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px;
  padding: 24px; color: var(--gold-soft);
  background: linear-gradient(135deg, var(--red) 0%, var(--indigo) 100%);
}
.map-placeholder p { color: var(--cream); margin: 0; }
.map-placeholder .small { color: rgba(244,233,214,0.75); max-width: 40ch; }
.map-card iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Foto-Galerie */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.gallery-item {
  position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3;
  border: 1px solid var(--line); cursor: pointer; background: var(--ink-card);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red) 0%, var(--indigo) 100%);
  color: rgba(244,233,214,0.75); font-size: 0.85rem; text-align: center; padding: 12px;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 8, 16, 0.92); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 12px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 97vh; max-width: 98vw; width: auto; height: auto; border-radius: 6px; object-fit: contain; }
@media (max-width: 640px) {
  .lightbox { padding: 4px; }
  .lightbox img { max-height: 92vh; max-width: 100vw; }
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px; background: none; border: 1px solid var(--line);
  color: var(--cream); width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
}
.lightbox-caption {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: rgba(20, 17, 29, 0.7); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 16px; margin: 0; color: var(--cream-dim); font-size: 0.85rem; font-style: italic;
  max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lightbox-caption:empty { display: none; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(20, 17, 29, 0.55); border: 1px solid var(--line);
  color: var(--cream); width: 52px; height: 52px; border-radius: 50%;
  font-size: 1.4rem; cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.lightbox-nav:hover { border-color: var(--gold); color: var(--gold-soft); background: rgba(20, 17, 29, 0.8); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
@media (max-width: 640px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.1rem; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* Formular-Elemente / Kontakt-Liste */
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 6px 0; color: var(--cream-dim); }
.contact-list a:hover { color: var(--gold-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep, #0f0d17); border-top: 1px solid var(--line); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-grid h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 1em; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--cream-dim); }
.footer-links a:hover { color: var(--gold-soft); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--cream-dim);
}
.social-icons { display: flex; gap: 14px; }
.social-icons a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; transition: border-color .2s, color .2s;
}
.social-icons a:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Legal pages (Impressum / Datenschutz) ---------- */
.legal h2 { margin-top: 2em; font-size: 1.4rem; }
.legal h3 { margin-top: 1.4em; font-size: 1.1rem; color: var(--gold-soft); }
.legal p, .legal li { color: var(--cream-dim); }
.legal table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: 0.85rem; color: var(--cream-dim); }
.divider { height: 1px; background: var(--line); margin: 48px 0; border: none; }

/* ============================================================
   Elegante, robuste Animationen
   CSS-getrieben (nicht JS-Ticker-abhängig) und mit sicherem
   Standard "sichtbar" — Inhalte können nie dauerhaft unsichtbar
   hängen bleiben, falls JS blockiert/langsam ist. Respektiert
   prefers-reduced-motion (siehe Media Query weiter unten).
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero .eyebrow,
.hero h1,
.hero .lead,
.hero .meta,
.hero-actions {
  opacity: 1;
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero .eyebrow { animation-delay: 0ms; }
.hero h1 { animation-delay: 90ms; }
.hero .lead { animation-delay: 180ms; }
.hero .meta { animation-delay: 270ms; }
.hero-actions { animation-delay: 360ms; }

.card,
.year-card,
.lineup-item {
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.card[data-revealed="false"],
.year-card[data-revealed="false"],
.lineup-item[data-revealed="false"] {
  opacity: 0;
  transform: translateY(20px);
}

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero .lead, .hero .meta, .hero-actions {
    animation: none;
  }
  .card[data-revealed="false"],
  .year-card[data-revealed="false"],
  .lineup-item[data-revealed="false"] {
    opacity: 1;
    transform: none;
  }
}
