/*
Theme Name: theoffline.events
Theme URI: https://theoffline.events
Author: K&V GmbH
Author URI: https://www.kulturundvergnuegen.de
Description: Theme für theoffline.events – frei verschiebbare, vertikale Postkarten mit Flip-Funktion, Glas-Overlays und redaktioneller Pflege über einen eigenen Postkarten-Beitragstyp. Marken-Blau #1900F7 und Neon-Limette als Akzente.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theoffline-events
*/

/* ============================================================
   DESIGN TOKENS
   Farbwelt vom RAR-Plakat, invertiert (Weiß als Hintergrund)
   ============================================================ */
:root {
  --ink:        #14103A;   /* fast schwarzes Ultramarin für Text */
  --blue:       #1900F7;   /* Marken-Blau */
  --blue-deep:  #1400C4;   /* dunkleres Blau für Hover */
  --lime:       #C4E82E;   /* Neon-Limette */
  --lime-ink:   #14103A;   /* Text auf Limette */
  --paper:      #F7F8F6;   /* Papier-Grundton (Textur liegt darüber) */
  --paper-warm: #FCFCF8;   /* glattes, leicht wärmeres Blatt für Karten/Overlays */
  --hair:       #14103A;   /* Trennlinien */
  --shadow:     rgba(20, 16, 58, 0.18);

  --font-display: 'Copystruct', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --bar-h: 104px;        /* Höhe der Pille (viel Padding fürs Logo) */
  --logo-h: 56px;        /* per Customizer überschreibbar */
  --pill-gap: 18px;      /* Abstand oben (schwebt) */
  --pill-inset: 20px;    /* Abstand links/rechts (fast volle Breite) */
  --pill-max: 2000px;    /* max. Breite der Pille (fast voll) */
  --pill-radius: 34px;   /* Rechteck mit stark abgerundeten Ecken */
  --header-h: calc(var(--bar-h) + var(--pill-gap) * 2);  /* Gesamthöhe inkl. Abstand */
}

/* ============================================================
   FONTS
   Copystruct: lokal (fonts/). Instrument Serif + Inter via Google.
   ============================================================ */
@font-face {
  font-family: 'Copystruct';
  src: url('fonts/copystruct.woff2') format('woff2'),
       url('fonts/copystruct.woff')  format('woff'),
       url('fonts/copystruct.ttf')   format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Copystruct';
  src: url('fonts/copystruct-bold.woff2') format('woff2'),
       url('fonts/copystruct-bold.woff')  format('woff'),
       url('fonts/copystruct-bold.ttf')   format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* UI-Kleinteile bleiben in Inter: nur der Kicker, die Karten-Buttons und
   der Stage-Hinweis. Nav, Footer, Overlays, Datum/Zeit/Ort/Preis laufen in
   Instrument Serif (Copystruct für Titel). */
.postcard__front-fallback .kicker,
.postcard__link,
.postcard__back-close,
.stage__hint,
.archive-card__meta {
  font-family: var(--font-ui);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;          /* Instrument Serif läuft schmaler → etwas größer */
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Papiertextur als fixe Vollbild-Ebene (iOS-sicher, statt background-attachment:fixed) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--paper);
  background-image: url('assets/img/paper.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Skip-Link für Tastaturnutzung */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lime);
  color: var(--lime-ink);
  padding: 10px 16px;
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
/* Header ist ein transparenter Träger; die eigentliche Pille schwebt darin */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--bar-h) + var(--pill-gap) * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pill-gap) var(--pill-inset) 0;
  pointer-events: none;   /* nur die Pille selbst ist klickbar */
  z-index: 1000;
}

/* Die Glas-Pille */
.site-header__pill {
  pointer-events: auto;
  width: 100%;
  max-width: var(--pill-max);
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 48px;
  border-radius: var(--pill-radius);
  position: relative;
  isolation: isolate;

  background:
    linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(230,234,255,0.12) 42%, rgba(255,255,255,0.22) 100%);
  backdrop-filter: saturate(190%) blur(30px) brightness(1.10);
  -webkit-backdrop-filter: saturate(190%) blur(30px) brightness(1.10);

  /* dicker Glasrand + Glanzkante + Tiefen-Schatten (wie Referenz 1) */
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow:
    0 1px 2px rgba(255,255,255,0.95) inset,          /* obere Glanzkante */
    0 -14px 30px rgba(255,255,255,0.4) inset,         /* innerer Lichtschein unten */
    0 0 0 1px rgba(20,16,58,0.05),                    /* feine Außenkontur */
    0 20px 55px rgba(20,16,58,0.18),                  /* Schlagschatten (schwebt) */
    0 4px 14px rgba(20,16,58,0.10);
}

/* zusätzliche obere Highlight-Linie für den „nassen" Glas-Look */
.site-header__pill::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 45%;
  border-radius: var(--pill-radius) var(--pill-radius) 40% 40% / var(--pill-radius) var(--pill-radius) 100% 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), rgba(255,255,255,0));
  pointer-events: none;
  z-index: -1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header__pill { background: rgba(250, 250, 248, 0.9); }
}

.site-header__logo { justify-self: center; display: flex; align-items: center; }
.site-header__logo img.custom-logo,
.site-header__logo .site-header__brand {
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.35));
}
.site-header__nav--left  { justify-self: start; }
.site-header__nav--right { justify-self: end; }

.site-header__brand {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 16px;
  white-space: nowrap;
}

/* Logo statt Schriftzug */
.site-header__brand--logo { display: flex; align-items: center; }
.site-header__brand--logo .custom-logo-link { display: block; line-height: 0; }
.site-header__brand--logo img.custom-logo {
  height: var(--logo-h);   /* im Customizer einstellbar */
  /* nie höher als die Leiste minus Luft, sonst schneidet es ab */
  max-height: calc(var(--bar-h) - 20px);
  width: auto;
  max-width: 320px;
  object-fit: contain;
  display: block;
}

.site-header__nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site-header__nav a,
.site-header__nav-btn,
.site-header__about {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  transition: color 0.15s ease;
  padding: 0;
  white-space: nowrap;
  /* kein Glühen – nur ein Hauch Kontrast, falls eine Karte durchscheint */
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.site-header__nav a:hover,
.site-header__nav-btn:hover,
.site-header__about:hover,
.site-header__nav a[aria-current="page"],
.site-header__about[aria-current="page"] { color: var(--blue); }

/* Mobiler Postkarte-Button (nur mobil sichtbar) */
.site-header__signup-mobile {
  display: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--blue);
  background: none;
  padding: 0;
}
.site-header__signup-mobile > span {
  position: relative;
  display: inline-block;
}
.site-header__signup-mobile > span::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
}

/* Mobil rechts: Infos + Burger nebeneinander (nur mobil sichtbar) */
.site-header__mobile-right {
  display: none;
  align-items: center;
  gap: 14px;
}
.site-header__infos-mobile {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: none;
  padding: 0;
}
.site-header__infos-mobile:hover { color: var(--blue); }

/* Punkt-/Burger-Menü-Button (nur mobil sichtbar) */
.site-header__menu-btn {
  display: none;
  width: 34px; height: 34px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.site-header__menu-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.site-header__menu-btn.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__menu-btn.is-active span:nth-child(2) { opacity: 0; }
.site-header__menu-btn.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobiles Menü-Panel (Glas), klappt unter der Pille auf */
.mobile-menu {
  position: fixed;
  top: calc(var(--header-h) - var(--pill-gap) + 6px);
  right: var(--pill-inset);
  z-index: 1500;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.32) 100%);
  backdrop-filter: saturate(180%) blur(34px) brightness(1.08);
  -webkit-backdrop-filter: saturate(180%) blur(34px) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 1px rgba(255,255,255,0.9) inset, 0 20px 50px rgba(20,16,58,0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu.is-open { opacity: 1; transform: none; }
.mobile-menu a,
.mobile-menu button {
  font-family: var(--font-body);
  font-size: 19px;
  text-align: left;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--ink);
  background: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.mobile-menu a:hover,
.mobile-menu button:hover { background: rgba(42,31,168,0.08); color: var(--blue); }

/* ============================================================
   STAGE – frei verschiebbarer Postkarten-Bereich
   ============================================================ */
.stage {
  position: relative;
  width: 100%;
  /* Stage reicht bis ganz nach oben UNTER die fixe Navbar, damit
     Postkarten hinter der Glasleiste durchschimmern (backdrop-filter
     braucht Inhalt hinter dem Element). Der Startabstand der Karten
     zur Oberkante wird im JS/Markup über data-y geregelt. */
  min-height: 100vh;
  margin-top: 0;
  padding-top: var(--header-h);
  overflow: hidden;
  touch-action: none;
}

.stage__hint {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: #8a879b;
  pointer-events: none;
  text-align: center;
  z-index: 1;
}

/* ============================================================
   POSTKARTE – vertikal, draggable, flippable
   ============================================================ */
.postcard {
  position: absolute;
  width: 300px;
  height: 420px;              /* vertikal / Hochformat – einheitlich */
  perspective: 1400px;
  touch-action: none;
  will-change: transform;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  cursor: grab;
}
.postcard.is-dragging { cursor: grabbing; }

.postcard__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: 14px;
  box-shadow: 0 10px 30px var(--shadow);
}

.postcard.is-flipped .postcard__inner { transform: rotateY(180deg); }

.postcard.is-dragging .postcard__inner {
  transition: none;
  box-shadow: 0 22px 50px rgba(20, 16, 58, 0.28);
}

.postcard__face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(20, 16, 58, 0.10);
  background: var(--paper-warm);
}

/* Vorderseite: Event-Bild */
.postcard__front { }

.postcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.postcard__front-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--blue);
  color: var(--paper);
  text-align: center;
  padding: 20px;
}
.postcard__front-fallback .kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}
.postcard__front-fallback .title {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 0.95;
}

/* Kleines Flip-Indiz auf der Vorderseite */
.postcard__flip-cue {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 8px var(--shadow);
}

/* Rückseite: Infos + Link */
.postcard__back {
  transform: rotateY(180deg);
  background: var(--paper-warm);
  color: var(--ink);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
}

.postcard__back-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  color: var(--blue);
  margin: 0 0 12px;
}

.postcard__meta {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.postcard__meta li {
  display: flex;
  gap: 8px;
  font-size: 17px;
  align-items: baseline;
  line-height: 1.15;
}
.postcard__meta .label {
  font-family: var(--font-body);
  flex: 0 0 62px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  padding-top: 1px;
}
.postcard__meta .value { font-family: var(--font-body); flex: 1; }
.postcard__meta .value .maps-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -2px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.postcard__meta .value .maps-pin:hover {
  background: var(--blue-deep);
  transform: scale(1.1);
}

.postcard__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  background: var(--blue);
  color: var(--paper);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.1s ease;
}
.postcard__link:hover { background: var(--blue-deep); }
.postcard__link:active { transform: translateY(1px); }

/* Beschreibungstext auf der Rückseite */
.postcard__text {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: #3a3760;
}

/* Video-Button auf der Rückseite – volle Breite, gleich lang wie Ticket-Button */
.postcard__video-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  background: none;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.postcard__video-btn:hover { background: var(--blue); color: #fff; }

/* Video-Embed im Glas-Modal (16:9) */
.glass-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.glass-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Ticket-Shop-Embed (rausgegangen) – hohes Fenster, füllt das Panel */
.glass-embed {
  width: 100%;
  height: 76vh;
  max-height: 720px;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  margin: -26px -30px -34px;   /* füllt das Content-Padding komplett aus */
  width: calc(100% + 60px);
}
.glass-embed iframe {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;   /* NICHT 16:9 (überschreibt generische Regel) */
  border: 0 !important;
  border-radius: 0 !important;
  max-width: none !important;
  display: block;
}

.postcard__back-close {
  position: absolute;
  top: 12px; right: 14px;
  font-size: 12px;
  color: #8a879b;
}
.postcard__back-close:hover { color: var(--blue); }

/* Fokus-Sichtbarkeit */
.postcard:focus-visible { outline: none; }
.postcard:focus-visible .postcard__inner {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
.postcard__link:focus-visible,
.postcard__back-close:focus-visible,
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   GLAS-MODAL (schwebendes Panel für Infos / Über uns / Videos)
   Inhalt wird per AJAX aus WP-Seiten geladen.
   ============================================================ */
.glass-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 10px) 20px 40px;
}
.glass-modal[hidden] { display: none; }

.glass-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 58, 0.32);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.glass-modal.is-open .glass-modal__backdrop { opacity: 1; }

.glass-modal__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--pill-radius);
  overflow: hidden;
  isolation: isolate;

  background:
    linear-gradient(135deg, rgba(252,252,250,0.94) 0%, rgba(248,248,246,0.90) 45%, rgba(252,252,250,0.93) 100%);
  backdrop-filter: saturate(160%) blur(40px) brightness(1.04);
  -webkit-backdrop-filter: saturate(160%) blur(40px) brightness(1.04);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    0 1px 1px rgba(255,255,255,0.95) inset,
    0 0 0 1px rgba(20,16,58,0.05),
    0 30px 70px rgba(20,16,58,0.28),
    0 8px 24px rgba(20,16,58,0.16);

  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.2,0.8,0.2,1);
}
.glass-modal.is-open .glass-modal__panel {
  opacity: 1;
  transform: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-modal__panel { background: rgba(250, 250, 248, 0.96); }
}

.glass-modal__bar {
  display: flex;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(255,255,255,0.5);
  font-family: var(--font-body);
  font-size: 20px;
  flex: 0 0 auto;
}
.glass-modal__title { font-weight: 400; }
.glass-modal__close {
  margin-left: auto;
  color: #6b6982;
  font-family: var(--font-body);
  font-size: 17px;
}
.glass-modal__close:hover { color: var(--blue); }

.glass-modal__content {
  padding: 26px 30px 34px;
  overflow-y: auto;
  font-size: 19px;
  line-height: 1.55;
}
.glass-modal__content h2 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 30px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair);
}
.glass-modal__content h2:first-child { margin-top: 0; }
.glass-modal__content h3 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 22px;
  color: var(--blue);
  margin: 24px 0 8px;
}
.glass-modal__content hr {
  border: 0;
  border-top: 1px solid var(--hair);
  opacity: 0.25;
  margin: 30px 0;
}
.glass-modal__content strong { font-weight: 600; }
.glass-modal__content p { margin: 0 0 14px; max-width: none; width: auto; clear: both; }
.glass-modal__content a { color: var(--blue); }
.glass-modal__content a:hover { text-decoration: underline; }
.glass-modal__content img,
.glass-modal__content iframe { max-width: 100%; border-radius: 12px; }
.glass-modal__content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }

/* WordPress-Galerien immer über die VOLLE Breite als gleichmäßiges Raster.
   WordPress nutzt bei .has-nested-images Flexbox mit inline-Breiten an den
   figure-Elementen – die werden hier bewusst überschrieben. */
.glass-modal__content .wp-block-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
  margin: 20px 0 !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100% !important;
  max-width: 100% !important;
}
.glass-modal__content .wp-block-gallery.columns-1 { grid-template-columns: 1fr !important; }
.glass-modal__content .wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr) !important; }
/* einzelne Gallery-Items: WordPress-inline-Breiten (width:calc) überschreiben */
.glass-modal__content .wp-block-gallery > .wp-block-image,
.glass-modal__content .wp-block-gallery > figure,
.glass-modal__content .wp-block-gallery .wp-block-image {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  overflow: hidden;
  border-radius: 12px;
}
.glass-modal__content .wp-block-gallery img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
/* klassische [gallery] */
.glass-modal__content .gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
  margin: 20px 0 !important;
  width: 100% !important;
}
.glass-modal__content .gallery-item {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}
.glass-modal__content .gallery img {
  width: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 0 !important;
  border-radius: 12px;
}
.glass-modal__content .gallery br { display: none; }
/* einzelnes figure mit Bildunterschrift (NICHT in einer Gallery) */
.glass-modal__content > figure,
.glass-modal__content p + figure { margin: 18px 0; }
.glass-modal__content figcaption { font-size: 14px; color: #6b6982; margin-top: 6px; }
/* keine schmalen Text-Umflüsse: ausgerichtete Bilder werden voll gesetzt */
.glass-modal__content .alignleft,
.glass-modal__content .alignright,
.glass-modal__content .aligncenter {
  float: none !important;
  display: block;
  margin: 18px auto !important;
  max-width: 100%;
}

@media (max-width: 560px) {
  .glass-modal__content .wp-block-gallery,
  .glass-modal__content .gallery { grid-template-columns: repeat(2, 1fr); }
}

/* Gallery-Bilder als klickbar kennzeichnen (öffnen Lightbox) */
.glass-modal__content .wp-block-gallery img,
.glass-modal__content .gallery img,
.glass-modal__content figure img,
.glass-modal__content p img {
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.glass-modal__content .wp-block-gallery img:hover,
.glass-modal__content .gallery img:hover {
  filter: brightness(1.05);
}

/* ============================================================
   LIGHTBOX (Vollbild-Ansicht für Overlay-Bilder)
   ============================================================ */
.toe-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(20, 16, 58, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
/* Geschlossen: komplett aus dem Weg – darf keine Klicks abfangen */
.toe-lightbox[hidden] {
  display: none !important;
}
.toe-lightbox.is-open { opacity: 1; }
.toe-lightbox__img {
  max-width: 90vw;
  max-height: 86vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.98);
  transition: transform 0.2s ease;
  object-fit: contain;
}
.toe-lightbox.is-open .toe-lightbox__img { transform: scale(1); }
.toe-lightbox__close {
  position: absolute;
  top: 22px; right: 26px;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 18px;
  cursor: pointer;
  opacity: 0.85;
}
.toe-lightbox__close:hover { opacity: 1; }
.toe-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.toe-lightbox__nav:hover { background: rgba(255, 255, 255, 0.28); }
.toe-lightbox__prev { left: 20px; }
.toe-lightbox__next { right: 20px; }
@media (max-width: 560px) {
  .toe-lightbox { padding: 16px; }
  .toe-lightbox__nav { width: 44px; height: 44px; font-size: 26px; }
  .toe-lightbox__prev { left: 8px; }
  .toe-lightbox__next { right: 8px; }
}
.glass-modal__loading { color: #6b6982; }
.glass-modal__content .muted { color: #6b6982; }

.glass-dates {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.glass-dates strong {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 26px;
}
.glass-dates .muted { color: #6b6982; font-size: 17px; }

/* Archiv-Kacheln im Overlay */
.glass-lede { color: #6b6982; margin: 0 0 22px; }
.glass-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
.glass-archive__card {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(20,16,58,0.1);
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.glass-archive__card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,16,58,0.14); }
.glass-archive__img { aspect-ratio: 3/4; object-fit: cover; width: 100%; display: block; }
.glass-archive__img--fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: var(--lime);
  font-family: var(--font-body); font-size: 26px;
}
.glass-archive__body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.glass-archive__body strong { font-weight: 400; font-size: 19px; }
.glass-archive__body .muted { color: #6b6982; font-size: 14px; }

/* ============================================================
   TEAM-SEKTION (Über uns-Overlay, [team]-Shortcode)
   Alle Mitglieder in EINER Reihe nebeneinander.
   ============================================================ */
.team-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin: 16px 0 24px;
  overflow-x: auto;              /* schmale Screens: horizontal scrollen statt umbrechen */
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.team-member {
  margin: 0;
  flex: 0 0 auto;
  width: 132px;                  /* feste Breite je Person → saubere Reihe */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.team-member__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-color: rgba(42,31,168,0.08);
  margin-bottom: 12px;
  border: 3px solid var(--paper);
  box-shadow: 0 6px 18px rgba(20,16,58,0.14);
}
.team-member__photo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 32px;
  color: var(--blue);
  background: var(--lime);
}
.team-member__body { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.team-member__name {
  display: inline;
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
  line-height: 1.3;
  background: linear-gradient(var(--lime), var(--lime));
  background-size: 100% 40%;
  background-position: 0 82%;
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 4px;
}
.team-member__role { font-size: 13px; color: var(--blue); line-height: 1.3; margin-top: 5px; }
.team-member__refs { font-size: 13px; color: var(--blue); line-height: 1.3; }
.team-member__desc { font-size: 13px; line-height: 1.4; color: #6b6982; margin-top: 6px; }






/* ============================================================
   POSTKARTE-FORMULAR
   ============================================================ */
.site-header__nav-btn--accent {
  color: var(--blue);
  font-weight: 400;
  position: relative;
}
.site-header__nav-btn--accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
}

.signup-intro { color: #4a4866; margin: 0 0 20px; font-size: 18px; max-width: none; }

.signup-toggle {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 20px;
  border-radius: 999px;
  background: rgba(20,16,58,0.06);
}
.signup-toggle__opt {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 17px;
  color: #4a4866;
  transition: background 0.15s ease, color 0.15s ease;
}
.signup-toggle__opt.is-active {
  background: var(--blue);
  color: #fff;
}

.signup-field { display: block; margin: 0 0 14px; }
.signup-field > span {
  display: block;
  font-size: 14px;
  color: #2a2748;
  margin-bottom: 5px;
}
.signup-field em { color: #8a879b; font-style: normal; }
.signup-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(20,16,58,0.2);
  background: rgba(255,255,255,0.92);
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
}
.signup-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(42,31,168,0.12);
}
.signup-row { display: flex; gap: 12px; }
.signup-field--zip { flex: 0 0 34%; }
.signup-field--city { flex: 1; }
.signup-field--half { flex: 1; }

.signup-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0 18px;
  font-size: 14px;
  color: #4a4866;
  line-height: 1.4;
}
.signup-consent input { margin-top: 3px; flex: 0 0 auto; }
.signup-consent a { color: var(--blue); }

.signup-submit {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 19px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.signup-submit:hover { background: var(--blue-deep); }
.signup-submit:active { transform: translateY(1px); }
.signup-submit:disabled { opacity: 0.6; cursor: default; }

.signup-message { margin: 0 0 14px; font-size: 16px; }
.signup-message.is-ok { color: #1b7a3d; }
.signup-message.is-error { color: #b3261e; }

/* ============================================================
   ARCHIV
   ============================================================ */
.page-wrap {
  margin-top: var(--header-h);
  max-width: 820px;
  padding: 40px 20px 120px;
  margin-left: auto;
  margin-right: auto;
}
/* Schwebendes Glas-Panel – wie die Overlays von der Startseite */
.page-panel {
  border-radius: var(--pill-radius);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(230,234,255,0.12) 42%, rgba(255,255,255,0.22) 100%);
  -webkit-backdrop-filter: saturate(190%) blur(30px) brightness(1.10);
  backdrop-filter: saturate(190%) blur(30px) brightness(1.10);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow:
    0 1px 2px rgba(255,255,255,0.95) inset,
    0 0 0 1px rgba(20,16,58,0.05),
    0 30px 70px rgba(20,16,58,0.18);
}
.page-panel__bar {
  padding: 22px 30px;
  border-bottom: 1px solid rgba(20,16,58,0.10);
}
.page-panel__title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  margin: 0;
  color: var(--blue);
}
.page-panel__content {
  padding: 26px 30px 40px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}
.page-wrap .lede { font-size: 17px; color: #6b6982; margin: 0 0 44px; }

/* MailPoet-Seiten (Abo verwalten, E-Mail-Einstellungen) an den Look anpassen */
.page-panel__content h2,
.page-panel__content h3 {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
}
.page-panel__content h2 { font-size: 24px; margin: 24px 0 10px; }
.page-panel__content label { color: var(--ink); }
.page-panel__content input[type="text"],
.page-panel__content input[type="email"],
.page-panel__content select,
.page-panel__content .mailpoet_text,
.page-panel__content .mailpoet_email {
  font-family: var(--font-body);
  font-size: 17px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(20,16,58,0.2);
  background: rgba(255,255,255,0.92);
  color: var(--ink);
}
/* MailPoet-Buttons im Marken-Look */
.page-panel__content input[type="submit"],
.page-panel__content button[type="submit"],
.page-panel__content .mailpoet_submit,
.page-panel__content .wysija-submit {
  font-family: var(--font-body) !important;
  font-size: 17px !important;
  background: var(--blue) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 13px 28px !important;
  cursor: pointer;
  transition: background 0.15s ease;
}
.page-panel__content input[type="submit"]:hover,
.page-panel__content button[type="submit"]:hover,
.page-panel__content .mailpoet_submit:hover {
  background: var(--blue-deep) !important;
}
/* Ja/Nein-Radio-Buttons (Listen-Auswahl) */
.page-panel__content .mailpoet_list_label,
.page-panel__content .mailpoet_radio_label { color: var(--ink); }
.page-panel__content a { color: var(--blue); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 28px;
}
.archive-card {
  border: 1px solid rgba(20,16,58,0.12);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-warm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.archive-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px var(--shadow); }
.archive-card__img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.archive-card__img--fallback {
  aspect-ratio: 3/4;
  background: var(--blue);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 34px;
}
.archive-card__body { padding: 14px 16px 18px; }
.archive-card__title { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.archive-card__meta { font-size: 13px; color: #6b6982; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 0 var(--pill-inset) var(--pill-gap);
  font-family: var(--font-body);
  font-size: 16px;
  color: #6b6982;
  display: flex;
  justify-content: center;
}
/* Glas-Pille – auf ALLEN Seiten */
.site-footer__pill {
  width: 100%;
  max-width: var(--pill-max);
  padding: 20px 48px;
  border-radius: var(--pill-radius);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: baseline;

  background:
    linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(230,234,255,0.12) 42%, rgba(255,255,255,0.22) 100%);
  backdrop-filter: saturate(190%) blur(30px) brightness(1.10);
  -webkit-backdrop-filter: saturate(190%) blur(30px) brightness(1.10);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow:
    0 -1px 2px rgba(255,255,255,0.95) inset,
    0 14px 30px rgba(255,255,255,0.4) inset,
    0 0 0 1px rgba(20,16,58,0.05),
    0 -20px 55px rgba(20,16,58,0.16),
    0 -4px 14px rgba(20,16,58,0.08);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-footer__pill { background: rgba(250, 250, 248, 0.9); }
}
.site-footer .imprint-links { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.site-footer a:hover { color: var(--blue); }
.site-footer .footer-link {
  font-family: var(--font-body);
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.site-footer .footer-link:hover { color: var(--blue); }
.site-footer .colophon { white-space: nowrap; color: inherit; text-decoration: none; }
.site-footer a.colophon:hover { color: var(--blue); }

/* Nur auf der Startseite: Footer-Pille schwebt fixiert unten */
.home .site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  pointer-events: none;
  background: none;
}
.home .site-footer__pill {
  pointer-events: auto;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .home .site-footer__pill { background: rgba(250, 250, 248, 0.9); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  :root {
    --pill-gap: 12px;
    --pill-inset: 14px;
    --bar-h: 92px;      /* höher, damit das zweizeilige Logo reinpasst */
    --logo-h: 56px;
    --footer-h: 62px;   /* Höhe der flachen Footer-Pille inkl. Abstand */
  }
  /* Höhe regiert: Logo wird auf die Pillenhöhe skaliert, Breite folgt automatisch */
  .site-header__brand--logo,
  .site-header__brand--logo .custom-logo-link {
    display: flex !important;
    align-items: center;
    line-height: 0;
  }
  .site-header__brand--logo img.custom-logo {
    height: auto !important;
    max-height: calc(var(--bar-h) - 46px) !important;
    width: auto !important;
    max-width: 110px !important;
    object-fit: contain;
    display: block;
  }
  /* Header mobil: drei gleich breite Flex-Zonen. Postkarte links, Logo
     mittig, Infos+Burger rechts. Kein Grid, kein absolutes Logo –
     iOS Safari rendert das zuverlässig. */
  .site-header__pill {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: var(--bar-h);
    min-height: var(--bar-h);
    max-height: var(--bar-h);
    position: relative;
  }
  .site-header__logo {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;   /* Logo in der Mittelzone zentriert */
    max-height: var(--bar-h);
    overflow: hidden;
    order: 2;
  }
  .site-header__nav { display: none !important; }
  .site-header__signup-mobile {
    display: inline-flex;
    align-items: center;
    flex: 1 1 0;               /* linke Zone */
    justify-content: flex-start;
    white-space: nowrap;
    order: 1;
  }
  .site-header__mobile-right {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* rechte Zone */
    flex: 1 1 0;
    gap: 12px;
    white-space: nowrap;
    order: 3;
  }
  .site-header__infos-mobile { font-size: 15px; }
  .site-header__menu-btn {
    display: flex;
    position: static;
    transform: none;
    flex: 0 0 auto;
  }
  /* Pillen mobil transparent, damit die Papiertextur durchschimmert –
     gilt auch, wenn backdrop-filter nicht unterstützt wird (In-App-Browser) */
  .site-header__pill,
  .home .site-footer__pill {
    background: rgba(255, 255, 255, 0.20) !important;
  }

  /* Karten als STAPEL: die Stage füllt exakt den Raum zwischen
     fixer Header-Pille und fixer Footer-Pille (kein weißer Bruch). */
  .stage {
    position: fixed;
    left: 0; right: 0;
    top: var(--header-h);
    bottom: var(--footer-h);
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  .postcard {
    width: min(74vw, 300px) !important;
    height: min(108vw, 430px) !important;
  }
  .stage__hint { display: none; }
  .glass-modal { padding: calc(var(--header-h) + 6px) 12px 24px; }
  .glass-modal__panel { max-width: 100%; }

  /* Footer mobil: kompakt und einzeilig – auf ALLEN Seiten */
  .site-footer { padding: 0 var(--pill-inset) var(--pill-gap); }
  .home .site-footer { position: fixed; }
  .site-footer__pill {
    padding: 12px 20px;
    border-radius: 22px;
    font-size: 13px;
    gap: 6px 14px;
    flex-wrap: nowrap;
  }
  .site-footer .imprint-links { gap: 12px; flex-wrap: nowrap; }
  .site-footer__pill .colophon,
  .site-footer__pill .footer-link { font-size: 12px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .postcard__inner { transition: transform 0.001s linear; }
  .archive-card { transition: none; }
}
