/*
 * Ergänzungen für Tablet und Smartphone sowie Hilfsklassen.
 * Oberhalb von 1000 px Breite gilt unverändert das Original-Layout aus style.css.
 */

/* ---- Hilfselemente (alle Größen) ------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 8px 14px;
  background: #fff;
  color: #503D26;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

.menu-toggle {
  display: none;
}

/* Kopfbild (Slider) skaliert über die Variable --slide-scale, die site.js setzt */
#slide-wrapper {
  height: calc(490px * var(--slide-scale, 1));
}

#slideshow {
  position: relative;
  left: 50%;
  margin-left: -500px;
  margin-right: 0;
  transform: scale(var(--slide-scale, 1));
  transform-origin: 50% 0;
}

/* Fußbereich: Quellformatierung der Tabelle (früher Attribute im HTML) */
.footer-table {
  width: 95%;
  margin: 0 auto;
  border-collapse: collapse;
}

.footer-table td {
  height: 20px;
  vertical-align: middle;
  text-align: left;
}

.footer-table .footer-facebook {
  text-align: center;
  width: 250px;
}

.footer-table .footer-partner {
  text-align: center;
  vertical-align: top;
  width: 152px;
}

.footer-table .footer-partner a {
  display: block;
}

.footer-table img {
  max-width: 100%;
  height: auto;
}

.hosting-trenner {
  margin: 0 6px;
  color: #fff;
}

#main #hosting .hosting-inhalt a.cookie-settings-link {
  font-weight: bold;
  text-decoration: underline;
}

/* Schnellanfrage (früher Tabelle) */
#main #inhalt #anfrage #schnellanfrage {
  display: flex;
  align-items: center;
  height: auto;
  min-height: 30px;
  box-sizing: border-box;
  width: 760px;
  margin: 0 40px 15px 180px;   /* links bleibt Platz für die Beschriftung "Schnellanfrage" im Hintergrundbild */
  padding: 10px;
}

#schnellanfrage-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
}

#schnellanfrage .sq-field {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#schnellanfrage .sq-submit {
  margin-left: auto;
}

#schnellanfrage input[type="text"],
#schnellanfrage input[type="email"] {
  border: 1px solid #706458;
  padding: 1px;
  height: 20px;
  box-sizing: border-box;
  text-align: center;
  color: #503D26;
}

#schnellanfrage input[type="text"] {
  width: 80px;
}

#schnellanfrage input[type="email"] {
  width: 175px;
}

#schnellanfrage img.ui-datepicker-trigger {
  position: relative;
  left: 2px;
  top: 2px;
  cursor: pointer;
}

/* ---- bis 1000 px: Layout wird flexibel ------------------------------------ */

@media (max-width: 1000px) {
  #header,
  #main #inhalt,
  #main #hosting {
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
  }

  #header .butterfly {
    left: -20px;
  }

  #menu {
    right: 0;
    width: auto;
  }

  #main #inhalt #anfrage {
    width: auto;
    height: auto;
    min-height: 65px;
    background-color: #FFDC80;
    background-image: none;
  }

  #main #inhalt #anfrage #schnellanfrage {
    width: auto;
    margin: 0;
    padding: 18px 20px 12px;
    flex-wrap: wrap;
  }

  #main #inhalt #content {
    float: none;
    width: auto;
    padding: 20px 30px 30px 50px;
    box-sizing: border-box;
  }

  #main #footer {
    float: none;
    width: auto;
    height: auto;
    padding: 20px 20px 30px;
    box-sizing: border-box;
  }

  #main #hosting {
    background-size: cover;
    height: auto;
    min-height: 60px;
  }

  #main #hosting .hosting-inhalt {
    padding: 10px 20px;
  }

  .csc-textpic-intext-right .csc-textpic-imagewrap {
    max-width: 50%;
  }
}

/* ---- bis 860 px: Menü wird zur Schaltfläche --------------------------------- */

@media (max-width: 860px) {
  #main-header {
    height: auto;
  }

  #main-header #header {
    height: 140px;
  }

  .mainnav li.end a {
    padding: 12px 20px;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    right: 12px;
    top: 84px;
    z-index: 300;
    padding: 8px 18px;
    border: 1px solid #8E714D;
    border-radius: 4px;
    background: #FFEFC6;
    color: #503D26;
    font: bold 16px/1.2 Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
    cursor: pointer;
  }

  #menu {
    display: none;
    position: absolute;
    top: 130px;
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: auto;
    z-index: 290;
    background: #FFEFC6;
    border-top: 3px solid #D1BDA5;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }

  #menu.is-open {
    display: block;
  }

  .mainnav li {
    float: none;
    display: block;
  }

  .mainnav li a {
    float: none;
    display: block;
    height: auto;
    line-height: 1.3;
    padding: 12px 20px;
    font-size: 17px;
    border-bottom: 1px solid #FFDC80;
  }

  .mainnav li ul,
  .mainnav li:hover ul {
    position: static;
    display: block !important;
    visibility: visible !important;
  }

  .mainnav li ul li a,
  .mainnav li.sub ul li a,
  .mainnav li ul li.end a {
    width: auto;
    height: auto;
    line-height: 1.3;
    padding: 10px 20px 10px 40px;
    font-size: 15px;
    background-color: #FFF8E1;
  }

  li.border-bottom {
    display: none;
  }

  #main #inhalt #content {
    padding: 20px 20px 30px;
  }

  .csc-textpic-intext-right .csc-textpic-imagewrap,
  .csc-textpic-intext-left .csc-textpic-imagewrap {
    float: none;
    max-width: 100%;
    margin: 0 0 15px;
  }

  .csc-textpic-intext-right dl.csc-textpic-image {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- bis 600 px: Smartphone ------------------------------------------------ */

@media (max-width: 600px) {
  h1 {
    font-size: 30px;
  }

  #schnellanfrage-form {
    flex-wrap: wrap;
  }

  #schnellanfrage .sq-field {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  #schnellanfrage .sq-field label {
    min-width: 70px;
  }

  #schnellanfrage .sq-field input[type="text"],
  #schnellanfrage .sq-field input[type="email"] {
    flex: 1 1 auto;
    width: auto;
    height: 32px;
    font-size: 16px;
  }

  #schnellanfrage .sq-submit {
    margin: 4px 0 0;
    flex: 1 1 100%;
  }

  #schnellanfrage .sq-submit .ui-button {
    width: 100%;
    padding: 6px 0;
  }

  /* Tabellen im Inhalt werden untereinander angeordnet */
  table.contenttable,
  table.contenttable tbody,
  table.contenttable tr,
  table.contenttable td,
  table.contenttable th {
    display: block;
    width: auto;
  }

  table.contenttable td.ta-center {
    text-align: left;
  }

  table.contenttable td,
  table.contenttable th {
    padding: 6px 4px;
  }

  #content table.contenttable:has(th) th,
  #content table.contenttable:has(th) td {
    border-width: 0 0 1px;
  }

  .embed-consent iframe {
    height: 380px;
  }

  /* Fußbereich untereinander */
  .footer-table,
  .footer-table tbody,
  .footer-table tr,
  .footer-table td {
    display: block;
    width: auto;
  }

  .footer-table td {
    height: auto;
    padding: 2px 0;
  }

  .footer-table .footer-label {
    display: inline;
    padding: 0 4px 0 0;
  }

  .footer-table tr {
    margin-bottom: 6px;
  }

  .footer-table .footer-facebook,
  .footer-table .footer-partner {
    width: auto;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
