/*
 * theme-overrides.css
 * ---------------------------------------------------------------------------
 * Reconciles conflicts between VI-core's own compiled Tailwind (layout.css) and
 * the imported WordPress design system (theme.css). VI-core scans the ported
 * theme components and re-emits some utilities (e.g. the
 * `[&:not(.link-initial)]:underline` link utility) that the original WP build
 * leaves inert, so a few rules win differently than they do on the live site.
 * Each rule below is scoped to the droneworks theme via [data-theme-slug] and
 * is intentionally high-specificity so it beats the stray VI-core utility
 * WITHOUT altering colour or other intended styling. Keep this list tight and
 * documented — it exists only to restore live-WP parity.
 */

/* Links — WP only underlines `.wysiwyg` content links. VI-core re-adds the
   `[&:not(.link-initial)]:underline` utility (specificity 0,2,0) which underlines
   header/footer/menu/CTA links that WP renders clean. Remove the decoration
   everywhere except .wysiwyg; link colour (text-highlight) is left untouched. */
[data-theme-slug='droneworks'] a:not(.link-initial) {
  text-decoration-line: none;
}
[data-theme-slug='droneworks'] .wysiwyg a:not(.link-initial) {
  text-decoration-line: underline;
}

/* WPForms phone fields embed intl-tel-input, whose 240-item country dropdown is
   normally hidden until opened by the library JS. The contact form is imported as
   static HTML (no JS init), so the list renders fully expanded and inflates the
   field to ~8800px, creating a huge empty void on /kontakt (and any form page).
   Collapse it exactly as the initialised widget would — the flag selector and the
   input itself stay visible, matching the live WP form. */
[data-theme-slug='droneworks'] .iti__country-list {
  display: none !important;
}

/* Page background — WP renders <body> with the light "surface" tint
   (--bg-surface = rgba(170,207,223,0.2), the theme-light palette), NOT white.
   VI-core's `body{background:hsl(var(--background))}` (white) wins the cascade over
   the imported `body{background:var(--bg-surface)}`, so the semi-transparent
   theme-light sections composited over WHITE look washed-out/pale instead of the
   correct sky tone. Restore WP's body surface so every light section composites
   to the same colour as the live site. */
[data-theme-slug='droneworks'] body {
  background-color: rgba(170, 207, 223, 0.2);
}

/* Header menu links — WP renders them in the primary-200 navy (#0b2639). theme.css's
   `.text-primary-200` utility loses VI-core's layer cascade to the inherited body
   foreground (#0e2538), so the nav text was the wrong navy. Re-assert it; :not(:hover)
   keeps the hover:text-accent state intact. */
[data-theme-slug='droneworks'] .header-navigation a:not(:hover) {
  color: var(--color-primary-200);
}

/* Footer "Termin vereinbaren" button — navy text (#0b2639) on its sky background.
   In the dark footer the default light link colour (secondary-200 sky) was beating
   `.text-primary-200`, rendering the label sky-on-sky (invisible). */
[data-theme-slug='droneworks'] a.footer-button:not(:hover) {
  color: var(--color-primary-200);
}

/* Sticky right-edge "Jetzt Service anfragen" button (`.sticky-button`) — WP renders
   the label in primary-200 navy (#0b2639). The anchor's `text-primary-200` utility
   (layered in theme.css) loses to VI-core layout.css's UNLAYERED preflight
   `a{color:inherit}`, so the button inherited the base foreground navy (#0e2538)
   instead — same layer conflict as the header nav. Re-assert primary-200; the inner
   text divs inherit it. `:not(:hover)` keeps the `hover:text-secondary-200` state. */
[data-theme-slug='droneworks'] a.sticky-button:not(:hover) {
  color: var(--color-primary-200);
}

/* `.text-heading` colour utility was DROPPED by the Tailwind-v4 theme.css compile
   (same family as the missing `3xl:` breakpoint + border widths — a custom token the
   v4 CLI didn't emit). Elements relying on it fell back to the inherited body colour —
   e.g. the key-facts-scroll card "arrow" links rendered grey (#6b747b, the card body
   text) instead of the heading navy WP shows. Restore it. `--color-heading` resolves
   to `--text-heading` (→ primary-100 #0f2e5d in light, secondary-200 in dark/scroll
   contexts), so this stays theme-correct everywhere. The anchor rule uses `:not(:hover)`
   so the variant's `hover:text-secondary-200` still wins on hover; the non-anchor rule
   covers headings/divs without a hover caveat. */
[data-theme-slug='droneworks'] :not(a).text-heading {
  color: var(--color-heading);
}
[data-theme-slug='droneworks'] a.text-heading:not(:hover) {
  color: var(--color-heading);
}

/* key-facts-scroll card "arrow" links (NOT the .btn pill buttons) — WP underlines them
   (decoration-accent/30). The site-wide link-underline reset stripped it; restore it for
   this block's non-button links to match WP. (Font-size note: WP shows these ~18.5px vs
   VI's 14px because VI's recompiled theme.css emitted `--text-sm:.875rem` fixed instead
   of WP's fluid text-sm — a theme-wide type-scale discrepancy, not fixed here.) */
[data-theme-slug='droneworks'] .wp-block-key-facts-scroll a:not(.link-initial):not(.btn) {
  text-decoration-line: underline;
}

/* `3xl` breakpoint utilities (min-width 95.625rem = 1530px). The theme.css was compiled
   with the Tailwind v4 CLI, which reads breakpoints from CSS @theme and therefore dropped
   the `3xl` screen defined in the old v3 tailwind.config.js — so EVERY `3xl:` class
   (teaser-grid → 2 cols, image cards → portrait, card content reveal) was dead and the
   grid never matched WP on wide screens. Restore the 6 used `3xl:` utilities here.
   Attribute selectors avoid escaping the `3xl:` / `[3/4]` class tokens. */
@media (min-width: 95.625rem) {
  [data-theme-slug='droneworks'] [class~='3xl:grid-cols-2'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  [data-theme-slug='droneworks'] [class~='3xl:aspect-[3/4]'] {
    aspect-ratio: 3 / 4;
  }
  [data-theme-slug='droneworks'] [class~='3xl:block'] {
    display: block;
  }
  [data-theme-slug='droneworks'] [class~='3xl:max-h-40'] {
    max-height: 15rem;
  }
  [data-theme-slug='droneworks'] .peer:checked ~ [class~='3xl:peer-checked:max-h-none'] {
    max-height: none;
  }
}

/* Border widths — VI-core's layout.css ships an UNLAYERED Tailwind v3 preflight
   (`*,::before,::after{border-width:0;border-style:solid;border-color:#e5e7eb}`).
   Unlayered declarations outrank theme.css's `@layer utilities` border utilities, so
   every border-WIDTH the WP design sets collapsed to 0 SITE-WIDE and the borders simply
   vanished — process-steps card dividers, FAQ/accordion rules, stats column dividers,
   blog separators, avatar rings, timeline connectors. theme-overrides.css is unlayered
   AND loads last, so re-declaring the used widths here beats the preflight and restores
   them. Attribute selectors ([class~='…']) avoid escaping the ':' / '[3px]' tokens;
   widths and breakpoints mirror theme.css exactly (md=768px, lg=1024px). Only WIDTH is
   restored — border COLOUR utilities (border-white, border-white/30, border-primary, …)
   already win the cascade. Order matters: the zeroing/state variants are kept BELOW the
   positive widths and at higher specificity so `last:`, `lg:` and `open:` still win. */
[data-theme-slug='droneworks'] [class~='border-2'] { border-width: 2px; }
[data-theme-slug='droneworks'] [class~='border-l-2'] { border-left-width: 2px; }
[data-theme-slug='droneworks'] [class~='border-b-2'] { border-bottom-width: 2px; }
[data-theme-slug='droneworks'] [class~='border-t-3'] { border-top-width: 3px; }
[data-theme-slug='droneworks'] [class~='border-b-3'] { border-bottom-width: 3px; }
[data-theme-slug='droneworks'] [class~='border-b-[3px]'] { border-bottom-width: 3px; }

@media (min-width: 768px) {
  [data-theme-slug='droneworks'] [class~='md:border-r-2'] { border-right-width: 2px; }
}
@media (min-width: 1024px) {
  [data-theme-slug='droneworks'] [class~='lg:border-l-3'] { border-left-width: 3px; }
  [data-theme-slug='droneworks'] [class~='lg:border-b-0'] { border-bottom-width: 0; }
  [data-theme-slug='droneworks'] [class~='last:lg:border-r-3']:last-child { border-right-width: 3px; }
}

[data-theme-slug='droneworks'] [class~='last:border-0']:last-child { border-width: 0; }
[data-theme-slug='droneworks'] [class~='last:border-b-0']:last-child { border-bottom-width: 0; }
[data-theme-slug='droneworks'] [class~='open:border-0']:is([open], :popover-open, :open) { border-width: 0; }

/* Header (menubar) logo size — the base `.logo` height clamp tops out at 2.25rem (36px),
   which reads small in the navbar. Enlarge the HEADER logo only (the `footer .logo`
   rules keep their own clamp) so the Nexron wordmark is more prominent. object-fit:contain
   on `.logo img` keeps the wordmark's aspect ratio while the box grows. */
[data-theme-slug='droneworks'] header .logo {
  height: clamp(1.75rem, 1.4rem + 1.6vw, 3.25rem);
}

/* Footer logo size — base `footer .logo` height clamps to 2.25rem (36px) and max-width
   to 14rem, which reads small. Enlarge it (and lift the width cap) so the wordmark is
   more prominent in the footer. `.logo img` keeps height:100% + object-fit:contain, so
   the image follows the taller box while preserving its aspect ratio. */
[data-theme-slug='droneworks'] footer .logo {
  height: clamp(2.75rem, 2rem + 3vw, 5rem);
  max-width: 22rem;
}

/* Footer "Termin vereinbaren" CTA — it stays `position:absolute` but must sit flush at the
   WINDOW's right edge. The button's wrapper `relative` and the copyright-row grid's
   `lg:relative` were removed in Footer.tsx so the button now resolves its offsets against
   the full-width `<footer>` (which spans the viewport) instead of the centered container.
   theme.css's `right:-5.5rem` would push it 5.5rem past the viewport (clipped by
   body{overflow-x:clip} → "right side cut off"); `right:0` pins it exactly to the window
   edge. The mobile tab uses margin-right; zero it so it doesn't bleed past the edge. */
[data-theme-slug='droneworks'] .footer-button-desktop {
  right: 0;
}
/* The vc-container shrinks at wider breakpoints, leaving a centered gap. Shift the button
   right by exactly that gap ((content_width - 100vw)/2) so it stays flush at the viewport
   right edge at every width. The formula auto-compensates for any vc-container padding. */
[data-theme-slug='droneworks'] .footer-button-mobile {
  position: relative !important;
  left: auto !important;
  right: calc((100% - 100vw) / 2) !important;
  margin-right: 0 !important;
}

/* Footer social icons (Instagram/Facebook/YouTube): force the 18px glyph size + fill so
   the theme's global `svg{width:100%;height:100%}` rule can never blow them up, and zero
   the margin/padding so the glyph centres inside its round button — the global
   `footer svg{margin-right:20px}` rule (for the contact icons) was pushing them off-centre. */
[data-theme-slug='droneworks'] .footer-social svg {
  width: 18px !important;
  height: 18px !important;
  fill: currentColor !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hero video play/mute controls — the `.glass` buttons (dark translucent + faint white
   border) blend into the dark video and read as low-contrast. Give them the brand accent
   border (same orange the .btn CTAs use, var(--color-accent) = #f24e24) so they stand out.
   `[data-action^='video-banner#']` targets exactly the two controls (togglePlay/toggleMute).
   Shorthand `border:` re-asserts width too, beating the unlayered preflight border-width:0. */
[data-theme-slug='droneworks'] [data-action^='video-banner#'] {
  border: 2px solid var(--color-accent);
}

/* ============================================================================
   Responsive fixes (2026-06-05)
   ========================================================================== */

/* #3 — Header "Login" button on mobile. theme.css has
   `@media (max-width:768px){header .btn{width:2.7rem;height:2.7rem;padding:0}}`
   which crushes EVERY header button into a 43×43px icon square. That's meant for
   icon-only buttons, but the Login button is a text button (`btn--no-icon`), so the
   "Login" label gets clipped into the tiny square. Restore an auto-width readable
   pill for the login (text) button at every breakpoint. */
[data-theme-slug='droneworks'] header .btn.header-login {
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  justify-content: center;
  white-space: nowrap;
}
@media (max-width: 768px) {
  [data-theme-slug='droneworks'] header .btn.header-login {
    padding: 0.45rem 0.95rem;
    font-size: 0.875rem;
  }
}

/* #4 / #1 — Scroll-theme dark state: the headline (and pre-title) must turn light
   when a section's scroll animation swaps it to the dark `.theme-primary` class.
   theme.css hardcodes `.block-title { color: … }` instead of using the themeable
   `--text-heading` token, so the title stays dark → invisible (same colour as the
   dark background) once the background goes dark. `.theme-primary` already sets
   `--text-heading`/`--text-body` to the light secondary-200, so re-point the title
   at the token. Scoped to `.theme-primary` so light sections are untouched, and
   no media query so it's correct on desktop, tablet AND mobile. Also covers
   statically-dark (non-scroll) theme-primary sections, which had the same latent bug. */
[data-theme-slug='droneworks'] .theme-primary :is(.block-title, .pre-title, h1, h2, h3),
/* The headline TEXT sits in a <span>, and theme.css forces `h2 span {color: primary-200}`
   (navy) — so the span must be recoloured too, else the visible text stays dark-on-dark. */
[data-theme-slug='droneworks'] .theme-primary :is(.block-title, .pre-title, h1, h2, h3, h4) span {
  color: var(--text-heading);
}
[data-theme-slug='droneworks'] .theme-primary :is(.wysiwyg, .block-text, p, li) {
  color: var(--text-body);
}

/* #1 — Anchor links (#my-id): any section with an id is an anchor target. Without a
   scroll offset the sticky header covers the jumped-to content. scroll-margin-top
   pushes the anchor down so the section lands below the fixed header on all viewports.
   Covers both the dw <Section id> (settings.block_id "Block-ID (Anker)") and the core
   formBlock (htmlId "Anker-ID"). */
[data-theme-slug='droneworks'] section[id]:not([id='']) {
  scroll-margin-top: 7rem;
}
@media (max-width: 768px) {
  [data-theme-slug='droneworks'] section[id]:not([id='']) {
    scroll-margin-top: 5.5rem;
  }
}

/* ============================================================================
   Responsive fixes (2026-06-18) — items 1–6
   ========================================================================== */

/* 1.1 — Header logo flush to left on small mobile (Chrome iPhone) */
@media (max-width: 480px) {
  [data-theme-slug='droneworks'] header .vc-container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
}

/* 1.2 — Logo slightly further right on md breakpoint (between mobile and xl) */
@media (min-width: 768px) and (max-width: 1279px) {
  [data-theme-slug='droneworks'] header .vc-container {
    padding-left: clamp(1.5rem, 1.25rem + 1.25vw, 2.5rem);
  }
}

/* 2.1 — Minimum fluid body font 17px (iPhone readability) */
[data-theme-slug='droneworks'] [class~='fl-text-base/base-md'] {
  font-size: clamp(1.0625rem, 0.975rem + 0.125vw, 1.125rem);
}

/* 2.2 — Cap body font on very narrow screens (Samsung S22) */
@media (max-width: 430px) {
  [data-theme-slug='droneworks'] [class~='fl-text-base/base-md'] {
    font-size: clamp(1.0625rem, 1rem + 0.125vw, 1.0625rem);
  }
}

/* 2.3 — TextImage body text: explicit fluid size (min 16px on large screens) */
[data-theme-slug='droneworks'] .text-image-content p,
[data-theme-slug='droneworks'] .text-image-content li {
  font-size: clamp(1rem, 0.975rem + 0.125vw, 1.125rem);
}

/* 3.1/3.2 — Hero bullet points: the marker is the theme.css checkmark badge,
   natively absolute-positioned at the top-left of each <li> (top:3px/8px, the text
   indented by padding-left) so it sits on the FIRST line. An earlier flexbox override
   (display:flex; align-items:center) centred the marker against the whole multi-line
   item — removed so the original first-line alignment is restored. Only nudge the
   marker's vertical offset so it optically centres on the first line. */
[data-theme-slug='droneworks'] .hero-card ul li,
[data-theme-slug='droneworks'] .wp-block-hero :is(.wysiwyg, .increased) ul li {
  display: list-item;
  position: relative;
}
[data-theme-slug='droneworks'] .hero-card ul li::before,
[data-theme-slug='droneworks'] .wp-block-hero :is(.wysiwyg, .increased) ul li::before {
  position: absolute;
  left: 0;
  top: 0;
  /* One text-line tall, anchored to the top of the item. The checkmark badge is drawn
     centered inside this box (background-position:50%), so it sits centered on the
     FIRST line regardless of font-size or how many lines the item wraps to. */
  height: 1.5em;
  align-self: auto;
}

/* 5.2 — TextImage: remove list indent on mobile */
@media (max-width: 768px) {
  [data-theme-slug='droneworks'] .text-image-content ul,
  [data-theme-slug='droneworks'] .text-image-content ol {
    padding-left: 0;
  }
}

/* 6.1 — Hero: suppress card image scale and Swiper slide transition on mobile */
@media (max-width: 767px) {
  [data-theme-slug='droneworks'] .hero-card .hero-card-image {
    transition: none !important;
  }
  [data-theme-slug='droneworks'] .swiper-wrapper {
    transition-timing-function: linear;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-theme-slug='droneworks'] .hero-card .hero-card-image,
  [data-theme-slug='droneworks'] .swiper-wrapper {
    transition: none !important;
  }
}

/* 6.2 — Hero main image: object-position top on mobile so content stays in frame */
@media (max-width: 639px) {
  [data-theme-slug='droneworks'] .hero-main-image {
    object-position: top center;
  }
}

/* 6.3 — Hero/section titles: balanced line wrapping at all screen sizes */
[data-theme-slug='droneworks'] h1.block-title,
[data-theme-slug='droneworks'] h2.block-title {
  text-wrap: balance;
}

/* 7.1/7.2 — Buttons: stronger tap target + full width centered on mobile */
@media (max-width: 767px) {
  [data-theme-slug='droneworks'] .btn:not(.header-login) {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
    width: 100%;
    min-width: 0 !important;
    justify-content: center;
  }
  /* Hero card slider buttons stay compact (not full-width) */
  [data-theme-slug='droneworks'] .hero-card .btn:not(.header-login) {
    width: auto;
    min-width: 0 !important;
  }
}

/* 7.4 — Buttons: suppress CSS ::after arrow when JSX icon span is present;
   pin the JSX icon absolute on the right (matching ::after position) so label stays centered */
[data-theme-slug='droneworks'] .btn-primary.btn--has-icon::after {
  display: none;
}
[data-theme-slug='droneworks'] .btn-icon {
  position: absolute;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  overflow: hidden;
}
[data-theme-slug='droneworks'] .btn-icon svg,
[data-theme-slug='droneworks'] .btn-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* The JSX .btn-icon is pinned absolute at right:1rem (above). Non-primary variants
   must reserve the same right padding the primary button does (btn-primary =
   padding-right:3rem) so the icon clears the centered label instead of hugging it.
   btn-outline otherwise has only padding-inline:2rem, leaving the icon too close to
   the text — this makes its icon spacing match the primary button's arrow. */
[data-theme-slug='droneworks'] .btn-outline.btn--has-icon,
[data-theme-slug='droneworks'] .btn-secondary.btn--has-icon,
[data-theme-slug='droneworks'] .btn-call.btn--has-icon {
  padding-right: 3rem;
}

/* (Removed 2026-06-18: today's TeaserGrid colour overrides — they conflicted with
   the card's own Tailwind classes and broke hover/readability. TeaserGrid colours
   are driven solely by cardClassesFor() again, as before today.) */

/* 8.1 — FAQ decorative arrow-down: override the SVG's intrinsic height so w-10 scales naturally */
[data-theme-slug='droneworks'] .wp-block-faq .lg\:col-span-5 svg[height] {
  height: auto;
}

/* 10.1 — FAQ: answer text in primary-200 navy on light backgrounds */
[data-theme-slug='droneworks'] .wp-block-faq .block-text {
  color: var(--color-primary-200);
}
[data-theme-slug='droneworks'] .theme-primary .wp-block-faq .block-text {
  color: var(--text-body);
}

/* 11.1 — Footer mobile: nav columns fill full width; list always visible */
@media (max-width: 1023px) {
  [data-theme-slug='droneworks'] .footer-item {
    width: 100%;
  }
  [data-theme-slug='droneworks'] details.footer-item[open] .footer-list {
    max-height: none !important;
    overflow: visible !important;
  }
  /* Align sub-items with nav headers: override theme.css clamp(56px…) large indent */
  [data-theme-slug='droneworks'] .footer-list a {
    padding-left: 1rem !important;
  }
}

/* ============================================================================
   Text colour on light-blue surfaces (2026-06-18)
   ========================================================================== */

/* "FQA und über all prüfen das die schriftfarbe auf der hellblauen fläche
   schwarz ist": on light/sky-blue surfaces (theme-light, no dark theme,
   body bg) heading and body text must be the brand navy #0B2639 for max
   legibility. Covers FAQ questions/answers and any other block-text on
   light-palette sections. Dark-theme sections (.theme-primary / .theme-dark)
   are excluded so light text on dark panels is unaffected. */

/* FAQ question text (default state; hover/open accent colour from the
   Tailwind group variant stays intact because it's more specific). */
[data-theme-slug='droneworks'] .wp-block-faq summary div {
  color: #0B2639;
}

/* FAQ answer body and wysiwyg content */
[data-theme-slug='droneworks'] .wp-block-faq .block-text,
[data-theme-slug='droneworks'] .wp-block-faq details > div,
[data-theme-slug='droneworks'] .wp-block-faq .wysiwyg,
[data-theme-slug='droneworks'] .wp-block-faq p,
[data-theme-slug='droneworks'] .wp-block-faq li {
  color: #0B2639;
}

/* General: body text in any non-dark section. The :not() chain excludes dark-themed
   sections AND the TeaserGrid (its cards manage their own colours via cardClassesFor)
   so white text on dark backgrounds / coloured cards is untouched. */
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']):not(.wp-block-teaser-grid) .block-text,
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']):not(.wp-block-teaser-grid) .wysiwyg p,
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']):not(.wp-block-teaser-grid) .wysiwyg li {
  color: #0B2639;
}

/* Restore white text inside dark/accent-coloured cards on NON-teaser sections.
   (TeaserGrid is excluded above and below — it is governed entirely by its own classes.) */
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-accent .block-text,
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-accent .wysiwyg p,
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-accent .wysiwyg li,
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-primary .block-text,
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-primary .wysiwyg p,
[data-theme-slug='droneworks'] section:not(.wp-block-teaser-grid) .theme-primary .wysiwyg li {
  color: inherit;
}

/* ============================================================================
   FAQ accordion arrow rotation (2026-06-18)
   ========================================================================== */

/* Tailwind v4 does not compile group-open:rotate-0, so we use the native
   details[open] attribute selector instead. Closed = ↙ (rotate 180°),
   open = ↗ (rotate 0° = natural SVG direction). The span already carries
   transition-transform so the rotate transition is smooth. */
[data-theme-slug='droneworks'] .wp-block-faq details:not([open]) .rotate-180 {
  rotate: 180deg;
}
[data-theme-slug='droneworks'] .wp-block-faq details[open] .rotate-180 {
  rotate: 0deg;
}

/* Global: override --text-body so ALL elements that inherit section color
   (not just .block-text / .wysiwyg) are dark navy on light backgrounds.
   .theme-primary/.theme-accent already redefine --text-body so they are unaffected. */
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']),
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']) * {
  --text-body: var(--color-primary-200);
}
[data-theme-slug='droneworks'] section:not(.theme-primary):not([class*='theme-dark']) {
  color: #0B2639;
}

/* CMS-selectable DARK card/slide backgrounds applied via the bg-* UTILITY class
   (e.g. KeyFactsScroll slides use .bg-primary-200 / .bg-accent, NOT the .theme-primary
   theme class). Those utilities don't flip the text-colour tokens, and the global rule
   above even forces their nested text dark navy → dark-on-dark / unreadable. Force the
   token-driven text elements to white inside any dark/accent utility background so a
   dark card is always readable, whichever background the editor picks. */
[data-theme-slug='droneworks'] :is(.bg-primary-200, .bg-accent) {
  --text-body: #ffffff;
  --text-heading: #ffffff;
  --color-heading: #ffffff;
}
[data-theme-slug='droneworks'] :is(.bg-primary-200, .bg-accent) :is(.text-heading, .block-title, .block-text, .title-h3, .title-h4, h1, h2, h3, h4, h5, h6, p, li) {
  color: #ffffff !important;
}

/* TeaserGrid cards use the .theme-primary/.bg-primary (and .theme-accent/.bg-accent)
   classes for their dark/accent backgrounds — the same dark-on-dark problem. Force the
   title + body text white on those cards too (the .fake-link keeps its own accent colour;
   the light .theme-light/bg-white card is not matched, so it keeps dark text). */
[data-theme-slug='droneworks'] .wp-block-teaser-grid :is(.theme-primary, .theme-accent, .bg-primary, .bg-accent) :is(.block-title, .block-text, .title-h3, .title-h4, h1, h2, h3, h4, h5, h6, p, li) {
  color: #ffffff !important;
}

/* ============================================================================
   Form: message/notice text size (2026-06-18)
   ========================================================================== */

/* The branded form (.dw-payload-form) renders message blocks (e.g. the
   "Es gilt unsere Datenschutzerklärung." privacy note) as <p>. The theme's global
   fluid `p`/`.wysiwyg` font-size leaked in and blew them up. Keep form copy small. */
[data-theme-slug='droneworks'] .dw-payload-form :is(p, li),
[data-theme-slug='droneworks'] .dw-payload-form .prose-sm :is(p, li) {
  font-size: 0.875rem !important; /* 14px */
  line-height: 1.55 !important;
}

/* Links inside form message blocks (e.g. the Datenschutzerklärung link): same size
   as the surrounding text (the theme's fluid `a` size made them bigger), accent
   colour, and underlined — the global `a:not(.link-initial){text-decoration:none}`
   reset above strips the `underline` utility, so re-assert it here. */
[data-theme-slug='droneworks'] .dw-payload-form a {
  font-size: inherit !important;
  color: var(--color-accent) !important;
  text-decoration-line: underline !important;
  text-underline-offset: 2px;
}

/* ============================================================================
   CtaBanner — mobile uniform blue background (2026-06-18)
   ========================================================================== */

/* "Lesbarkeit schwierig, evtl der Banner einheitlich blau": the hero photo
   behind the CTA text makes body text hard to read on narrow screens.
   On mobile/tablet (< lg = 1024px) cover the background image with a solid
   primary-200 panel via ::before. The layer stack:
     z-0  →  background <img> (stays in DOM, just covered)
     z-2  →  ::before solid-primary overlay  ← this rule
     z-10 →  content grid (text + button, already has z-10 via Tailwind)
   The <section> already has position:relative so ::before anchors correctly. */
@media (max-width: 1023px) {
  [data-theme-slug='droneworks'] .wp-block-cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background-color: var(--color-primary);
  }
}

/* ============================================================================
   Hero — title text-wrap balance (2026-06-18)
   ========================================================================== */

/* "Umbruch an der Stelle" at 2880×1800 and 1496×976: the hero headline breaks
   at an ugly point (long first line, short orphan on the second). text-wrap:balance
   asks the browser to distribute words more evenly across all lines so no single
   line is dramatically shorter than its neighbours. Scoped to the hero block only
   so other headings are unaffected. */
[data-theme-slug='droneworks'] .wp-block-hero .block-title,
[data-theme-slug='droneworks'] .wp-block-hero h1,
[data-theme-slug='droneworks'] .wp-block-hero h2 {
  text-wrap: balance;
}

/* ============================================================================
   Hero — body text 18px on narrow mobile (≤ 480px) (2026-06-18)
   ========================================================================== */

/* The .increased class fluid-scales from 21px (min) to 26px (max). At 360px
   the minimum clamp floor of 21px is already too large; reduce to 18px. */
@media (max-width: 480px) {
  [data-theme-slug='droneworks'] .wp-block-hero :is(.increased, .wysiwyg.increased) p,
  [data-theme-slug='droneworks'] .wp-block-hero :is(.increased, .wysiwyg.increased) li,
  [data-theme-slug='droneworks'] .wp-block-hero :is(.increased, .wysiwyg.increased) a {
    font-size: 1.125rem; /* 18px */
  }
}

/* ============================================================================
   KeyFactsScroll — body text 16px (2026-06-18)
   ========================================================================== */

/* "bitte Schriftgröße anpassen 16px": the card body text in the Key Facts Scroll
   block uses fl-text-base/base-md which fluid-scales up to 18px at wide screens
   (1496px, 2880px). Cap it at exactly 16px (1rem) across all viewports. */
[data-theme-slug='droneworks'] .wp-block-key-facts-scroll .block-text {
  font-size: 1rem !important;
}

/* (Removed 2026-06-18: today's TeaserGrid mobile font-size !important overrides —
   restored to the theme's original responsive sizing, as before today.) */

/* ============================================================================
   OrbitalMosaic — disable scroll animations on mobile (2026-06-18)
   ========================================================================== */

/* All motion in the OrbitalMosaic block is driven by the --progress CSS custom
   property (set by the scroll-progress Stimulus controller). Locking it to 0
   on mobile freezes the drone fade-out and the image-tile fly-out transforms
   so the block renders as a static layout on small screens. */
@media (max-width: 767px) {
  [data-theme-slug='droneworks'] .wp-block-orbital-mosaic [data-controller='scroll-progress'] {
    --progress: 0 !important;
  }
  [data-theme-slug='droneworks'] .wp-block-orbital-mosaic .image-tile {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================================
   Footer background — full viewport width (2026-06-18)
   ========================================================================== */

/* The footer's green background panel (.vc-container-footer-wide) is capped by
   theme.css at max-width:90% (and calc(100% - 23px)) with margin-right:auto,
   so it stops short of the right edge. Make it span the full width.
   Higher specificity ([data-theme-slug] + footer + class) beats theme.css. */
[data-theme-slug='droneworks'] footer .vc-container-footer-wide {
  max-width: 100%;
  width: 100%;
  margin-right: 0;
}

/* ============================================================================
   theme-primary blocks — white headlines (2026-06-18)
   ========================================================================== */

/* On dark-blue (.theme-primary) blocks both --text-heading and --text-body resolve
   to secondary-200 (light blue). Body text should stay light blue, but the headlines
   must be white. Recolour ONLY the heading elements (and the inner <span> that holds
   the visible text) — NOT .pre-title or body copy.
   Scoped to `section.theme-primary` (the block element itself) so TeaserGrid CARDS —
   which are `div.theme-primary` inside a light section — keep their original card
   heading colour (handled by cardClassesFor + the .theme-primary token rule above). */
[data-theme-slug='droneworks'] section.theme-primary :is(.block-title, h1, h2, h3, h4, h5, h6),
[data-theme-slug='droneworks'] section.theme-primary :is(.block-title, h1, h2, h3, h4, h5, h6) span {
  color: #ffffff;
}

/* ============================================================================
   Hero mobile slider — pagination dots spacing (2026-06-18)
   ========================================================================== */

/* The mobile hero card slider pinned its Swiper pagination dots to bottom:0, so
   they overlapped the slide cards. Add bottom padding to the swiper so the dots
   sit in their own space below the slides. Mobile only (the slider is md:hidden);
   scoped to .hero-mobile-slider so the partner-logo marquee is untouched. */
@media (max-width: 767px) {
  [data-theme-slug='droneworks'] .hero-mobile-slider .swiper {
    padding-bottom: 2.25rem;
  }
}

/* ============================================================================
   TeaserGrid card title alignment (2026-06-18)
   ========================================================================== */

/* The global .block-title rule sets text-align:center, which centred the teaser
   CARD title while its body text is left-aligned — looked off, especially on the
   narrow mobile card. Left-align the title (and body) inside teaser cards only.
   Scoped to .wp-block-teaser-grid so section headers elsewhere stay centred. */
[data-theme-slug='droneworks'] .wp-block-teaser-grid .block-title,
[data-theme-slug='droneworks'] .wp-block-teaser-grid .block-text {
  text-align: left;
}
