/* BAUSTEINE.CSS — Standalone-Styling für server-gerenderte bk-* Bausteine
 * Geladen NUR im Generator-Modus (isGeneratorMode=true, PageRenderer.php).
 * Kein globaler Reset — Selektoren auf bk-*/vl-baustein-Container gescopt.
 * Alle CSS-Variablen mit Fallback-Werten, da Datei statisch ausgeliefert wird.
 *
 * Abgedeckte Bausteine (BausteinResolver.php):
 *   kalender · kontakt · oeffnungszeiten · nachrichten · galerie
 */

/* ── Box-Model-Reset innerhalb der Bausteine ─────────────────────────── */
.vl-baustein *,
.vl-baustein *::before,
.vl-baustein *::after,
.bk-lightbox *,
.bk-lightbox *::before,
.bk-lightbox *::after {
  box-sizing: border-box;
}

/* ── Äußerer Baustein-Container (<section class="vl-baustein …">) ──────── */
.vl-baustein {
  padding: 64px 24px;
}

/* ── Zentrierender Innen-Wrapper ─────────────────────────────────────── */
.vl-baustein .bk-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

/* ── Sektions-Kopf (Eyebrow + H2) ────────────────────────────────────── */
.vl-baustein .bk-section-head {
  margin-bottom: 40px;
}

.vl-baustein .bk-section-head h2 {
  font-size: clamp(24px, 3vw, 36px);
  margin: 0;
  font-weight: 600;
  color: var(--ink, #111827);
  line-height: 1.2;
}

.vl-baustein .bk-eyebrow {
  display: block;
  color: var(--muted, #6b7280);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  margin-bottom: 10px;
}

/* ── Button ──────────────────────────────────────────────────────────── */
.vl-baustein .bk-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius, 6px);
  background: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s;
  font-family: inherit;
  line-height: 1.4;
}

.vl-baustein .bk-btn:hover {
  filter: brightness(0.9);
}

/* ═══════════════════════════════════════════════════════════════════════
   ÖFFNUNGSZEITEN
   Struktur: .bk-info-card > .bk-hours-row × 7
   Jede Zeile: .bk-hours-day (Tag-Kürzel) + span (Zeiten / "geschlossen")
   ═══════════════════════════════════════════════════════════════════════ */

.vl-baustein--oeffnungszeiten .bk-info-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 8px 0;
  background: var(--card, var(--bg, #fff));
  max-width: 480px;
}

.bk-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink, #111827);
  border-radius: 4px;
}

.bk-hours-row:nth-child(even) {
  background: rgba(0, 0, 0, 0.03);
}

.bk-hours-row.closed {
  opacity: 0.38;
}

.bk-hours-day {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  font-weight: 600;
  min-width: 28px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   KONTAKT-FORMULAR
   Struktur: .bk-content-card > .bk-form.vl-contact-form
             > .bk-field × n (label + input/textarea) + .bk-btn
   ═══════════════════════════════════════════════════════════════════════ */

.vl-baustein--kontakt .bk-content-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 32px 36px;
  background: var(--card, var(--bg, #fff));
  max-width: 660px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .vl-baustein--kontakt .bk-content-card {
    padding: 20px 16px;
  }
}

.bk-form {
  display: grid;
  gap: 16px;
}

.bk-field {
  display: grid;
  gap: 6px;
}

.bk-field label {
  display: block;
  font-size: 13px;
  color: var(--muted, #6b7280);
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

.bk-field input,
.bk-field textarea {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: var(--radius, 6px);
  font-family: inherit;
  font-size: 15px;
  background: var(--bg, #fff);
  color: var(--ink, #111827);
  transition: border-color 0.15s, outline-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.bk-field input:focus,
.bk-field textarea:focus {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -1px;
  border-color: var(--primary, #2563eb);
}

.bk-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   GALERIE
   Struktur: .bk-gallery > .bk-gallery-tile × n (button > img)
   ═══════════════════════════════════════════════════════════════════════ */

.vl-baustein--galerie .bk-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 700px) {
  .vl-baustein--galerie .bk-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bk-gallery-tile {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ddd;
  border-radius: var(--radius, 6px);
  padding: 0;
  border: 0;
  cursor: zoom-in;
  display: block;
  width: 100%;
}

.bk-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.bk-gallery-tile:hover img {
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════════════
   KALENDER
   Struktur: .bk-content-card > #vl-booking[data-slug][data-privacy-url]
   Das Booking-Widget stylt sich selbst via booking-widget.js + CSS-Variablen.
   .bk-content-card-Styling gilt allgemein (s. Kontakt oben), hier Alias:
   ═══════════════════════════════════════════════════════════════════════ */

.vl-baustein--kalender .bk-content-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 8px);
  padding: 32px 36px;
  background: var(--card, var(--bg, #fff));
  max-width: 660px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .vl-baustein--kalender .bk-content-card {
    padding: 20px 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   NACHRICHTEN
   Struktur: zentrierter CTA-Button (scrollt zur Kontakt-Sektion)
   ═══════════════════════════════════════════════════════════════════════ */

.vl-baustein--nachrichten .bk-section-head {
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   LIGHTBOX (von BausteinResolver::lightboxOverlayHtml(), Galerie-Baustein)
   Struktur: .vl-lb.bk-lightbox > .bk-lb-close + .bk-lb-prev +
             .bk-lb-figure(.bk-lb-img + .bk-lb-caption) + .bk-lb-next +
             .bk-lb-counter
   ═══════════════════════════════════════════════════════════════════════ */

.vl-lb.bk-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
}

.vl-lb.bk-lightbox.open {
  display: flex;
}

.bk-lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bk-lb-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: block;
}

.bk-lb-caption {
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 80vw;
  opacity: 0.9;
  margin: 0;
}

.bk-lb-close,
.bk-lb-prev,
.bk-lb-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}

.bk-lb-close:hover,
.bk-lb-prev:hover,
.bk-lb-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.bk-lb-close {
  top: 16px;
  right: 16px;
  font-size: 32px;
}

.bk-lb-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.bk-lb-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.bk-lb-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  opacity: 0.7;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .bk-lb-close,
  .bk-lb-prev,
  .bk-lb-next {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  .bk-lb-close {
    font-size: 26px;
    top: 10px;
    right: 10px;
  }
  .bk-lb-prev {
    left: 8px;
  }
  .bk-lb-next {
    right: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   COOKIE-BANNER (frontend/public/js/cookie-banner.js)
   Existierte bisher nur in base.css (Legacy-Pfad) — im Generator-Modus lädt
   base.css nicht, der Banner war dadurch komplett unstyled (nackter Browser-
   Default statt Theme-Look).
   ═══════════════════════════════════════════════════════════════════════ */

.bk-cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 480px;
  margin: 0 auto;
  z-index: 200;
  /* --ink ist im Generator-Modus die TEXTfarbe des Themes (siehe PageRenderer.php) — bei
     dunklem Theme wäre das ein heller Wert, macht die Box hell statt dunkel. --card ist die
     Flächenfarbe (Kartenhintergrund), das passt hier semantisch richtig. */
  background: var(--card, #111827);
  /* --card ist im Generator-Modus die (oft helle) Karten-Flächenfarbe → weißer Text wäre
     unlesbar. --ink ist die Theme-Textfarbe und kontrastiert per Definition mit --card
     (hell auf dunklem Theme, dunkel auf hellem Theme). */
  color: var(--ink, #fff);
  padding: 16px 20px;
  border-radius: var(--radius, 6px);
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.bk-cookie-banner.hidden {
  display: none;
}

.bk-cookie-banner button {
  padding: 8px 16px;
  background: var(--primary, #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius, 4px);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   BOOKING-WIDGET-CSS (1:1 kopiert aus frontend/assets/js/booking-widget.js,
   dortiger style.textContent-Block ist die Quelle der Wahrheit — hier NUR
   fuer die Designer-Vorschau verfuegbar, da booking-widget.js selbst nur
   laedt wenn isBookingEnabled()===true (bei DesignDraft immer false).
   Bei Aenderung am Original IMMER hier nachziehen. )
   ═══════════════════════════════════════════════════════════════════════ */
    .vl-bw { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 520px; margin: 0 auto; }
    .vl-bw-title { font-size: 1.3rem; margin-bottom: 0.25rem; }
    .vl-bw-hint { font-size: 12px; color: var(--vl-bw-muted, #888); margin-bottom: 0.75rem; }
    .vl-bw-week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
    .vl-bw-nav-btn { background: var(--vl-bw-bg, #1a1a2e); border: 1px solid var(--vl-bw-border, #333); color: var(--vl-bw-text, #ccc); border-radius: 6px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
    .vl-bw-nav-btn:hover:not(:disabled) { border-color: var(--vl-bw-accent, #10b981); color: var(--vl-bw-text-strong, #fff); }
    .vl-bw-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
    .vl-bw-week-label { font-size: 13px; font-weight: 600; color: var(--vl-bw-text, #ccc); }
    .vl-bw-dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 1rem; scrollbar-width: none; -ms-overflow-style: none; }
    .vl-bw-dates::-webkit-scrollbar { display: none; }
    .vl-bw-day { display: flex; flex-direction: column; align-items: center; padding: 8px 10px 6px; border: 1px solid var(--vl-bw-border, #333); border-radius: 8px; background: var(--vl-bw-bg, #1a1a2e); color: var(--vl-bw-text, #ccc); cursor: pointer; min-width: 52px; font-size: 13px; transition: all 0.15s; position: relative; }
    .vl-bw-day:hover { border-color: var(--vl-bw-accent, #10b981); color: var(--vl-bw-text-strong, #fff); }
    .vl-bw-day.active { background: var(--vl-bw-accent, #10b981); border-color: var(--vl-bw-accent, #10b981); color: var(--vl-bw-on-accent, #fff); }
    .vl-bw-day.unavailable { opacity: 0.4; }
    .vl-bw-day.unavailable:hover { border-color: var(--vl-bw-border, #555); color: var(--vl-bw-muted, #999); }
    .vl-bw-day-name { font-weight: 600; font-size: 11px; text-transform: uppercase; }
    .vl-bw-day-num { font-size: 14px; margin-top: 2px; }
    .vl-bw-avail { display: flex; align-items: center; gap: 3px; margin-top: 4px; min-height: 14px; }
    .vl-bw-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
    .vl-bw-dot.free { background: var(--vl-bw-accent, #10b981); box-shadow: 0 0 6px rgba(16, 185, 129, 0.7); animation: vl-bw-glow 1.5s ease-in-out infinite; }
    .vl-bw-dot.empty { background: var(--vl-bw-error, #ef4444); box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); animation: vl-bw-glow-red 1.5s ease-in-out infinite; }
    .vl-bw-dot.loading { background: var(--vl-bw-border, #555); animation: vl-bw-pulse 1s infinite; }
    .vl-bw-count { font-size: 10px; color: var(--vl-bw-accent, #10b981); font-weight: 700; }
    .vl-bw-day.active .vl-bw-count { color: var(--vl-bw-on-accent, #fff); }
    .vl-bw-day.active .vl-bw-dot.free { background: var(--vl-bw-on-accent, #fff); box-shadow: none; animation: none; }
    @keyframes vl-bw-pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
    @keyframes vl-bw-glow { 0%,100% { box-shadow: 0 0 3px rgba(16,185,129,0.3); transform: scale(1); } 50% { box-shadow: 0 0 10px rgba(16,185,129,1); transform: scale(1.3); } }
    @keyframes vl-bw-glow-red { 0%,100% { box-shadow: 0 0 3px rgba(239,68,68,0.3); transform: scale(1); } 50% { box-shadow: 0 0 10px rgba(239,68,68,0.8); transform: scale(1.3); } }
    .vl-bw-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
    .vl-bw-slot { padding: 8px 16px; border: 1px solid var(--vl-bw-border, #333); border-radius: 6px; background: var(--vl-bw-bg, #1a1a2e); color: var(--vl-bw-text, #ccc); cursor: pointer; font-size: 14px; transition: all 0.15s; }
    .vl-bw-slot:hover { border-color: var(--vl-bw-accent, #10b981); color: var(--vl-bw-text-strong, #fff); }
    .vl-bw-slot.active { background: var(--vl-bw-accent, #10b981); border-color: var(--vl-bw-accent, #10b981); color: var(--vl-bw-on-accent, #fff); }
    .vl-bw-loading, .vl-bw-empty { color: var(--vl-bw-muted, #888); font-size: 14px; padding: 16px 0; }
    .vl-bw-form-inner { display: flex; flex-direction: column; gap: 10px; }
    .vl-bw-selected { font-size: 14px; color: var(--vl-bw-accent, #10b981); margin-bottom: 4px; }
    .vl-bw-price { font-size: 15px; font-weight: 600; color: var(--vl-bw-price, #f59e0b); }
    .vl-bw-input { padding: 10px 14px; border: 1px solid var(--vl-bw-border, #333); border-radius: 6px; background: var(--vl-bw-bg, #1a1a2e); color: var(--vl-bw-text-strong, #e5e5e5); font-size: 14px; outline: none; color-scheme: dark; }
    .vl-bw-input:focus { border-color: var(--vl-bw-accent, #10b981); }
    .vl-bw-textarea { resize: vertical; font-family: inherit; }
    .vl-bw-party-wrap { position: relative; }
    .vl-bw-party-btn { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
    .vl-bw-party-caret { opacity: 0.6; font-size: 11px; margin-left: 8px; }
    .vl-bw-party-list { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--card, var(--secondary, var(--bg, #1a1a2e))); border: 1px solid var(--vl-bw-border, #333); border-radius: 6px; z-index: 20; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
    .vl-bw-party-list.open { display: block; }
    .vl-bw-party-opt { padding: 8px 14px; color: var(--vl-bw-text-strong, #e5e5e5); cursor: pointer; font-size: 14px; }
    .vl-bw-party-opt:hover, .vl-bw-party-opt.active { background: var(--vl-bw-accent, #10b981); color: var(--vl-bw-on-accent, #fff); }
    .vl-bw-dsgvo { font-size: 13px; color: var(--vl-bw-muted, #888); display: flex; align-items: flex-start; gap: 8px; }
    .vl-bw-dsgvo a { color: var(--vl-bw-accent, #10b981); }
    .vl-bw-submit { padding: 12px; border: none; border-radius: 8px; background: var(--vl-bw-accent, #10b981); color: var(--vl-bw-on-accent, #fff); font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
    .vl-bw-submit:hover { opacity: 0.9; }
    .vl-bw-submit:disabled { opacity: 0.5; cursor: not-allowed; }
    .vl-bw-error { color: var(--vl-bw-error, #ef4444); font-size: 13px; }
    .vl-bw-success { text-align: center; padding: 2rem 0; }
    .vl-bw-success-icon { font-size: 3rem; color: var(--vl-bw-accent, #10b981); margin-bottom: 8px; }
    .vl-bw-success h3 { color: var(--vl-bw-accent, #10b981); margin-bottom: 8px; }
    .vl-bw-success p { color: var(--vl-bw-muted, #888); }
