/*
Theme Name: CATO Divi
Description: Schlankes Child Theme für den CATO-Webauftritt auf Basis von Divi 5.
Author: CATO Ventures GmbH
Template: Divi
Version: 1.2.0
Text Domain: cato-divi
*/

body {
  text-rendering: optimizeLegibility;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
  letter-spacing: -0.028em !important;
  text-wrap: balance;
}

.entry-content p,
.entry-content li {
  text-wrap: pretty;
}

.cato-portrait {
  background: #f8f9fc;
  border: 1px solid rgba(33, 63, 132, 0.10);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(16, 32, 61, 0.08);
  margin: 0 0 24px;
  overflow: hidden;
}

.cato-portrait img {
  aspect-ratio: 1 / 1;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

/*
 * Divi 5.9 erzeugt die responsiven Flex-Klassen, liefert für gängige Brüche wie
 * 1/3 und 1/4 lokal jedoch keine wirksamen Tablet-Regeln aus. Die Module bleiben
 * nativ; dieser enge Fallback verhindert ausschließlich horizontales Abschneiden.
 */
@media (max-width: 980px) {
  .et_flex_row {
    flex-wrap: wrap !important;
  }

  .et_flex_row > .et_flex_column {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/*
 * Global navigation: a calm, product-led B2B header inspired by the spatial
 * clarity of TeamViewer, expressed entirely in the CATO visual language.
 */
body #top-header {
  background: #c3a97e !important;
  border-bottom: 1px solid rgba(33, 63, 132, 0.10);
  box-shadow: none !important;
}

#top-header .container {
  padding-top: 8px;
  padding-bottom: 8px;
}

body #top-header #et-info,
body #top-header #et-info a {
  color: #10203d !important;
  font-family: "Commissioner", sans-serif;
  font-size: 13px;
  font-weight: 500;
}

#main-header {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid rgba(33, 63, 132, 0.12);
  box-shadow: none !important;
}

#main-header.et-fixed-header {
  box-shadow: 0 10px 30px rgba(16, 32, 61, 0.08) !important;
}

#main-header .container {
  max-width: 1380px;
  width: 92%;
}

#logo {
  max-height: 42px;
}

#et_top_search {
  display: none !important;
}

#et-top-navigation {
  padding-left: 48px !important;
}

#top-menu-nav,
#top-menu,
#et-top-navigation {
  position: static;
}

#top-menu > li {
  padding-right: 25px;
}

#top-menu > li.cato-mega-menu {
  position: static;
}

#top-menu > li > a {
  color: #10203d !important;
  font-family: "Lexend Mega", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-bottom: 32px !important;
  padding-top: 32px !important;
  transition: color 180ms ease;
}

#top-menu > li > a:hover,
#top-menu > li.current-menu-item > a,
#top-menu > li.current-menu-ancestor > a {
  color: #365194 !important;
  opacity: 1;
}

#top-menu > li.cato-mega-menu > a {
  align-items: center;
  display: flex;
}

/* Divi reserves ::after for its own menu icon. Suppress that implementation
 * completely and render a real child element so positioning stays testable. */
#top-menu > li.cato-mega-menu > a:first-child::after {
  content: none !important;
  display: none !important;
}

.cato-menu-chevron {
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  display: inline-block;
  flex: 0 0 7px;
  height: 7px;
  margin-left: 9px;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 180ms ease;
  width: 7px;
}

#top-menu > li.cato-mega-menu:hover > a .cato-menu-chevron,
#top-menu > li.cato-mega-menu:focus-within > a .cato-menu-chevron {
  transform: rotate(225deg);
}

#top-menu > li.cato-mega-menu > ul.sub-menu {
  background: #f8f9fc;
  border: 1px solid rgba(33, 63, 132, 0.12);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 24px 55px rgba(16, 32, 61, 0.14);
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 50%;
  padding: 32px;
  top: 100%;
  transform: translateX(-50%);
  width: min(1120px, calc(100vw - 64px));
}

#top-menu > li.cato-menu-products > ul.sub-menu {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(1280px, calc(100vw - 64px));
}

/* Hero image system. The overlay preserves copy contrast at every crop while
 * the page-specific image remains a replaceable theme asset. */
body.cato-page-startseite .entry-content .et_pb_section:first-child,
body.cato-page-cto-as-a-service .entry-content .et_pb_section:first-child,
body.cato-page-ki-automatisierung .entry-content .et_pb_section:first-child,
body.cato-page-performance-by-design .entry-content .et_pb_section:first-child {
  background-color: #10203d !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  min-height: 600px;
}

body.cato-page-cato-autoorder .entry-content .et_pb_section:first-child,
body.cato-page-cato-autobook .entry-content .et_pb_section:first-child,
body.cato-page-cato-automail .entry-content .et_pb_section:first-child,
body.cato-page-cato-autofraud .entry-content .et_pb_section:first-child {
  background-color: #10203d !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  min-height: 600px;
}

body.cato-page-cato-autoorder .entry-content .et_pb_section:first-child { background-image: linear-gradient(90deg, rgba(16,32,61,.98) 0%, rgba(16,32,61,.86) 42%, rgba(16,32,61,.08) 76%), url("assets/images/hero-cato-autoorder.webp") !important; }
body.cato-page-cato-autobook .entry-content .et_pb_section:first-child { background-image: linear-gradient(90deg, rgba(16,32,61,.98) 0%, rgba(16,32,61,.86) 42%, rgba(16,32,61,.08) 76%), url("assets/images/hero-cato-autobook.webp") !important; }
body.cato-page-cato-automail .entry-content .et_pb_section:first-child { background-image: linear-gradient(90deg, rgba(16,32,61,.98) 0%, rgba(16,32,61,.86) 42%, rgba(16,32,61,.08) 76%), url("assets/images/hero-cato-automail.webp") !important; }
body.cato-page-cato-autofraud .entry-content .et_pb_section:first-child { background-image: linear-gradient(90deg, rgba(16,32,61,.98) 0%, rgba(16,32,61,.86) 42%, rgba(16,32,61,.08) 76%), url("assets/images/hero-cato-autofraud.webp") !important; }

body.cato-page-startseite .entry-content .et_pb_section:first-child {
  background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.87) 38%, rgba(16, 32, 61, 0.18) 72%), url("assets/images/hero-home.webp") !important;
}

body.cato-page-cto-as-a-service .entry-content .et_pb_section:first-child {
  background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.86) 40%, rgba(16, 32, 61, 0.12) 73%), url("assets/images/hero-cto.webp") !important;
}

body.cato-page-ki-automatisierung .entry-content .et_pb_section:first-child {
  background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.86) 40%, rgba(16, 32, 61, 0.12) 73%), url("assets/images/hero-ai.webp") !important;
}

body.cato-page-performance-by-design .entry-content .et_pb_section:first-child {
  background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.86) 40%, rgba(16, 32, 61, 0.12) 73%), url("assets/images/hero-performance.webp") !important;
}

.cato-pictogram {
  align-items: center;
  background: #f8f9fc;
  border: 1px solid rgba(33, 63, 132, 0.16);
  border-radius: 8px;
  color: #213f84;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  margin-bottom: 20px;
  width: 48px;
}

.cato-pictogram svg {
  display: block;
  height: 26px;
  width: 26px;
}

/* Conversion and accessibility: compact desktop CTAs, usable touch targets,
 * and a visible keyboard focus state across light and dark surfaces. */
.entry-content .et_pb_button_module_wrapper .et_pb_button {
  align-items: center;
  display: inline-flex !important;
  justify-content: center;
  min-height: 46px;
  padding: 12px 21px !important;
  width: auto !important;
}

.entry-content .et_pb_section:first-child .et_pb_button {
  background: #c3a97e !important;
  border-color: #c3a97e !important;
  color: #10203d !important;
}

.entry-content .et_pb_section:first-child .et_pb_button_module_wrapper {
  display: inline-block !important;
  margin-right: 10px;
  vertical-align: top;
  width: auto !important;
}

body.cato-page-startseite .entry-content .et_pb_section:first-child .et_pb_column {
  display: block !important;
}

.entry-content .et_pb_section:first-child .et_pb_heading_container,
.entry-content .et_pb_section:first-child .et_pb_text_inner {
  max-width: 820px;
}

.entry-content .et_pb_section .et_pb_row + .et_pb_row {
  margin-top: 38px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #add8e7 !important;
  outline-offset: 3px !important;
}

.et_pb_contact_form input,
.et_pb_contact_form textarea,
.et_pb_contact_submit {
  min-height: 48px;
}

.et_pb_contact_form {
  display: grid !important;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.et_pb_contact_form .et_pb_contact_field {
  flex-basis: auto !important;
  margin: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  width: auto !important;
}

.et_pb_contact_form .et_pb_contact_field[data-id="nachricht"],
.et_pb_contact_form .et_contact_bottom_container {
  grid-column: 1 / -1;
}

.et_pb_contact_form .et_contact_bottom_container {
  float: none;
  margin-top: 4px;
  text-align: right;
}

#et-footer-nav,
#footer-bottom {
  background: #10203d !important;
}

#et-footer-nav .container,
#footer-bottom .container {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.bottom-nav {
  padding: 20px 0;
}

.bottom-nav li {
  padding-right: 26px;
}

.bottom-nav a,
#footer-info {
  color: #f8f9fc !important;
  font-family: "Commissioner", sans-serif;
  font-size: 14px;
}

.bottom-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

#top-menu > li.cato-mega-menu > ul.sub-menu::before {
  color: #365194;
  content: "CATO LEISTUNGEN";
  font-family: "Lexend Mega", sans-serif;
  font-size: 11px;
  font-weight: 700;
  grid-column: 1 / -1;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

#top-menu > li.cato-menu-products > ul.sub-menu::before {
  content: "CATO PRODUKTE";
}

#top-menu > li.cato-mega-menu > ul.sub-menu > li {
  padding: 0;
  width: auto;
}

#top-menu > li.cato-mega-menu > ul.sub-menu > li > a {
  background: #fff;
  border: 1px solid rgba(33, 63, 132, 0.12);
  border-radius: 6px;
  color: #10203d !important;
  display: block;
  font-family: "Lexend Mega", sans-serif;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  min-height: 178px;
  padding: 24px !important;
  position: relative;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  width: 100%;
}

.cato-menu-description,
.cato-menu-action {
  display: block;
  font-family: "Commissioner", sans-serif;
}

.cato-menu-description {
  color: #10203d;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  margin-top: 12px;
}

.cato-menu-action {
  bottom: 20px;
  color: #365194;
  font-size: 14px;
  font-weight: 600;
  left: 24px;
  position: absolute;
}

#top-menu > li.cato-mega-menu > ul.sub-menu > li > a:hover,
#top-menu > li.cato-mega-menu > ul.sub-menu > li > a:focus-visible {
  border-color: #add8e7;
  box-shadow: 0 14px 30px rgba(33, 63, 132, 0.10);
  opacity: 1;
  transform: translateY(-2px);
}

#top-menu > li.cato-nav-cta {
  padding-right: 10px;
}

#top-menu > li.cato-nav-cta > a {
  align-items: center;
  background: #213f84;
  border: 1px solid #213f84;
  border-radius: 6px;
  box-sizing: border-box;
  color: #fff !important;
  display: flex;
  margin-top: 18px;
  min-height: 44px;
  padding: 13px 20px !important;
}

@media (max-width: 1199px) {
  #top-menu-nav { display: none !important; }
  #et_mobile_nav_menu { display: block !important; }
  #et-top-navigation { padding-left: 0 !important; }
  #top-header { display: none !important; }
  #main-header { top: 0 !important; }
  .mobile_menu_bar::before { color: #213f84 !important; }
  .mobile_menu_bar { box-sizing: border-box; min-width: 44px; width: 44px; }
  .et_mobile_menu { background: #fff !important; border-top: 2px solid #213f84; box-shadow: 0 20px 40px rgba(16,32,61,.14); box-sizing: border-box; padding: 14px 5% 24px; width: 100%; }
  .et_mobile_menu li a { border-bottom: 1px solid rgba(33,63,132,.10); color: #10203d !important; font-family: "Lexend Mega", sans-serif; font-size: 13px; font-weight: 600; padding: 15px 4%; }
  .et_mobile_menu .sub-menu { padding-left: 0; }
  .et_mobile_menu .cato-offer-item a { background: #f8f9fc; border-radius: 5px; margin: 7px 0; padding: 15px 18px; }
  .et_mobile_menu .cato-menu-description { font-family: "Commissioner", sans-serif; font-size: 13px; font-weight: 400; margin-top: 7px; }
  .et_mobile_menu .cato-menu-action { bottom: auto; left: auto; margin-top: 8px; position: static; }
  .et_mobile_menu .cato-nav-cta a { background: #213f84; border-radius: 6px; color: #fff !important; margin-top: 16px; text-align: center; }
  .et_mobile_menu .cato-menu-chevron { display: none; }
}

#top-menu > li.cato-nav-cta > a:hover,
#top-menu > li.cato-nav-cta.current-menu-item > a {
  background: #365194;
  border-color: #365194;
  color: #fff !important;
}

@media (max-width: 1180px) and (min-width: 981px) {
  #top-menu > li {
    padding-right: 15px;
  }

  #top-menu > li > a {
    font-size: 11px;
  }
}

@media (max-width: 980px) {
  #top-header {
    display: none !important;
  }

  #main-header {
    top: 0 !important;
  }

  #main-header .container {
    width: 90%;
  }

  #logo {
    max-height: 36px;
  }

  .mobile_menu_bar::before {
    color: #213f84 !important;
  }

  .mobile_menu_bar {
    box-sizing: border-box;
    min-width: 44px;
    width: 44px;
  }

  .et_mobile_menu {
    background: #fff !important;
    border-top: 2px solid #213f84;
    box-shadow: 0 20px 40px rgba(16, 32, 61, 0.14);
    padding: 14px 5% 24px;
    box-sizing: border-box;
    width: 100%;
  }

  .et_mobile_menu li a {
    border-bottom: 1px solid rgba(33, 63, 132, 0.10);
    color: #10203d !important;
    font-family: "Lexend Mega", sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 15px 4%;
  }

  .et_mobile_menu .sub-menu {
    padding-left: 0;
  }

  .et_mobile_menu .cato-service-item a {
    background: #f8f9fc;
    border-radius: 5px;
    margin: 7px 0;
    padding: 15px 18px;
  }

  .et_mobile_menu .cato-nav-cta a {
    background: #213f84;
    border-radius: 6px;
    color: #fff !important;
    margin-top: 16px;
    text-align: center;
  }

  .et_mobile_menu .cato-menu-chevron {
    display: none;
  }

  .et_pb_contact_form {
    grid-template-columns: 1fr;
  }

  .et_pb_contact_form .et_pb_contact_field[data-id="nachricht"],
  .et_pb_contact_form .et_contact_bottom_container {
    grid-column: 1;
  }

  body.cato-page-startseite .entry-content .et_pb_section:first-child,
  body.cato-page-cto-as-a-service .entry-content .et_pb_section:first-child,
  body.cato-page-ki-automatisierung .entry-content .et_pb_section:first-child,
  body.cato-page-performance-by-design .entry-content .et_pb_section:first-child {
    background-position: 68% center !important;
    min-height: 520px;
  }

  body.cato-page-cato-autoorder .entry-content .et_pb_section:first-child,
  body.cato-page-cato-autobook .entry-content .et_pb_section:first-child,
  body.cato-page-cato-automail .entry-content .et_pb_section:first-child,
  body.cato-page-cato-autofraud .entry-content .et_pb_section:first-child {
    background-position: 68% center !important;
    min-height: 520px;
  }

  body.cato-page-startseite .entry-content .et_pb_section:first-child,
  body.cato-page-cto-as-a-service .entry-content .et_pb_section:first-child,
  body.cato-page-ki-automatisierung .entry-content .et_pb_section:first-child,
  body.cato-page-performance-by-design .entry-content .et_pb_section:first-child {
    background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.88) 58%, rgba(16, 32, 61, 0.42) 100%), var(--cato-hero-image) !important;
  }

  body.cato-page-cato-autoorder .entry-content .et_pb_section:first-child,
  body.cato-page-cato-autobook .entry-content .et_pb_section:first-child,
  body.cato-page-cato-automail .entry-content .et_pb_section:first-child,
  body.cato-page-cato-autofraud .entry-content .et_pb_section:first-child {
    background-image: linear-gradient(90deg, rgba(16, 32, 61, 0.98) 0%, rgba(16, 32, 61, 0.88) 58%, rgba(16, 32, 61, 0.42) 100%), var(--cato-hero-image) !important;
  }

  body.cato-page-startseite { --cato-hero-image: url("assets/images/hero-home.webp"); }
  body.cato-page-cto-as-a-service { --cato-hero-image: url("assets/images/hero-cto.webp"); }
  body.cato-page-ki-automatisierung { --cato-hero-image: url("assets/images/hero-ai.webp"); }
  body.cato-page-performance-by-design { --cato-hero-image: url("assets/images/hero-performance.webp"); }
  body.cato-page-cato-autoorder { --cato-hero-image: url("assets/images/hero-cato-autoorder.webp"); }
  body.cato-page-cato-autobook { --cato-hero-image: url("assets/images/hero-cato-autobook.webp"); }
  body.cato-page-cato-automail { --cato-hero-image: url("assets/images/hero-cato-automail.webp"); }
  body.cato-page-cato-autofraud { --cato-hero-image: url("assets/images/hero-cato-autofraud.webp"); }

  .entry-content .et_pb_section .et_pb_row + .et_pb_row {
    margin-top: 34px;
  }

  #et-footer-nav .container,
  #footer-bottom .container {
    display: block;
    text-align: center;
  }

  .bottom-nav li {
    display: inline-block;
    padding: 0 10px;
  }

  #footer-info {
    float: none;
    padding: 14px 0 20px;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .entry-content .et_pb_section:first-child .et_pb_button_module_wrapper {
    display: block !important;
    margin-right: 0;
    width: 100% !important;
  }

  .entry-content h1,
  .entry-content h2,
  .entry-content h3,
  .entry-content .et_pb_button {
    hyphens: auto;
    max-width: 100%;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: normal;
  }

  .entry-content .et_pb_button_module_wrapper .et_pb_button {
    min-width: min(100%, 280px);
  }
}
