/* Eigene Anpassungen über dem Webflow-Export (Zweig optimierung) */

/* Kein seitliches Wackeln am Handy: überstehende Deko-Bilder und Slider-Pfeile abschneiden */
html, body { overflow-x: clip; }

/* Logos nicht verzerren */
.image-19, .image-43 { object-fit: contain; }

/* Personenkarten (Hofstaat, Ehrenhofstaat, Team): gleichmäßiges Raster.
   Vorher waren die Karten am Desktop fest 240 px breit, das Raster wuchs mit
   (bei 1920 px über 190 px Leerraum je Karte), bei 991/1024 px sprangen die Größen.
   Jetzt: Karten füllen ihre Spalte, Spalten wachsen bis --max, Abstände wachsen mit. */
.quick-stack-2 {
  --cols: 3;
  --gap: clamp(16px, 2.6vw, 44px);
  --max: clamp(240px, 18vw, 340px);
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) !important;
  grid-auto-rows: auto !important;
  column-gap: var(--gap) !important;
  row-gap: var(--gap) !important;
  width: min(calc(100vw - 32px), calc(var(--cols) * var(--max) + (var(--cols) - 1) * var(--gap))) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  justify-content: center !important;
  padding: 0 !important;
  box-sizing: border-box;
}
.quick-stack-2:has(> .w-layout-cell:nth-child(2):last-child) { --cols: 2; }
/* 3 Spalten erst, wenn jede Karte mindestens 240 px hat: keine Größensprünge */
@media screen and (max-width: 783px) {
  .quick-stack-2 { --cols: 2; }
}
.quick-stack-2 > .w-layout-cell { min-width: 0; }
.quick-stack-2 > .w-layout-cell > a { display: block; width: 100%; }
.quick-stack-2 .card { display: block; width: 100%; height: auto; }
.quick-stack-2 > .w-layout-cell:empty { display: none; }
/* Unvollständige letzte Reihe mittig statt links (Flex statt Grid, gleiche Spaltenbreite) */
.quick-stack-2 { display: flex !important; flex-wrap: wrap; }
.quick-stack-2 > .w-layout-cell { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }

/* Steckbrief-Seiten (Prinz, Hofstaat, Team): einheitlicher Aufbau statt Einzel-Verschiebungen je Person.
   Desktop/Tablet: Viva-Logo | Steckbrief | Glückszahl. Handy: Logo + Glückszahl oben, Steckbrief volle Breite.
   Steckbrief-Bilder sind ohne leere Ränder zugeschnitten (gleiche Auflösung), dadurch wirken alle gleich groß. */
.div-block-25 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3.4fr) minmax(0, 1fr);
  grid-template-areas: "viva brief zahl";
  align-items: center;
  justify-items: center;
  column-gap: 2vw;
  width: 100% !important;
  max-width: 1640px;
  height: auto !important;
  min-height: calc(100svh - 360px);
  margin: 0 auto !important;
  padding: 0 2vw 24px !important;
  overflow: visible !important;
  box-sizing: border-box;
}
.div-block-25 > .div-block-35 { display: contents !important; }
.div-block-25 .image-17 { grid-area: viva; position: static !important; width: 100% !important; max-width: 300px; margin: 0 !important; padding: 0 !important; }
.div-block-25 > .div-block-23 { grid-area: brief; width: 100% !important; margin: 0 !important; display: flex; justify-content: center; }
.div-block-25 .image-10.steckbrief {
  width: 100% !important; max-width: 100% !important; height: auto;
  max-height: max(320px, calc(100svh - 380px)); object-fit: contain;
  margin: 0 !important; padding: 0 !important; cursor: zoom-in;
}
.div-block-25 > .div-block-24 { grid-area: zahl; width: 100% !important; margin: 0 !important; padding: 0 !important; display: flex; justify-content: center; }
.div-block-25 > .div-block-24:empty { display: none !important; }
.div-block-25 .image-8.prinz {
  position: static !important; width: 100% !important; max-width: 200px; opacity: 1 !important;
  margin: 0 !important; padding: 0 !important;
}
.div-block-25 .image-8.prinz.l { grid-area: zahl; }
/* Hat die Person eine eigene Glückszahl (rechts), wird Lukas' Zahl links nicht gebraucht */
.div-block-25:has(.image-8.u) .image-8.l { display: none !important; }

@media screen and (max-width: 767px) {
  .div-block-25 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "viva zahl" "brief brief";
    row-gap: 12px;
    min-height: 0;
    padding: 8px 16px 140px !important;
  }
  .div-block-25 .image-17 { max-width: 190px; justify-self: start; }
  .div-block-25 .image-8.prinz { max-width: 120px; justify-self: end; }
  .div-block-25 > .div-block-24 { justify-content: flex-end; }
  .div-block-25 .image-10.steckbrief { max-height: none; }
}

/* Steckbrief groß ansehen (Tippen/Klicken) */
.steckbrief-gross {
  position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .92);
  overflow: auto; -webkit-overflow-scrolling: touch; display: flex;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  cursor: zoom-out; touch-action: pinch-zoom pan-x pan-y;
}
.steckbrief-gross img { max-width: none; width: min(1600px, 220vw); height: auto; margin: auto; flex: none; }
@media (orientation: landscape) and (min-width: 768px) { .steckbrief-gross img { width: min(1600px, 96vw); } }
.steckbrief-gross button {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #fff; color: #000; font: 600 22px/44px sans-serif; cursor: pointer;
}

/* Impressum/Datenschutz: Zwischenüberschriften */
.text-block .rt-titel { display: inline-block; margin-top: 4px; font-size: 1.1em; }
.div-block-45 .text-block { line-height: 1.5; }
.div-block-45 .text-block a { overflow-wrap: anywhere; }
.div-block-45:has(.rt-titel) { align-items: flex-start; }

/* YouTube erst nach Klick (Jecken-Draft) */
.yt-klick { position: absolute; inset: 0; cursor: pointer; background: #000; overflow: hidden; }
.yt-klick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border: 0; border-radius: 12px;
  background: rgba(200,0,0,.9); cursor: pointer; transition: transform 200ms ease-out, background-color 200ms ease-out; }
.yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt-klick:hover .yt-play { transform: scale(1.08); background: #e00; }
.yt-hinweis { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font: 11px/1.35 "Open Sans", sans-serif; color: #fff; background: rgba(0,0,0,.65); text-align: center; }
.yt-hinweis a { color: #fff; text-decoration: underline; }
.w-video > iframe.embedly-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-klick { container-type: inline-size; }
.yt-kurz { display: none; }
@container (max-width: 300px) {
  .yt-lang { display: none; }
  .yt-kurz { display: inline; }
  .yt-hinweis { font-size: 10px; padding: 4px 6px; }
  .yt-play { width: 52px; height: 36px; margin: -18px 0 0 -26px; border-radius: 9px; }
  .yt-play::after { left: 21px; top: 10px; border-width: 8px 0 8px 13px; }
}
/* Video im Goldrahmen: Ecken passend zum Rahmen abrunden */
.div-block-63 .video { overflow: hidden; border-radius: 14px; isolation: isolate; }
.div-block-63 .video > iframe { border-radius: inherit; }
@media (max-width: 767px) { .div-block-63 .video { border-radius: 9px; } }


/* Kein Springen beim ersten Laden: Bilder, deren Breite sonst erst nach dem Laden feststeht,
   bekommen die Breite vorab (fertiges Layout geprüft unverändert, werkzeuge/ siehe README) */
.div-block-81 > a, .image-473 { width: 100%; }
.grid.quick-stack-8 { width: 100%; }
.quick-stack-8 > a, .quick-stack-8 > a > img { width: 100%; }
@media (max-width: 1439px) { .werbebanner > img { width: 100%; } }
.div-block-34 > img:not(.image-43), .image-472 { width: 100%; }
@media (min-width: 480px) { .div-block-34 > img:not(.image-43), .image-472 { width: 240px; } }
.div-block-18 > .image-16, .div-block-18 > a, .div-block-18 > a > .image-16 { width: 100%; }
.quick-stack-4 { width: 100%; }
.quick-stack-4 > .cell-19 > img, .quick-stack-4 > .cell-21 > img { width: 100%; }
.quick-stack-5 > .cell-22 > img, .quick-stack-5 > .cell-22 > a, .quick-stack-5 > .cell-22 > a > img { width: 100%; }
@media (max-width: 1023px) { .div-block-57 > a, .div-block-57 > a > .image-36 { width: 100%; } }
/* Slide-Galerien: vor dem Start des Karussells nur das erste Bild; am Handy Bildbreite vorab aus dem Seitenverhältnis (--r) */
.carousel:not(.slick-initialized) > .image-wrapper:not(:first-child) { display: none; }
@media (max-width: 479px) { .gallery.slide[style*="--r"] { width: min(calc(80vw - 10px), calc(40vh * var(--r))); } }
/* Jecken-Draft am Tablet hochkant: Inhalt mittig statt oben mit großer leerer Fläche darunter */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .brix---section-hero-short.sec.draft { min-height: calc(100svh - 130px); }
  .brix---section-hero-short.sec.draft > .div-block-15 { margin-top: auto; margin-bottom: auto; }
}
/* Logo-Leiste am Handy schlanker (Verlauf oben kürzer), verdeckt weniger vom Inhalt */
@media (max-width: 479px) { .div-block-36:not(.home) { padding-top: 32px; } }

/* Handy quer: Logo-Leiste unten ist fest und verdeckte das Seitenende (Steckbriefe) – Platz darunter schaffen */
@media (orientation: landscape) and (max-height: 500px) {
  body:not(:has(.image-13)) { padding-bottom: 140px; }
}

/* Startseiten-Popup (PriPro-Heft): in niedrigen Fenstern ganz sichtbar, Breite aus Fensterhöhe (Bild 1024x1820) */
.section-9 > .div-block-79 { max-width: calc((100vh - 60px) * 1024 / 1820 + 80px); }
@supports (height: 100svh) { .section-9 > .div-block-79 { max-width: calc((100svh - 60px) * 1024 / 1820 + 80px); } }

/* Galerien: „Zurück zur Übersicht“ lag über dem offenen Handymenü – solange das Menü offen ist ausblenden */
.div-block-54 { transition: opacity 180ms ease-out; }
body:has(.w-nav-button.w--open) .div-block-54 { opacity: 0; pointer-events: none; }
