/* ════════════════════════════════════════════════════════════════
   MARSTALLER-UNIVERSUM — Responsive-Polish v2.4.22
   ════════════════════════════════════════════════════════════════
   Master-Audit-Stylesheet. Jeder Abschnitt löst ein konkretes
   Real-World-Problem, das in der Praxis Hero-Layouts kaputtmacht
   oder die Bedienung auf Touch-Geräten verschlechtert.
   Geladen NACH allen Theme-Stylesheets — kann gezielt überschreiben.
   ════════════════════════════════════════════════════════════════ */

/* ─── 1. iOS-AUTO-ZOOM-FIX ────────────────────────────────────────
   Safari iOS zoomt automatisch in jede Form-Input mit font-size <16px.
   Resultat: nach dem ersten Tap rutscht das Layout zur Seite und User
   muss zurück-pinchen. Lösung: alle Form-Felder mit min 16px.
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="month"],
  input[type="time"],
  input[type="week"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ─── 2. TOUCH-TARGETS ≥44×44 ─────────────────────────────────────
   Apple HIG + WCAG 2.5.5: Touch-Ziele mind. 44×44 CSS-Pixel.
   Greift auf alle Plugin-Buttons + nativen WP-Buttons + Form-Submits.
   ─────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .wp-block-button__link,
  .gk-btn,
  button[type="submit"],
  button[type="button"],
  .mup-lb-close,
  .mup-lb-prev,
  .mup-lb-next,
  .gk-form-submit button,
  .wp-element-button {
    min-height: 44px;
    min-width: 44px;
    padding-block: max(0.85rem, 0.85em);
  }
  /* Form-Checkboxen größer für Touch */
  .gk-form-consent input[type="checkbox"],
  input[type="checkbox"].mup-touch {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ─── 3. FOCUS-VISIBLE (Keyboard-A11y) ────────────────────────────
   WordPress' Default-Focus-Outline ist mau. Hier: deutlich sichtbar,
   aber nur per Tastatur (nicht bei Maus-Klick).
   ─────────────────────────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 3px;
  border-radius: 2px;
}
.mup-lb-close:focus-visible,
.mup-lb-prev:focus-visible,
.mup-lb-next:focus-visible {
  outline-color: #f8f2e6;
  outline-offset: 2px;
}
.wp-block-button__link:focus-visible,
.gk-btn:focus-visible {
  outline-offset: 4px;
}

/* ─── 4. SAFE-AREA-INSETS (notched iPhones) ──────────────────────
   iPhone X+ haben Notch oben + Home-Indicator unten. Bei Fullscreen-
   Heroes (100svh) muss der Inhalt diese Bereiche respektieren, sonst
   wird die Headline vom Notch angeknabbert.
   ─────────────────────────────────────────────────────────────── */
@supports (padding: max(0px)) {
  .gk-hero-wow,
  .wp-block-cover.gk-hero-wow {
    /* min-height bleibt 100svh, aber Inner-Container respektiert Safe-Areas */
  }
  .gk-hero-wow .wp-block-cover__inner-container,
  html body .wp-block-cover.gk-hero-wow > .wp-block-cover__inner-container {
    padding-top:    max(clamp(1.5rem, 3.5vw, 3rem), env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(clamp(1.5rem, 3vw, 2.5rem), env(safe-area-inset-bottom, 0px)) !important;
    padding-left:   max(clamp(1.25rem, 5vw, 4.5rem), env(safe-area-inset-left, 0px)) !important;
    padding-right:  max(clamp(1.25rem, 5vw, 4.5rem), env(safe-area-inset-right, 0px)) !important;
  }
  /* Auch normaler Hero */
  .gk-hero .wp-block-cover__inner-container,
  .wp-block-cover.gk-hero .wp-block-cover__inner-container {
    padding-left:  max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

/* ─── 5. TABLET-BREAKPOINT 768–1024 ──────────────────────────────
   Bislang gab es nur Mobile (<800) und Desktop. Tablets fallen in
   eine Lücke — sie kriegen entweder volle Desktop-Komposition (zu
   eng) oder Mobile-Stack (verschenkt Platz). Klare Tablet-Regeln:
   ─────────────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Cinema-Portfolio: Header bleibt 1-spaltig, Grid 2-spaltig statt 5/4 */
  .gk-cinema-portfolio .gk-cinema-portfolio__header {
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
  }
  .gk-cinema-portfolio-grid,
  figure.wp-block-gallery.gk-cinema-portfolio-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .gk-cinema-portfolio-grid > figure.wp-block-image:nth-child(1) {
    grid-row: span 2;
    aspect-ratio: 3/5;
  }

  /* Pricing: 3 Karten bleiben, aber featured nicht so stark angehoben */
  .gk-edit-pricing-card--featured { transform: translateY(-6px); }
  .gk-edit-pricing-card--featured:hover { transform: translateY(-10px); }

  /* Workflow: 2×2-Grid statt 4-spaltig */
  .gk-edit-workflow-row { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 2rem; }
  .gk-edit-workflow-row::before { display: none; }

  /* Section-Photo Padding zurück */
  .gk-section-photo { padding: 6rem 3rem; }

  /* Mission */
  .gk-mission { padding: 6rem 3rem 5rem; }

  /* Kontakt */
  .gk-kontakt-section { padding: 6rem 3rem 5rem; }

  /* Hero-WOW: Type etwas zurückgenommen, kein Mobile-Stack */
  .gk-hero-wow__title,
  h1.gk-hero-wow__title {
    font-size: clamp(2.8rem, 6vw, 4.5rem) !important;
    max-width: 15ch !important;
  }
  .gk-hero-wow__scroll { display: block !important; }

  /* TIP Shop-Hero: Bild kleiner, Stack nicht zwingend */
  .tmp-shop-hero .tmp-shop-hero__row { gap: 2rem; }
  .tmp-shop-hero .tmp-shop-hero__portrait img { width: 260px !important; }

  /* Galerie: 3 Spalten statt 4 */
  .gk-gallery,
  figure.wp-block-gallery.gk-gallery {
    column-count: 3;
  }

  /* Schauspieler-Grid: 4 Spalten */
  .gk-actors-grid { grid-template-columns: repeat(4, 1fr); }

  /* Testimonials: 2 Spalten */
  .gk-testimonials-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─── 6. LANDSCAPE-PHONE FIX ─────────────────────────────────────
   Schmale Phones im Querformat (≤ 500 px hoch) brauchen kompakte
   Heroes — sonst füllt das Bild den ganzen Screen ohne Atmen-Raum.
   ─────────────────────────────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .gk-hero,
  .wp-block-cover.gk-hero,
  .gk-hero-wow,
  .wp-block-cover.gk-hero-wow {
    min-height: 100svh !important;
  }
  .gk-hero-wow__title,
  h1.gk-hero-wow__title {
    font-size: clamp(1.5rem, 5vw, 2.4rem) !important;
    margin-bottom: 0.4rem !important;
  }
  .gk-hero-wow__lead { display: none; }
  .gk-hero-wow .wp-block-cover__inner-container {
    padding-block: 1rem !important;
  }
}

/* ─── 7. PREFERS-REDUCED-MOTION (sweep) ──────────────────────────
   Vollständiger Sweep: alle Animationen aus, falls User es will.
   Decken bestehende Animationen UND künftige ab.
   ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .mup-eff-bokeh-hover *,
  .mup-eff-bokeh-hover:hover * {
    filter: none !important;
    opacity: 1 !important;
  }
  /* Bokeh-Glow im Hero komplett ausschalten */
  .gk-bokeh-section::before,
  .gk-bokeh-section::after,
  .gk-intro::before,
  .tmp-shop-hero::before {
    display: none !important;
  }
}

/* ─── 8. PREFERS-CONTRAST: HIGH ──────────────────────────────────
   Für User mit visuellen Einschränkungen: stärkere Kontraste,
   keine Glass-Translucenz.
   ─────────────────────────────────────────────────────────────── */
@media (prefers-contrast: more) {
  .gk-hero__card,
  .gk-quote-card,
  .gk-edit-pricing-card,
  .gk-format-table,
  .gk-form,
  .gk-warm-faq {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
    border: 2px solid #1f1a12 !important;
  }
  .gk-hero-wow::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.85) 100%) !important;
  }
  .gk-hero-wow__title { text-shadow: 0 2px 0 #000, 0 4px 30px rgba(0,0,0,0.6) !important; }
}

/* ─── 9. FORCED-COLORS (Windows High-Contrast / Edge) ────────────
   Hover-Filter dürfen den User nicht blockieren. System-Farben
   greifen automatisch — wir verhindern nur Filter, die alles
   unsichtbar machen würden.
   ─────────────────────────────────────────────────────────────── */
@media (forced-colors: active) {
  .mup-eff-bokeh-hover *,
  .mup-eff-grayscale {
    filter: none !important;
  }
  .gk-hero-wow::after { background: none !important; }
  .mup-lightbox { background: Canvas !important; }
  .mup-lb-close,
  .mup-lb-prev,
  .mup-lb-next {
    background: ButtonFace !important;
    color: ButtonText !important;
    border: 1px solid ButtonText !important;
  }
}

/* ─── 10. CONTAINER-QUERIES (Karten-Komponenten) ─────────────────
   Cards können in unterschiedlichen Kontexten landen (Sidebar,
   Volle Breite, 2-Spalten-Layout). Container-Queries machen sie
   intelligent statt viewport-abhängig.
   Browser-Support: alle modernen, Edge 105+, Safari 16+.
   ─────────────────────────────────────────────────────────────── */
@supports (container-type: inline-size) {
  .gk-edit-pricing-card,
  .gk-quote-card,
  .gk-edit-workflow-step {
    container-type: inline-size;
    container-name: card;
  }
  @container card (max-width: 280px) {
    .gk-edit-price { font-size: 1.85rem; }
    .gk-edit-pricing-list li { font-size: 0.85rem; }
    .gk-quote-text { font-size: 1rem; }
    .gk-edit-workflow-num { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
  }
}

/* ─── 11. PRINT-STYLES ───────────────────────────────────────────
   Wenn jemand die Kontakt-Seite druckt (z.B. Booking-Anfrage als
   Beleg), soll's nutzbar aussehen.
   ─────────────────────────────────────────────────────────────── */
@media print {
  /* Hero-Animationen + Decoratives weg */
  .gk-hero,
  .gk-hero-wow,
  .wp-block-cover {
    min-height: auto !important;
    height: auto !important;
    page-break-after: avoid;
  }
  .gk-hero-wow::after,
  .gk-hero__card,
  .mup-lightbox,
  .gk-hero-wow__scroll,
  .wp-block-cover__background,
  .wp-block-cover__image-background {
    display: none !important;
  }
  .gk-hero-wow .wp-block-cover__inner-container {
    color: #1f1a12 !important;
    background: #fff !important;
  }
  .gk-hero-wow__title,
  .gk-hero-wow__brand-name,
  .gk-hero-wow__eyebrow,
  .gk-hero-wow__lead {
    color: #1f1a12 !important;
    text-shadow: none !important;
  }
  /* Form auf Druck: simpel */
  .gk-form {
    box-shadow: none !important;
    border: 1px solid #1f1a12 !important;
    background: #fff !important;
    backdrop-filter: none !important;
  }
  /* Links: URL anhängen */
  a[href^="http"]:not([href*="mailto:"])::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  /* Side-Effects vermeiden */
  .mup-cursor-trail,
  .gk-bokeh-section::before,
  .gk-bokeh-section::after {
    display: none !important;
  }
  /* Bilder nicht zerteilen */
  figure.wp-block-image,
  .wp-block-cover {
    page-break-inside: avoid;
  }
  /* Section-Trenner als Page-Breaks erlauben */
  section.gk-mission,
  section.gk-section-photo,
  section.gk-kontakt-section {
    page-break-inside: avoid;
  }
}

/* ─── 12. HOVER-ONLY SAFETY ──────────────────────────────────────
   Alle Hover-States in (hover: hover)-Media-Query — verhindert
   Sticky-Hover auf Touch-Geräten (Tap aktiviert Hover-State, der
   nie wieder weggeht ohne wo-anders-hin-Tap).
   ─────────────────────────────────────────────────────────────── */
@media (hover: none) {
  .gk-gallery figure:hover img,
  .gk-actor-card:hover .gk-actor-thumb,
  .gk-warm-bts-stack > figure.wp-block-image:hover {
    transform: none !important;
    filter: none !important;
  }
  .gk-gallery figure:hover figcaption {
    /* Auf Touch: Caption per Tap toggle, hier zumindest sichtbar lassen */
    opacity: 1 !important;
    position: static !important;
    background: rgba(0,0,0,0.65);
    color: var(--gk-cream, #f8f2e6);
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem;
  }
}

/* ─── 13. PREFERS-REDUCED-DATA ───────────────────────────────────
   Spar-Modus: keine Background-Animations, keine Decoratives.
   Browser-Support: Chrome 85+, Edge 85+, Opera.
   ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-data: reduce) {
  .gk-hero-wow .wp-block-cover__image-background {
    animation: none !important;
    transform: none !important;
  }
  .gk-bokeh-section::before,
  .gk-bokeh-section::after,
  .gk-intro::before { display: none !important; }
}

/* ─── 14. FORM-MOBILE-POLISH ────────────────────────────────────
   Submit-Button voll-breit auf Phone, links-bündig auf Tablet+.
   Visuelles Feedback auf :active für Touch.
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .gk-form { padding: 1.5rem 1.25rem !important; }
  .gk-form-submit { align-items: stretch !important; }
  .gk-form-submit .gk-btn,
  .gk-form button[type="submit"] {
    width: 100%;
    text-align: center;
  }
  .gk-form-row label > span { font-size: 0.65rem; }
}
.gk-form button[type="submit"]:active,
.gk-form-submit .gk-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 12px -4px rgba(201, 168, 76, 0.4) !important;
}

/* ─── 15. SCROLLBAR-POLISH (Webkit + Firefox) ────────────────────
   Dezenter, themengerechter Scrollbar — vor allem auf Desktop.
   ─────────────────────────────────────────────────────────────── */
@media (hover: hover) {
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 168, 76, 0.5) transparent;
  }
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.45);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, 0.7); border-color: transparent; background-clip: padding-box; }
}

/* ─── 16. LIGHTBOX-MOBILE-POLISH ─────────────────────────────────
   Sticky-Tap-Issue: nach Bildwechsel verschwindet Pinch-Zoom-State.
   Touch-Action explizit: pan-y für Swipe-Funktion.
   ─────────────────────────────────────────────────────────────── */
.mup-lightbox {
  touch-action: pan-y;
  -webkit-touch-callout: none;
  user-select: none;
}
.mup-lb-stage img {
  touch-action: pinch-zoom;
  -webkit-user-drag: none;
}
/* Image transitionierbar machen für smoothes Wechseln */
.mup-lightbox.is-open .mup-lb-stage img {
  animation: mup-lb-img-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes mup-lb-img-in {
  0%   { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ─── 17. SKIP-LINK (a11y) ───────────────────────────────────────
   Falls Theme keinen Skip-Link bereitstellt, kann ein Pattern einen
   <a class="mup-skip-link" href="#content">…</a> verwenden.
   ─────────────────────────────────────────────────────────────── */
.mup-skip-link {
  position: absolute;
  top: -9999px; left: 0;
  background: #1f1a12;
  color: #f8f2e6;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  z-index: 100000;
  border-radius: 0 0 6px 0;
}
.mup-skip-link:focus,
.mup-skip-link:focus-visible {
  top: 0;
}

/* ─── 18. FONT-DISPLAY-SAFETY ────────────────────────────────────
   Falls Theme @font-face ohne font-display lädt: Fallback erlauben,
   damit FOIT (Flash of Invisible Text) vermieden wird.
   ─────────────────────────────────────────────────────────────── */
html { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ─── 19. IMAGE-LOADING-DEFAULTS ─────────────────────────────────
   Modern: alle Patterns-Bilder bekommen native lazy + async decoding.
   Verhindert Layout-Shifts.
   ─────────────────────────────────────────────────────────────── */
img:not([loading]):not(.wp-block-cover__image-background) { /* Hint, kein Force */ }
.wp-block-image img,
.wp-block-gallery img {
  height: auto;
  max-width: 100%;
}

/* ─── 20. SELECTION-COLOR ────────────────────────────────────────
   Markiertes Text in Marke-Gold statt Browser-Blau.
   ─────────────────────────────────────────────────────────────── */
::selection { background: rgba(201, 168, 76, 0.35); color: inherit; }
::-moz-selection { background: rgba(201, 168, 76, 0.35); color: inherit; }
