/* MASTER Immobiliengesellschaft mbH – One-Pager
   Design nach master.de (Farben, Schriften, Abstände aus dem Original-Theme übernommen) */

/* ---------- Schriften (selbst gehostet, keine Verbindung zu Google) ---------- */
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/open-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/open-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/open-sans-condensed-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/montserrat-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/pt-sans-latin-700-normal.woff2') format('woff2');
}

/* ---------- Grundlagen ---------- */
:root {
  --dark: #1c252c;
  --grey: #8a9094;
  --red: #fe0006;
  --line: #e5e4e3;
  --white: #ffffff;
  --header-h: 137px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--dark);
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: 'Open Sans Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dark);
  margin: 0;
}

p {
  margin: 0 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--dark);
  text-align: center;
}

.site-header .logo {
  display: inline-block;
  margin: 17px 0;
}

.site-header .logo img {
  width: 160px;
  height: 60px;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 45px;
}

.main-nav a {
  display: block;
  height: 40px;
  line-height: 40px;
  border-top: 3px solid transparent;
  color: var(--grey);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
  color: var(--white);
  border-top-color: var(--white);
}

.nav-toggle {
  display: none;
  position: absolute;
  left: 15px;
  top: 25px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 30px;
  height: 3px;
  margin: 0 auto;
  background: var(--grey);
  position: relative;
  transition: transform 0.2s;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -9px;
}

.nav-toggle span::after {
  top: 9px;
}

/* ---------- Kontakt-Laschen (rechts, wie Original) ---------- */
.master-contact a {
  position: fixed;
  z-index: 1100;
  color: var(--white);
  padding: 10px;
  width: 75px;
  bottom: 0;
  text-align: center;
  font-size: 15px;
  white-space: nowrap;
  transition: right 0.5s;
}

.master-contact .mail {
  left: 0;
  background: var(--dark);
}

.master-contact .phone {
  left: 75px;
  background: var(--red);
}

.master-contact svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  vertical-align: middle;
}

.master-contact span {
  display: none;
}

/* ---------- Slider ---------- */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 400px;
  overflow: hidden;
  background: var(--dark);
}

.hero .slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.hero .slide.is-active {
  opacity: 1;
  visibility: visible;
}

.slide-content {
  max-width: 900px;
  width: 100%;
  padding: 10px 10px 20px;
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.slide-content h2,
.slide-content .slide-title {
  font-size: 60px;
  line-height: 80px;
}

.slide-content h3 {
  font-size: 24px;
  line-height: 38px;
}

.slide-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.slide-buttons .button {
  width: 300px;
  min-height: 63px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 63px;
  height: 63px;
  margin-top: -31px;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  font-size: 25px;
  line-height: 63px;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-arrow:hover,
.hero-arrow:focus-visible {
  background: rgba(0, 0, 0, 0.7);
}

.hero-arrow.prev {
  left: 0;
}

.hero-arrow.next {
  right: 0;
}

.hero-arrow svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  vertical-align: middle;
}

/* ---------- Buttons (button-flat, button-square, button-large) ---------- */
.button {
  display: inline-block;
  padding: 13px 29px;
  border: 1px solid;
  border-radius: 0;
  font-family: 'PT Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* dunkle Outline (Slider "Mehr erfahren") */
.button-dark {
  color: var(--dark);
  border-color: var(--dark);
  background: transparent;
}

.button-dark:hover,
.button-dark:focus-visible {
  color: var(--white);
  border-color: var(--white);
  background: var(--dark);
}

/* rot gefüllt (Slider "Angebote entdecken") */
.button-red {
  color: var(--white);
  border-color: var(--white);
  background: var(--red);
}

.button-red:hover,
.button-red:focus-visible {
  color: var(--red);
  border-color: var(--red);
  background: var(--white);
}

/* rote Outline (Sektionen "Mehr erfahren") */
.button-outline {
  color: var(--red);
  border-color: var(--red);
  background: var(--white);
}

.button-outline:hover,
.button-outline:focus-visible,
.button-outline[aria-expanded='true'] {
  color: var(--white);
  border-color: var(--white);
  background: var(--red);
}

/* ---------- Sektionen ---------- */
.section {
  padding: 40px 20px;
}

.section-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: 30px;
}

.separator {
  max-width: 300px;
  margin: 25px auto;
  border: 0;
  border-top: 3px solid var(--dark);
}

.section .button-wrap {
  margin-top: 10px;
}

/* Video (2-Klick-Lösung, lädt YouTube erst nach Klick) */
.video {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--dark) center / cover no-repeat;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-consent {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(28, 37, 44, 0.75);
  color: var(--white);
  font-size: 14px;
  text-align: center;
}

.video-consent p {
  margin: 0;
  max-width: 480px;
}

.video-consent a {
  color: var(--white);
  text-decoration: underline;
}

.video-play {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  transition: transform 0.2s;
}

.video-play:hover,
.video-play:focus-visible {
  transform: scale(1.08);
}

.video-play svg {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  fill: currentColor;
  vertical-align: middle;
}

/* Parallax-Sektion (Master Knigge) */
.parallax {
  background-color: var(--white);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.parallax .section-inner {
  padding: 20px 0;
}

/* Akkordeon (Master-Knigge-Tipps) */
.knigge {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.knigge[hidden] {
  display: none;
}

.knigge-intro {
  text-align: center;
  margin-bottom: 30px;
}

.accordion details {
  border-bottom: 1px solid var(--line);
}

.accordion details:first-of-type {
  border-top: 1px solid var(--line);
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 40px 15px 0;
  position: relative;
  font-family: 'Open Sans Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dark);
  transition: color 0.2s;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: '+';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Open Sans', sans-serif;
  font-size: 22px;
  letter-spacing: 0;
}

.accordion details[open] summary::after {
  content: '–';
}

.accordion summary:hover,
.accordion details[open] summary {
  color: var(--red);
}

.accordion .panel {
  padding: 0 0 20px;
}

.master-tipp {
  border-left: 3px solid var(--red);
  padding-left: 15px;
}

.master-tipp strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
}

/* Referenzen */
.references {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.references img {
  margin: 0 auto;
  filter: grayscale(100%);
  transition: filter 0.3s;
}

.references li:hover img {
  filter: grayscale(0%);
}

/* Ablauf */
.process {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  max-width: 1100px;
  margin-inline: auto;
}

.process li {
  text-align: center;
}

.process img {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
}

.process h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.process p {
  font-size: 15px;
}

/* Kundenstimmen */
.section-dark {
  background: var(--dark);
  color: var(--grey);
}

.section-dark .section-title {
  color: var(--grey);
}

.section-dark .separator {
  border-color: var(--grey);
}

.testimonials {
  display: grid;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.testimonials blockquote {
  margin: 0;
  padding: 25px;
  border: 1px solid var(--grey);
  text-align: center;
  font-size: 15px;
}

.testimonials blockquote p {
  font-style: italic;
}

.testimonials cite {
  font-style: normal;
  color: var(--white);
  font-family: 'Open Sans Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Kontakt */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: stretch;
}

.contact-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.contact-box .lead {
  font-size: 18px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
}

.contact-links .button {
  min-width: 300px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding-top: 43px;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.bild-standort {
  min-height: 380px;
  display: flex;
  background: url('../img/master-standort-v2.jpg') center / cover no-repeat;
}

.bild-standort address {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--dark);
  font-style: normal;
  font-size: 13px;
  text-align: center;
  line-height: 1.8;
}

.bild-standort a {
  color: var(--dark);
}

.map-box {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--grey);
  text-align: center;
  color: var(--grey);
  font-size: 13px;
}

.map-box strong {
  color: var(--white);
  font-family: 'Open Sans Condensed', 'Arial Narrow', sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 20px;
}

.footer-bg {
  text-align: center;
  padding: 20px 0 50px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.footer-social img {
  width: 25px;
  height: 25px;
}

.footer-links {
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 13px;
}

.footer-links a {
  color: var(--grey);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--white);
}

.provision {
  padding: 20px;
  max-width: 1100px;
  margin: 0 auto;
  color: var(--grey);
  font-size: 12px;
}

/* ---------- Unterseiten (Impressum / Datenschutz) ---------- */
.legal {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px 80px;
}

.legal h1 {
  font-size: 40px;
  margin-bottom: 30px;
}

.legal h2 {
  font-size: 24px;
  margin: 40px 0 15px;
}

.legal h3 {
  font-size: 18px;
  margin: 25px 0 10px;
}

.legal a {
  word-break: break-word;
}

/* ---------- Dropdown-Menü (Über Uns / Referenzen) ---------- */
.main-nav li {
  position: relative;
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 220px;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--dark);
  border-top: 3px solid var(--white);
  text-align: left;
}

.main-nav .has-sub:hover > .sub-menu,
.main-nav .has-sub:focus-within > .sub-menu {
  display: flex;
}

.main-nav .sub-menu a {
  height: auto;
  line-height: 1.4;
  padding: 9px 15px;
  border-top: 0;
  border-bottom: 1px solid var(--grey);
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
}

.main-nav .sub-menu a:hover,
.main-nav .sub-menu a:focus-visible {
  color: var(--white);
}

/* ---------- Unterseiten: Sektionen & Spalten (aus dem Fusion-Builder übernommen) ---------- */
.sp-section {
  padding: 30px 20px;
}

.sp-section.parallax {
  min-height: 300px;
  display: flex;
  align-items: center;
}

.sp-section.parallax .sp-row {
  width: 100%;
}

.sp-section.parallax h1,
.sp-section.parallax h2,
.sp-section.parallax h3,
.sp-section.parallax p {
  background: rgba(255, 255, 255, 0.5);
  padding: 5px 15px;
}

.sp-section.section-dark {
  background: var(--dark);
  color: var(--grey);
}

.sp-section.section-dark h1,
.sp-section.section-dark h2,
.sp-section.section-dark h3,
.sp-section.section-dark h4 {
  color: var(--grey);
}

.sp-section.section-light {
  background: #f4f4f4;
}

.sp-row {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0 4%;
}

.col {
  flex: 0 0 100%;
  min-width: 0;
  margin-bottom: 20px;
}

.col-bg {
  min-height: 300px;
  background-size: cover;
  background-position: center;
}

.col-empty {
  margin: 0;
}

.sp-section h1 {
  font-size: 40px;
  margin-bottom: 20px;
}

.sp-section h2 {
  font-size: 30px;
  margin: 30px 0 15px;
}

.sp-section h3 {
  font-size: 22px;
  margin: 25px 0 12px;
}

.sp-section h4 {
  font-size: 18px;
  margin: 20px 0 10px;
}

.sp-section .col > h1:first-child,
.sp-section .col > h2:first-child,
.sp-section .col > h3:first-child {
  margin-top: 0;
}

.sp-section ul,
.sp-section ol,
.article ul,
.article ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.sp-section a:not(.button),
.article a:not(.button) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.sp-section hr.separator,
.article hr.separator {
  margin: 20px auto 25px;
}

.sp-section img {
  margin-bottom: 15px;
}

.alignleft {
  float: left;
  margin: 0 20px 15px 0;
}

.alignright {
  float: right;
  margin: 0 0 15px 20px;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap td,
.table-wrap th {
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

.accordion .panel .table-wrap td {
  display: block;
  padding: 10px 0;
}

.anchor {
  display: block;
  position: relative;
  top: -10px;
}

.sp-section .accordion {
  text-align: left;
  margin-bottom: 20px;
}

/* Kontakt-Hinweis statt Immobilienliste */
.listing-cta {
  margin: 30px auto;
  max-width: 800px;
  padding: 30px 20px;
  border: 1px solid var(--line);
  text-align: center;
}

.listing-cta h3 {
  margin: 0 0 10px !important;
}

/* Team */
.team-member {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 30px;
  background: var(--dark);
  color: var(--white);
  width: 100%;
}

.team-member img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: top;
  margin: 0;
}

.team-member .team-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
}

.team-member h2 {
  color: var(--white);
  margin: 0 0 10px !important;
}

.team-member p {
  margin: 0 0 6px;
  color: var(--grey);
}

.team-member a {
  color: var(--white);
}

/* News / Beiträge */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  margin: 20px 0;
}

.post-card {
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.post-card-img {
  display: block;
  aspect-ratio: 3 / 2;
  background: #f4f4f4;
  overflow: hidden;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card time,
.post-date {
  color: var(--grey);
  font-size: 13px;
}

.post-card h3 {
  font-size: 18px;
  margin: 5px 0 10px !important;
}

.post-card h3 a {
  color: var(--dark);
  text-decoration: none !important;
}

.post-card p {
  font-size: 14px;
  flex: 1;
}

.read-more {
  font-family: 'PT Sans', Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none !important;
}

.article {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.article h1 {
  font-size: 36px;
  margin: 10px 0 0;
}

.article h2 {
  font-size: 26px;
  margin: 30px 0 12px;
}

.article h3 {
  font-size: 20px;
  margin: 25px 0 10px;
}

.post-image {
  margin: 0 0 25px;
}

.post-image img {
  max-height: 480px;
  width: auto;
}

.back-link {
  font-size: 14px;
}

.back-link a {
  text-decoration: none !important;
}

/* Footer-Linkliste (grau) */
.footer-bg2 {
  background: var(--grey);
  padding: 20px 20px 43px;
}

.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 30px;
}

.footer-cols a {
  display: block;
  color: var(--dark);
  font-size: 12px;
  border-bottom: 1px solid var(--dark);
  padding: 10px 0;
}

.footer-cols a:hover,
.footer-cols a:focus-visible {
  color: var(--white);
}

@media (min-width: 900px) {
  .sp-section {
    padding: 50px 20px;
  }

  .sp-section.parallax {
    min-height: 500px;
  }

  .c-1-2 { flex-basis: 48%; }
  .c-1-3 { flex-basis: 30.66%; }
  .c-2-3 { flex-basis: 65.33%; }
  .c-1-4 { flex-basis: 22%; }
  .c-3-4 { flex-basis: 74%; }
  .c-1-5 { flex-basis: 16.8%; }
  .c-2-5 { flex-basis: 37.6%; }
  .c-3-5 { flex-basis: 58.4%; }
  .c-4-5 { flex-basis: 79.2%; }
  .c-1-6 { flex-basis: 13.33%; }
  .c-5-6 { flex-basis: 82.66%; }

  .team-member {
    grid-template-columns: 1fr 1fr;
  }

  .team-member:nth-of-type(even) img {
    order: 2;
  }

  .footer-cols {
    grid-template-columns: repeat(3, 1fr);
  }

  .accordion .panel .table-wrap td {
    display: table-cell;
    padding: 0 20px 0 0;
  }

  .accordion .panel .table-wrap td:first-child {
    width: 40%;
  }
}

@media (max-width: 899px) {
  .main-nav .sub-menu {
    display: flex;
    position: static;
    transform: none;
    border-top: 0;
    background: rgba(255, 255, 255, 0.04);
  }

  .main-nav .sub-menu a {
    padding-left: 35px;
  }

  .sp-section h1,
  .article h1 {
    font-size: 28px;
  }

  .sp-section h2 {
    font-size: 24px;
  }

  .alignleft,
  .alignright {
    float: none;
    margin: 0 0 15px;
  }
}

/* ---------- Responsive ---------- */
@media (min-width: 900px) {
  .section {
    padding: 80px 20px;
  }

  .parallax .section-inner {
    padding: 80px 0;
  }

  /* Kontakt-Laschen wie Original: rechts, fahren bei Hover aus */
  .master-contact .mail,
  .master-contact .phone {
    left: auto;
    bottom: auto;
    right: -195px;
    width: 250px;
    padding: 20px 21px;
    text-align: left;
  }

  .master-contact .phone {
    top: 300px;
  }

  .master-contact .mail {
    top: 366px;
  }

  .master-contact .mail:hover,
  .master-contact .mail:focus-visible,
  .master-contact .phone:hover,
  .master-contact .phone:focus-visible {
    right: 0;
  }

  .master-contact span {
    display: inline-block;
    margin-left: 20px;
  }

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

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

@media (max-width: 899px) {
  :root {
    --header-h: 94px;
  }

  html {
    scroll-padding-top: 94px;
  }

  .site-header .logo img {
    width: 160px;
    height: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    border-top: 1px solid var(--grey);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 0;
  }

  .main-nav a {
    border-top: 0;
    border-bottom: 1px solid rgba(138, 144, 148, 0.4);
    height: auto;
    line-height: 1.4;
    padding: 14px 20px;
  }

  .main-nav a:hover,
  .main-nav a.is-active {
    border-top-color: transparent;
  }

  .slide-content h2,
  .slide-content .slide-title {
    font-size: 18px;
    line-height: 20px;
  }

  .slide-content h3 {
    font-size: 14px;
    line-height: 20px;
  }

  .slide-buttons .button {
    width: 240px;
    min-height: 0;
    font-size: 14px;
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
    margin-top: -20px;
    line-height: 40px;
  }

  .contact-links .button {
    min-width: 0;
    width: 100%;
  }

  /* fixed-Hintergründe ruckeln auf Mobilgeräten */
  .parallax {
    background-attachment: scroll;
  }

  body {
    padding-bottom: 44px;
  }
}

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

  .hero .slide {
    transition: none;
  }
}

/* Kopfbild der Unterseiten */
.subpage-header {
  height: 300px;
  background-size: cover;
  background-position: center;
}

@media (min-width: 900px) {
  .subpage-header {
    height: 500px;
  }
}

/* ---------- Umbrüche: lange deutsche Wörter sauber trennen ---------- */
h1,
h2,
h3,
h4,
summary,
.slide-content h2,
.slide-content .slide-title {
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

p,
li,
td,
th,
address,
blockquote {
  overflow-wrap: break-word;
}

.button-wrap.center {
  text-align: center;
}

@media (max-width: 599px) {
  h1,
  h2,
  h3,
  h4,
  summary {
    letter-spacing: 1.5px;
  }

  .table-wrap td,
  .table-wrap th {
    display: block;
    width: 100% !important;
    padding: 8px 0;
  }

  .main-nav.is-open {
    max-height: calc(100vh - 94px);
    overflow-y: auto;
  }
}

/* Weiße, halbtransparente Box auf Bildsektionen (wie Slider) */
.overlay-box {
  background: rgba(255, 255, 255, 0.5);
  padding: 25px 20px;
}

.overlay-box h3 {
  font-size: 22px;
  line-height: 1.5;
}

@media (max-width: 899px) {
  .overlay-box h3 {
    font-size: 16px;
  }
}

/* Kontaktbereich Startseite */
.contact-box h3 {
  margin-bottom: 12px;
}

.usp {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.usp li {
  margin-bottom: 8px;
}

@media (max-width: 899px) {
  .bild-standort {
    min-height: 300px;
  }

  .map-box {
    min-height: 0;
    padding: 30px 20px;
  }

  .footer-links p a {
    display: inline-block;
    padding: 4px 0;
  }
}

/* ---------- Tablet (600–899 px) ---------- */
.testimonials {
  grid-template-columns: 1fr;
}

@media (min-width: 600px) and (max-width: 899px) {
  .slide-content h2,
  .slide-content .slide-title {
    font-size: 34px;
    line-height: 44px;
  }

  .slide-content h3 {
    font-size: 18px;
    line-height: 28px;
  }

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

  .footer-columns,
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }

  .team-member {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .testimonials {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Raster ohne verwaiste Elemente ---------- */
.references {
  grid-template-columns: repeat(2, 1fr);
}

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

@media (min-width: 600px) {
  .references {
    grid-template-columns: repeat(3, 1fr);
  }

  .process {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .section {
    padding: 60px 20px;
  }

  .process {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Logo-Raster auf der Referenzen-Seite (viele Logos) */
.sp-section .references {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.sp-section .button-wrap {
  margin: 10px 0 25px;
}

@media (max-width: 899px) {
  .main-nav {
    text-align: left;
  }
}
