/* SERVICES STYLES - Leistungen section */

/*Leistungen*/
.hintergrund-fullsize {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
}

.hintergrund-fullsize .leistungen {
  max-width: 85%;
}

.leistungen{
  padding-bottom: 50px;
}

.leistungen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
  /*max-height: 550px;*/
}

.home .leistungen-grid {
  max-width: 85%;
}

.leistungen-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* height: 362px; ❌ entfernen */
  border-radius: 30px;
  width: 100%;
}

.leistungen-column.bild,
.leistungen-column.bild-rechts,
.leistungen-column.bild-links {
  overflow: hidden;
}

.leistungen-column.bild-links,
.leistungen-column.bild-rechts {
  width: 180%;
}

.leistungen-column.column-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  flex-direction: column;
  gap: 20px;
}

.leistungen-column .card,
.leistungen-column .card-beratung {
  padding: 30px;
  font-size: 1.2rem;
  border-radius: 30px;
  background-color: #00597b;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  flex: 1; /* ✅ statt height: 100% */
}

.card[style="background-color:#ffffff00"] {
  border: 1px solid #575656 !important;
}

/*
.leistungen-column.column-left .card:nth-child(1), .leistungen-column.column-right .card:nth-child(2) {
  background: #000000;
}

.leistungen-column.column-right .card:nth-child(1){
 background-color: #00597b;
}

.leistungen-column.column-left .card:nth-child(2) p{
  color: #575656;
}
*/

.leistungen-grid p {
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  padding-left: 30px;
  padding-right: 30px;
  font-weight: 700;
  font-size: clamp(18px, 1.5vw + 0.5rem, 32px);
  line-height: 1.1;
}

.card-beratung p {
  color: #fff;
  text-transform: none;
  font-weight: 500;
  line-height: normal;
  margin: 0;
}

.card-beratung .tel,
.card-beratung .mail {
  margin-top: 30px;
}

.card-beratung .gross {
  font-weight: 400;
}

.leistungen-column .wp-block-image {
  margin: 0;
  overflow: unset;
  max-width: 100%;
  height: 100%;
}

.bild-card{
  flex: 1;
  height: 100% !important;
  min-height: 0;
  overflow: hidden;
}

.bild-card img {
  border-radius: 30px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modell{
 font-weight: 500 !important;
 font-size: 20px !important;
}

.modell,
.modell + p {
  margin: 0;
}

/*Bilder skalieren*/
.geschlossen img {
  transform: scale(1.6) translateX(41px) translateY(7px);
}

.halbseitig-verglast img {
  transform: scale(1.4) translateX(-15px) translateY(-13px);
}

.insights img {
  transform: scale(1.4) translateX(35px) translateY(-45px);
}

.referenzen .card {
  min-height: 150px !important;
}

@media (max-width: 1600px) {
  .leistungen-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .leistungen-column {
    height: auto;
    min-height: 260px;
    gap: 18px;
  }

  .leistungen-column.bild {
    display: grid;
    grid-template-rows: 1fr 1fr; /* 🔥 teilt in 2 */
  }

  .leistungen-column.bild-rechts,
  .leistungen-column.bild-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(180px, 1fr));
    width: 100%;
    min-height: 420px;
  }

  .leistungen-column.bild-rechts:has(.card),
  .leistungen-column.bild-links:has(.card) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .leistungen-column.bild-rechts .wp-block-image {
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
  }

  .leistungen-column.bild-links .wp-block-image {
    grid-column: 1 / -1;
    grid-row: 1 / span 2;
  }

  .leistungen-column.bild-rechts:has(.card) .wp-block-image {
    grid-column: 2;
  }

  .leistungen-column.bild-links:has(.card) .wp-block-image {
    grid-column: 1;
  }

  .leistungen-column.bild-rechts .wp-block-image,
  .leistungen-column.bild-links .wp-block-image {
    width: 100%;
    height: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
  }

  .leistungen-column.bild-rechts .wp-block-image img,
  .leistungen-column.bild-links .wp-block-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
  }

  .leistungen-column.bild-rechts:has(.card) .card {
    grid-column: 1;
  }

  .leistungen-column.bild-links:has(.card) .card {
    grid-column: 2;
  }
  
  .leistungen-column.bild .wp-block-image {
    grid-row: 1 / span 2; /* 🔥 nimmt beide Reihen ein */
  }

  .leistungen-column.bild img,
  .leistungen-column.bild-rechts img,
  .leistungen-column.bild-links img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .leistungen-column .card {
    flex: 1; /* 🔥 sorgt für gleiche Höhe */
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;          /* 🔥 weniger Padding */
  }

  .leistungen-grid p {
    line-height: 1.2;
    max-width: 90%;        /* 🔥 verhindert zu breite Zeilen */
    margin: 0 auto;        /* zentriert sauber */
    padding-left: 24px;
    padding-right: 24px;
  }

  .geschlossen img,
  .halbseitig-verglast img,
  .insights img {
    transform: none;
  }

  .leistungen-column .card,
  .leistungen-column .card-beratung {
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: normal;
  }
}

@media (max-width: 1200px) {
  .leistungen-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .leistungen-column,
  .leistungen-column .card,
  .leistungen-column .card-beratung,
  .wp-block-group.card.has-background.is-layout-flow.wp-block-group-is-layout-flow {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .leistungen-column {
    height: auto;
    min-height: 260px;
  }

  .leistungen-column .card p,
  .leistungen-column .card-beratung p,
  .leistungen-grid p {
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .leistungen-column.bild,
  .leistungen-column.bild-rechts,
  .leistungen-column.bild-links {
    min-height: 340px;
  }

  .leistungen-grid p {
    line-height: 1.12;
    padding-left: 20px;
    padding-right: 20px;
  }

  .geschlossen img,
  .halbseitig-verglast img,
  .insights img {
    transform: none;
  }
}

@media (max-width: 980px) {
  .home .leistungen-grid {
    max-width: calc(100% - 48px);
  }

  .leistungen-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .leistungen-column {
    height: auto;
    min-height: 240px;
    gap: 18px;
  }

  .leistungen-column.bild {
    min-height: 300px;
  }

  .leistungen-grid p {
    padding-left: 18px;
    padding-right: 18px;
  }

  .leistungen-column .card {
    padding: 24px;
  }

  .geschlossen img,
  .halbseitig-verglast img,
  .insights img {
    transform: none;
  }
}

@media (max-width: 768px) {
  .leistungen {
    padding-bottom: 30px;
  }

  .leistungen-column {
    min-height: 0;
    gap: 14px;
  }

  .leistungen-column.bild,
  .leistungen-column.bild-rechts,
  .leistungen-column.bild-links {
    display: block;
    width: 100%;
    min-height: unset;
  }

  .leistungen-column .wp-block-image,
  .bild-card {
    height: auto;
  }

  .leistungen-column .card {
    min-height: 180px;
    padding: 18px;
  }

  .leistungen-grid{
    display: block !important;
  }

  .leistungen-grid p {
    line-height: 1.1;
    padding-left: 14px;
    padding-right: 14px;
  }

  .modell {
    font-size: 17px !important;
  }
}
