/*
 Theme Name:   Divi Child Extrabesonders
 Theme URI:    https://extrabesonders.de
 Description:  Divi Child Theme für extrabesonders.de – Custom Styles, Performance-, Robustheits- und Barrierefreiheits-Optimierungen. Ab v7.1.0 zusammengeführt mit der CXO-Fahrzeugsuche (siehe /cxo/). Abwärtskompatibel mit Divi 4 und Divi 5.
 Author:       onlion® Studio
 Author URI:   https://onlion.com/studio/
 Template:     Divi
 Version:      7.4.0
 Text Domain:  divi-child-extrabesonders
*/

/* ==========================================================================
   EXTRABESONDERS – Custom Styles
   Performance • Accessibility • Micro-Interactions
   Vorher: Divi → Theme Options → Custom CSS. Jetzt: Teil des Child Themes –
   versioniert, cache-gebustet über functions.php, überlebt einen Reset der
   Divi Theme Options.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE & PERFORMANCE
   -------------------------------------------------------------------------- */

/* Basis: kein Smooth-Scroll (Standardverhalten, respektiert Bewegungspräferenz) */
html {
  scroll-behavior: auto;
}

/* Verbesserung per Media Query – Reihenfolge ist hier wichtig: diese Regel
   muss NACH der Basis-Regel stehen, sonst gewinnt bei gleicher Spezifität
   die spätere Regel und hebt den Smooth-Scroll wieder für alle auf. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Prevent font synthesis for consistent rendering */
* {
  font-synthesis: none;
}

/* Progressive rendering for marked elements */
[data-lazy-render] {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
  contain: layout style paint;
}

/* Mobile/Firefox: content-visibility:auto kann auf schwächerer Hardware
   bzw. bei Firefox' Rendering-Pfad mehr kosten als bringen. Vorher wurde
   das per JS zur Laufzeit mit einem injizierten <style>-Tag überschrieben
   (xb-body-js: tameExpensive()) – überflüssig, da die Klassen xb-mobile/
   xb-ff bereits synchron im <head> gesetzt werden (siehe Preinit-Snippet),
   bevor dieses Stylesheet überhaupt geparst wird. Eine einfache
   CSS-Regel reicht daher, kein Laufzeit-JS nötig. */
html.xb-mobile [data-lazy-render],
html.xb-ff [data-lazy-render] {
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */

.extra-bold {
  font-family: 'Helvetica Now Display - Bold', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 700;
}

.extra-light {
  font-family: 'Helvetica Now Display - Light', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   3. FORMS & INPUTS
   -------------------------------------------------------------------------- */

/* Hinweis: Diese Selektoren hängen an einer von Divi automatisch vergebenen
   Modul-Instanz-Nummer (_0_). Wird das Formular im Theme Builder verschoben
   oder dupliziert, kann sich die Nummer ändern und die Regel greift ins
   Leere – Elegant Themes hat für WP 6.8+ zeitweise sogar einen Bug bestätigt,
   bei dem diese Nummerierung nicht bei 0 begann. Robuster: eine manuell
   vergebene CSS-Klasse direkt am Modul (Divi → Erweitert → CSS-Klasse)
   statt der Auto-ID verwenden. */
.et_pb_contact_form_0_tb_footer .et-pb-contact-message.et_pb_contact_error_meesage {
  margin-bottom: 2em;
}

.et_pb_contact_form_0_tb_footer .et-pb-contact-message.et_pb_contact_error_meesage ul {
  padding-left: 1em;
  margin: 0;
}

.route-input {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #223a59;
  border-bottom-color: #d1dae1;
  background-color: #223a59;
  color: #d1dae1;
  padding: 1em;
  margin-bottom: 1em;
  font-size: clamp(1rem, 2.5vw, 1.5em);
  font-family: 'Helvetica Now Display - Light', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 300;
  width: 100%;
  min-height: 48px; /* Touch target */
  z-index: 1;
  position: relative;
  letter-spacing: 0.04em;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.route-input:focus {
  outline: none;
  border-color: #a799ff;
  box-shadow: 0 0 0 3px rgba(167, 153, 255, 0.3);
}

.route-input::placeholder {
  color: rgba(209, 218, 225, 0.6);
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */

.map_button,
.route_button {
  display: block;
  width: 100%;
  min-height: 48px; /* Accessibility: touch target */
  padding: 0.7em 1.5em;
  font-size: 1.2em;
  font-family: 'Helvetica Now Display - Bold', Helvetica, Arial, Lucida, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  border-radius: 40px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

.map_button {
  margin-top: 0.5em;
  background-color: #a799ff;
  color: #172d40;
  border: 2px solid transparent;
}

.route_button {
  margin-top: 1em;
  background-color: #3f688c;
  color: #d1dae1;
  border: 2px solid #3f688c;
}

/* Hover states */
/* will-change wird nur während der tatsächlichen Interaktion gesetzt statt
   dauerhaft – vermeidet permanente Compositing-Layer pro Button-Instanz. */
.map_button:hover,
.route_button:hover,
.map_button:focus-visible,
.route_button:focus-visible {
  will-change: transform;
}

.map_button:hover,
.route_button:hover {
  background-color: #9b8eed;
  color: #172d40;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 142, 237, 0.35);
}

/* Active/pressed state */
.map_button:active,
.route_button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(155, 142, 237, 0.25);
}

/* Focus for accessibility */
.map_button:focus-visible,
.route_button:focus-visible {
  outline: 3px solid #a799ff;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .map_button,
  .route_button {
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .map_button:hover,
  .route_button:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   5. IFRAME & EMBEDS
   -------------------------------------------------------------------------- */

.iframe-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f5f5f5;
  border-radius: 8px;
  contain: paint layout;
  transition: height 0.3s ease;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .iframe-wrapper {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   6. GOOGLE MAPS & ROUTE PLANNER
   -------------------------------------------------------------------------- */

.gm-style .gm-style-iw-d {
  color: #172d40;
}

/* --------------------------------------------------------------------------
   7. NAVIGATION
   -------------------------------------------------------------------------- */

.mainnav-overview {
  padding-bottom: .5em !important;
  margin-bottom: 1.5em !important;
  border-bottom: 1px solid #3f688c;
}

.mainnav-contact {
  padding-right: 2em !important;
  margin-right: 2em !important;
  border-right: 1px solid #223a59;
}

/* Submenu styling */
.tippy-box {
  transform: translate3d(5px, -9px, 0);
}

header.et-l--header .nav li ul, .nav li ul {
  border-radius: 0 0 10px 10px !important;
  overflow: hidden;
}

.et_pb_menu_1_tb_header.et_pb_menu .nav li ul {
  border: 0;
}

.et-menu .menu-item-has-children > a:first-child {
  padding-right: 0;
}

.et-menu .menu-item-has-children > a:first-child::after {
  visibility: hidden;
  content: none;
}

@media (max-width: 980px) {
  .et_mobile_menu {
    top: -30px;
  }
}

@media (max-width: 767px) {
  .mainnav-contact {
    padding-right: 1em;
    margin-right: 1em;
    padding-bottom: 2em;
    margin-bottom: 2em;
    border-right: none;
    border-bottom: 1px solid #223a59;
  }
}

/* --------------------------------------------------------------------------
   8. LANGUAGE SWITCH
   -------------------------------------------------------------------------- */

#language a {
  color: #4b4573;
  text-decoration: none;
  transition: color 0.2s ease;
}

#language a:hover,
#language a:focus {
  color: #7066ad;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#language a:focus-visible {
  outline: 2px solid #7066ad;
  outline-offset: 2px;
}

.wpml-ls-legacy-list-horizontal {
  border: 0;
  padding: 0;
  margin: 0;
  clear: both;
}

.wpml-ls-legacy-list-horizontal.wpml-ls-statics-footer {
  margin: 0;
}

.wpml-ls-legacy-list-horizontal.wpml-ls-statics-footer > ul {
  text-align: left;
}

.wpml-ls-item-en .wpml-ls-link {
  padding-left: 0;
}

/* --------------------------------------------------------------------------
   9. LISTS
   -------------------------------------------------------------------------- */

.et_pb_text ol,
.et_pb_text ul {
  padding: 0;
}

#left-area ul,
.entry-content ul,
.et-l--body ul,
.et-l--footer ul,
.et-l--header ul {
  list-style-type: disc;
  padding: 0;
  line-height: 1.6em;
}

/* --------------------------------------------------------------------------
   10. GALLERY & SLIDERS
   -------------------------------------------------------------------------- */

.et_pb_bg_layout_light .et-pb-controllers a {
  background-color: #a799ff;
  opacity: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.et_pb_bg_layout_light .et-pb-controllers a:hover {
  transform: scale(1.2);
}

.et_pb_bg_layout_light .et-pb-controllers .et-pb-active-control {
  background-color: #efe1ce;
  width: 2em;
}

/* Gallery arrows */
.et-pb-arrow-next,
.et-pb-arrow-prev {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* Touch target */
  min-height: 44px;
  font-size: 24px;
  color: #a799ff;
  background-color: rgba(239, 225, 206, 0.25);
  border-radius: 0.5em;
  padding: 0.5em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background-color 0.2s ease,
    transform 0.15s ease,
    color 0.2s ease;
}

.et-pb-arrow-next:hover,
.et-pb-arrow-prev:hover,
.et-pb-arrow-next:focus-visible,
.et-pb-arrow-prev:focus-visible {
  will-change: transform;
}

.et-pb-arrow-next:hover,
.et-pb-arrow-prev:hover {
  background-color: rgba(239, 225, 206, 0.5);
  transform: scale(1.1);
}

.et-pb-arrow-next:focus-visible,
.et-pb-arrow-prev:focus-visible {
  outline: 2px solid #a799ff;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .et-pb-arrow-next {
    border-radius: 0.5em 0 0 0.5em;
  }

  .et-pb-arrow-prev {
    border-radius: 0 0.5em 0.5em 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .et-pb-arrow-next,
  .et-pb-arrow-prev,
  .et_pb_bg_layout_light .et-pb-controllers a {
    transition: none;
  }

  .et-pb-arrow-next:hover,
  .et-pb-arrow-prev:hover,
  .et_pb_bg_layout_light .et-pb-controllers a:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   11. VIDEO OVERLAYS
   -------------------------------------------------------------------------- */

.gradient-overlay {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.gradient-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, #172d40 85%);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY ENHANCEMENTS
   -------------------------------------------------------------------------- */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 1em 2em;
  background: #172d40;
  color: #fff;
  z-index: 10000;
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .skip-to-content {
    transition: none;
  }
}

:focus-visible {
  outline: 2px solid #a799ff;
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   13. PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
  .gradient-overlay::before,
  .et-pb-arrow-next,
  .et-pb-arrow-prev,
  .et-pb-controllers {
    display: none;
  }

  * {
    background: transparent !important;
    color: #000 !important;
  }
}

/* --------------------------------------------------------------------------
   14. BRAND CAROUSSEL
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  #brand-caroussel .et_pb_row,
  #brand-caroussel.et_pb_row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 2em !important;
  }

  #brand-caroussel .et_pb_row > .et_pb_column[class*="et_pb_column_"],
  #brand-caroussel.et_pb_row > .et_pb_column[class*="et_pb_column_"] {
    width: auto !important;
    flex: 0 0 auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

