/**
 * MH24 Herbst – Kontrast & Mobilfix v1.0.1
 * Ergänzung zum saisonalen Farbschema; kein Ersatz des Themes.
 * Kontrastwerte (WCAG 2.2, normaler Text):
 *   Creme #F6F1E7 auf Grün #2F5D43: 6.74:1
 *   helles Sandgold #F4D39F auf Grün #2F5D43: 5.30:1
 *   Weiß auf dunklem Kürbis #A85420: 5.31:1
 * Kein #D6A64D als normaler Text auf #2F5D43 (nur 3.4:1).
 */

body.mh24-season-herbst {
  --mh24-kmf-green: #2F5D43;
  --mh24-kmf-green-dark: #244734;
  --mh24-kmf-cream: #F6F1E7;
  --mh24-kmf-gold-accessible: #F4D39F;
  --mh24-kmf-orange: #A85420;
  --mh24-kmf-orange-hover: #863D18;
  --mh24-kmf-ink: #5A3B2A;
  --mh24-kmf-border: #A99C89;
  --mh24-kmf-surface: #FFFDF9;
}

/* 1 – Critical fix: the existing theme paints header text dark over dark green.
 * Restrict to the actual MH24 frontend header, excluding the WP admin bar.
 * Use !important only where the theme/other MH24 styles override colors.
 */
body.mh24-season-herbst .site-header.mh24-site-header,
body.mh24-season-herbst .mh24-site-header .mh24-header-top,
body.mh24-season-herbst .mh24-site-header .mh24-header-bottom,
body.mh24-season-herbst .mh24-site-header .main-nav {
  background-color: var(--mh24-kmf-green) !important;
  color: var(--mh24-kmf-cream) !important;
}

body.mh24-season-herbst .mh24-site-header :is(
  .brand, .mh24-site-brand, .mh24-site-wordmark,
  .mh24-site-wordmark a, .mh24-site-login, .header-action,
  .mh24-header-heart, .mh24-header-icon
),
body.mh24-season-herbst .mh24-site-header :is(
  .main-nav, .mh24-site-nav, .nav-menu, .mh24-header-top,
  .mh24-header-bottom, .mh24-site-actions
) a:where(:not(.mh24-site-add):not(.mh24-site-login-button):not(.mh24-dashboard-button)),
body.mh24-season-herbst .mh24-site-header .nav-menu > li > a,
body.mh24-season-herbst .mh24-site-header .nav-menu > li > a :is(span, strong, small) {
  color: var(--mh24-kmf-cream) !important;
}

/* Wordmark is rendered using theme-specific fill/gradient effects. */
body.mh24-season-herbst .mh24-site-header .mh24-site-wordmark {
  -webkit-text-fill-color: var(--mh24-kmf-cream) !important;
  text-shadow: 0 1px 1px rgba(0,0,0,.16);
}
body.mh24-season-herbst .mh24-site-header :is(.mh24-brand-twentyfour, .mh24-brand-twentyfour *) {
  color: #FFD49A !important;
  -webkit-text-fill-color: #FFD49A !important;
}
body.mh24-season-herbst .mh24-site-header .mh24-site-brand :is(small, .tagline, .brand-tagline, .mh24-site-tagline, .mh24-brand-subtitle) {
  color: var(--mh24-kmf-cream) !important;
  -webkit-text-fill-color: var(--mh24-kmf-cream) !important;
}

/* SVG icons inherit the header's foreground rather than a hard-coded dark stroke. */
body.mh24-season-herbst .mh24-site-header :is(.mh24-header-icon, .mh24-site-actions a, .mh24-site-actions button) svg {
  color: var(--mh24-kmf-cream) !important;
  stroke: currentColor;
}
body.mh24-season-herbst .mh24-site-header :is(.mh24-header-icon, .mh24-site-actions a, .mh24-site-actions button) svg [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
}

/* Header navigation: high-contrast active / hover state (not low-contrast ochre). */
body.mh24-season-herbst .mh24-site-header :is(
  .main-nav, .mh24-site-nav, .nav-menu
) :is(a:hover, a:focus-visible, a[aria-current="page"]):not(.mh24-site-add),
body.mh24-season-herbst .mh24-site-header .nav-menu :is(
  .current-menu-item, .current_page_item, .current-menu-ancestor
) > a,
body.mh24-season-herbst .mh24-site-header .nav-menu :is(
  .current-menu-item, .current_page_item, .current-menu-ancestor
) > a :is(span, strong) {
  color: var(--mh24-kmf-gold-accessible) !important;
  text-decoration-thickness: .12em;
  text-underline-offset: .25em;
}
body.mh24-season-herbst .mh24-site-header .nav-menu > li > a:hover,
body.mh24-season-herbst .mh24-site-header .nav-menu > li > a:focus-visible {
  text-decoration: underline !important;
}

/* Dropdown menus must have a compatible dark background. */
body.mh24-season-herbst .mh24-site-header :is(
  .sub-menu, .mh24hc-experiences-submenu, .mh24hc-experiences-dropdown
) {
  background: var(--mh24-kmf-green-dark) !important;
  color: var(--mh24-kmf-cream) !important;
}
body.mh24-season-herbst .mh24-site-header :is(
  .sub-menu, .mh24hc-experiences-submenu, .mh24hc-experiences-dropdown
) a {
  color: var(--mh24-kmf-cream) !important;
}

/* Real button colors remain separate from ordinary header links. */
body.mh24-season-herbst .mh24-site-header :is(.mh24-site-add, .btn-primary, .header-cta) {
  background: var(--mh24-kmf-orange) !important;
  border-color: var(--mh24-kmf-orange) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
body.mh24-season-herbst .mh24-site-header :is(.mh24-site-add, .btn-primary, .header-cta):hover {
  background: var(--mh24-kmf-orange-hover) !important;
  border-color: var(--mh24-kmf-orange-hover) !important;
}
/* The dashboard's white button must retain readable dark text. */
body.mh24-season-herbst .mh24-site-header :is(.mh24-dashboard-button, .button-white) {
  background: #fff !important;
  color: var(--mh24-kmf-green-dark) !important;
  -webkit-text-fill-color: var(--mh24-kmf-green-dark) !important;
}

/* 2 – Dark hero pages and buttons: robust colors on subpages. */
body.mh24-season-herbst :is(
  .archive-hero, .mh24-operator-hero, .mh24-betreiber-hero
) {
  background-color: var(--mh24-kmf-green) !important;
  color: var(--mh24-kmf-cream) !important;
}
body.mh24-season-herbst :is(
  .archive-hero, .mh24-operator-hero, .mh24-betreiber-hero
) :is(h1, h2, h3, p, .kicker, .eyebrow, .subtitle, .section-subtitle) {
  color: var(--mh24-kmf-cream) !important;
}
body.mh24-season-herbst :is(
  .mh24-home-search-submit, .mh24-filters .btn-primary,
  .mh24nl-formbox button[type="submit"],
  .mh24nl-formbox input[type="submit"]
) {
  background-color: var(--mh24-kmf-orange) !important;
  border-color: var(--mh24-kmf-orange) !important;
  color: #fff !important;
}
body.mh24-season-herbst :is(
  .mh24-home-search-submit, .mh24-filters .btn-primary,
  .mh24nl-formbox button[type="submit"],
  .mh24nl-formbox input[type="submit"]
):hover {
  background-color: var(--mh24-kmf-orange-hover) !important;
  border-color: var(--mh24-kmf-orange-hover) !important;
}

/* 3 – Form labels and borders on light panels. */
body.mh24-season-herbst :is(
  .mh24-home-search, .mh24-filters, .mh24nl-formbox,
  .mh24-dashboard, .mh24-betreiber-dashboard
) :is(label, legend, .mh24nl-email-label) {
  color: var(--mh24-kmf-green-dark) !important;
}
body.mh24-season-herbst :is(
  .mh24-home-search, .mh24-filters, .mh24nl-formbox,
  .mh24-dashboard, .mh24-betreiber-dashboard
) :is(input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background-color: #fff;
  color: var(--mh24-kmf-ink);
  border: 1px solid var(--mh24-kmf-border);
}
body.mh24-season-herbst :is(input, textarea)::placeholder {
  color: #6B5B4B;
  opacity: 1;
}

/* Newsletter secondary text is not allowed to fade against cream. */
body.mh24-season-herbst .mh24nl-wrap :is(
  .mh24nl-small, .mh24nl-legal, .mh24nl-consent, p
) {
  color: #5A3B2A;
}
body.mh24-season-herbst .mh24nl-wrap a {
  color: var(--mh24-kmf-green-dark);
  text-decoration: underline;
  text-underline-offset: .15em;
}

/* 4 – Consistent visible keyboard focus and target sizing across all seasons.
 * We deliberately include non-autumn seasons to prevent accessibility regressions.
 */
body.mh24-es10 :is(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 3px solid #A85420 !important;
  outline-offset: 3px !important;
}
body.mh24-es10 :is(.mh24-site-header, .mh24-site-footer)
  :is(a, button, [role="button"], summary):focus-visible {
  outline-color: #F4D39F !important;
}
body.mh24-es10 .skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100001;
  background: #fff;
  color: #244734 !important;
  padding: 12px 18px;
  outline: 3px solid #A85420 !important;
  text-decoration: underline;
}
body.mh24-es10 :is(
  .mh24-home-search, .mh24-filters, .mh24nl-formbox,
  .mh24-site-header, .mh24-site-footer
) :is(button, input[type="submit"], select, [role="button"]) {
  min-height: 44px;
}
body.mh24-es10 .mh24-site-header :is(.mh24-header-icon, .menu-toggle, .nav-toggle) {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 5 – Mobile: only structural fixes on narrow screens. Preserve hero graphics.
 * No global overflow:hidden and no forced desktop navbar display.
 */
@media (max-width: 767px) {
  body.mh24-es10 :is(#main, .container, .mh24-home-search-wrap, .mh24nl-inner, .mh24-footer-inner) {
    max-width: 100%;
    min-width: 0;
  }
  body.mh24-es10 :is(.mh24-home-search, .mh24-filters, .find-form.mh24-filters) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.mh24-es10 :is(.mh24-home-search, .mh24-filters) :is(
    .mh24-home-search-field, .mh24hc-side-field, .field,
    input:not([type="checkbox"]):not([type="radio"]), select, textarea
  ) {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.mh24-es10 :is(.mh24-home-search-submit, .mh24-filters .btn-primary) {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
  }
  body.mh24-es10 .mh24-site-header :is(.mh24-header-top, .mh24-header-bottom) {
    max-width: 100%;
    min-width: 0;
  }
  /* Keep long navigation from creating horizontal scrolling if the theme
     uses wrapping links instead of a hamburger menu on some breakpoints. */
  body.mh24-es10 .mh24-site-header :is(.mh24-header-top, .mh24-site-actions, .nav-menu) {
    flex-wrap: wrap;
  }
  body.mh24-es10 .mh24-site-header .nav-menu a {
    white-space: normal;
  }
  body.mh24-es10 .mh24-site-header :is(.mh24-site-brand, .mh24-site-actions) {
    min-width: 0;
  }
  body.mh24-es10 .mh24-site-footer .mh24-footer-col {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 540px) {
  /* Works whether the existing theme uses CSS grid or flexbox here. */
  body.mh24-es10 .mh24-home-search {
    grid-template-columns: minmax(0, 1fr) !important;
    flex-direction: column;
  }
  body.mh24-es10 .mh24-home-search > :is(
    .mh24-home-search-field, .mh24hc-side-fields,
    .mh24hc-side-field, .mh24-home-search-submit
  ) {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
  body.mh24-es10 .mh24nl-email-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  body.mh24-es10 .mh24nl-email-row :is(input[type="email"], button, input[type="submit"]) {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 44px;
  }
  body.mh24-es10 .mh24-site-footer .mh24-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  body.mh24-es10 .mh24-site-header .mh24-site-wordmark {
    max-width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.mh24-es10 :is(a, button, input, select, textarea) {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* 6 – v1.0.1: Operator invitation on the home page.
 * The real ES10 page does not use the .mh24-operator-hero classes previously
 * targeted. JS identifies the exact home section by its rendered German copy
 * and assigns .mh24-kmf-operator-cta, avoiding brittle guesses about theme
 * versions or a site-wide h2 color override.
 */
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta {
  --mh24-kmf-operator-bg: #28543B;
  background: var(--mh24-kmf-operator-bg) !important;
  color: #F6F1E7 !important;
}
/* Reset theme text gradients, dark text fills and inherited opacity that can
 * defeat ordinary 'color' overrides on the CTA title and its copy. */
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta :is(
  h1, h2, h3, h4, h5, h6, p, .subtitle, .description, .section-subtitle,
  .mh24-cta-description, .mh24-home-cta-description
),
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta :is(
  h1, h2, h3, h4, h5, h6, p
) :is(span, strong, b) {
  color: #F6F1E7 !important;
  -webkit-text-fill-color: #F6F1E7 !important;
  opacity: 1 !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  mix-blend-mode: normal !important;
}
/* Maintain the existing warm gold emphasis but avoid dark orange on green. */
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta :is(
  .kicker, .eyebrow, .overline, .section-kicker, [class*="eyebrow"],
  [class*="kicker"]
),
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta :is(
  h1, h2, h3, h4
) :is(em, i, [class*="accent"], [class*="highlight"]) {
  color: #F4D39F !important;
  -webkit-text-fill-color: #F4D39F !important;
  opacity: 1 !important;
  background-image: none !important;
}
/* The cream CTA on the right must stay dark-text-on-light, including spans. */
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="betreiber"],
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="dashboard"],
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta .btn {
  background-color: #FFF4DE !important;
  border-color: #FFF4DE !important;
  color: #244734 !important;
  -webkit-text-fill-color: #244734 !important;
}
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="betreiber"] :is(span, strong, b, em, i, svg),
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="dashboard"] :is(span, strong, b, em, i, svg) {
  color: #244734 !important;
  -webkit-text-fill-color: #244734 !important;
}
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="betreiber"]:hover,
body.home.mh24-season-herbst main section.mh24-kmf-operator-cta a[href*="dashboard"]:hover {
  background-color: #F4D39F !important;
  border-color: #F4D39F !important;
}
/* v1.0.1: The muted card category/eyebrow is low-contrast on a cream card. */
body.mh24-season-herbst .listing-card :is(
  .eyebrow, .card-place, .card-footer, .card-footer span,
  .card-footer small, .card-footer time
) {
  color: #5A3B2A !important;
  -webkit-text-fill-color: #5A3B2A !important;
  opacity: 1 !important;
}
body.mh24-season-herbst .listing-card .card-footer a {
  color: #244734 !important;
  -webkit-text-fill-color: #244734 !important;
  text-decoration: underline;
  text-underline-offset: .16em;
}
