/* =========================================
   KUFERWEB – VOLLBREITES 3ER-GRID
   + ERSTE KACHEL DOPPELT BREIT
   + HOVER: Tile springt vor, Bild zoomt
   + Responsive optimiert
   ========================================= */

@font-face {
  font-family: 'OlliFont';
  src: url('https://www.kurse-bei-boesner.de/wp-includes/fonts/NettoOT-Bold.woff2') format('woff2'),
       url('https://www.kurse-bei-boesner.de/wp-includes/fonts/NettoOT-Bold.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Handschrift';
  src: url('https://www.kurse-bei-boesner.de/wp-includes/fonts/above-the-beyond-script.woff2') format('woff2'),
       url('https://www.kurse-bei-boesner.de/wp-includes/fonts/above-the-beyond-script.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Wrapper */
.kb-fw-fix {
  width: 100%;
  max-width: none;
  margin-left: -15px;
  margin-right: -15px;
  overflow: visible !important;
}

/* Grid */
.kb-fw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  width: 100%;
  justify-items: stretch;
  align-items: stretch;
  overflow: visible !important;
  padding: 12px 0 24px;
  margin: -12px 0 -24px;
}

/* ================= KACHEL ================= */

.kb-fw-tile {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #eaeaea;
  display: block;
  text-decoration: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px !important;
  transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  will-change: transform;
}

.kb-fw-tile::before {
  content: "";
  display: block;
  padding-top: 75%;
}

/* Erste Kachel doppelt breit */
.kb-fw-video-tile {
  grid-column: span 2;
}

/* Erste Kachel bleibt so hoch wie eine normale Kachel */
.kb-fw-video-tile::before {
  padding-top: calc((75% - 15px) / 2);
}

/* Bild / Video */
.kb-fw-tile img,
.kb-fw-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1);
  transition: transform .45s ease, filter .45s ease;
  will-change: transform;
}

.kb-fw-tile img {
  object-position: center bottom;
}

/* Overlay */
.kb-fw-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .35s ease;
  pointer-events: none;
  z-index: 1;
}

/* ================= MEISTERHAFT SCHRIFT ================= */

.kb-fw-brand {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  transform: translateY(0);
  transition: transform .25s ease;
}

.kb-fw-title {
  font-family: 'Handschrift', cursive;
  font-size: clamp(36px, 4.4vw, 68px);
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.5);
}

.kb-fw-subline {
  margin-top: 32px;
  font-family: 'OlliFont', Arial, sans-serif;
  font-size: clamp(12px, 1vw, 18px);
  line-height: 1.2;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.5);
  opacity: 0.92;
}

/* ================= CTA ================= */

.kb-fw-cta {
  position: absolute;
  right: 12px;
  bottom: 0;
  z-index: 2;

  display: flex;
  align-items: end;
  justify-content: center;

  font-family: SourceSans, Arial, sans-serif;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  text-align: center;
  white-space: normal;

  padding: 12px 14px;
  width: 150px;
  height: 110px;

  background-color: var(--cta-bg, rgb(0 107 91 / 80%));
  clip-path: polygon(35% 35%, 100% 0, 100% 100%, 0 100%, 0 18%);

  font-size: 18px;
  line-height: 1.2;

  transition: filter .25s ease-in-out, opacity .25s ease-in-out, transform .25s ease;
  opacity: 0.95;
}

.kb-fw-cta span {
  display: block;
}

/* ================= HOVER ================= */

.kb-fw-tile:hover {
  transform: scale(1.02);
  border-color: rgba(0, 0, 0, .08);
  z-index: 5;
}

.kb-fw-tile:hover img,
.kb-fw-tile:hover video {
  transform: scale(1.12);
  filter: brightness(.92);
}

.kb-fw-tile:hover::after {
  background: rgba(0, 0, 0, .12);
}

.kb-fw-tile:hover .kb-fw-cta {
  filter: brightness(0.85);
  opacity: 1;
  color: #fff;
  transform: none;
}

.kb-fw-tile:hover .kb-fw-brand {
  transform: scale(1.03);
}

/* Touch-Geräte */
@media (hover: none) {
  .kb-fw-tile:hover {
    transform: none;
    box-shadow: none;
  }

  .kb-fw-tile:hover img,
  .kb-fw-tile:hover video {
    transform: none;
    filter: none;
  }

  .kb-fw-tile:hover::after {
    background: rgba(0, 0, 0, 0);
  }

  .kb-fw-tile:hover .kb-fw-cta,
  .kb-fw-tile:hover .kb-fw-brand {
    transform: none;
  }
}

/* ================= TABLET ================= */

@media (max-width: 991px) {
  .kb-fw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kb-fw-video-tile {
    grid-column: span 2;
  }

  .kb-fw-video-tile::before {
    padding-top: 45%;
  }

  .kb-fw-title {
    font-size: clamp(38px, 7vw, 66px);
  }

  .kb-fw-subline {
    font-size: clamp(8px, 1.2vw, 12px);
  }
}

/* ================= MOBILE ================= */

@media (max-width: 575px) {
  .kb-fw-fix {
    margin-left: 0;
    margin-right: 0;
  }

  .kb-fw-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .kb-fw-video-tile {
    grid-column: span 1;
  }

  .kb-fw-video-tile::before {
    padding-top: 75%;
  }

  .kb-fw-title {
    font-size: clamp(34px, 13vw, 54px);
  }

  .kb-fw-subline {
    margin-top: 26px;
    font-size: 16px;
    letter-spacing: 0.12em;
  }

  .kb-fw-cta {
    width: 130px;
    height: 95px;
    right: 10px;
    padding: 10px 12px;
    font-size: 16px;
  }
}

/* ================= SPEZIAL-LAYOUT ================= */

/* Kachel 1 groß: nimmt 2 Spalten ein */
.kb-fw-grid .kb-fw-tile:nth-child(1) {
  grid-column: span 2;
}

/* Kachel 3 groß: nimmt 2 Spalten ein */
.kb-fw-grid .kb-fw-tile:nth-child(4) {
  grid-column: span 2;
}

/* Kachel 3 groß: nimmt 2 Spalten ein */
.kb-fw-grid .kb-fw-tile:nth-child(5) {
  grid-column: span 2;
}
.kb-fw-grid .kb-fw-tile:nth-child(5) img {
  object-position: center center !important;
}
/* Große Kacheln bleiben nur eine Reihe hoch */
.kb-fw-grid .kb-fw-tile:nth-child(1)::before,
.kb-fw-grid .kb-fw-tile:nth-child(4)::before,
.kb-fw-grid .kb-fw-tile:nth-child(5)::before {
  padding-top: calc((75% - 15px) / 2);
}

/* Tablet: große Kacheln über volle Breite */
@media (max-width: 991px) {
  .kb-fw-grid .kb-fw-tile:nth-child(1),
  .kb-fw-grid .kb-fw-tile:nth-child(4),
  .kb-fw-grid .kb-fw-tile:nth-child(5) {
    grid-column: span 2;
  }

  .kb-fw-grid .kb-fw-tile:nth-child(1)::before,
  .kb-fw-grid .kb-fw-tile:nth-child(4)::before ,
  .kb-fw-grid .kb-fw-tile:nth-child(5)::before {
    padding-top: 45%;
  }
}

/* Mobile: alles untereinander */
@media (max-width: 575px) {
  .kb-fw-grid .kb-fw-tile:nth-child(1),
  .kb-fw-grid .kb-fw-tile:nth-child(4),
  .kb-fw-grid .kb-fw-tile:nth-child(5) {
    grid-column: span 1;
  }

  .kb-fw-grid .kb-fw-tile:nth-child(1)::before,
  .kb-fw-grid .kb-fw-tile:nth-child(4)::before,
  .kb-fw-grid .kb-fw-tile:nth-child(5)::before {
    padding-top: 75%;
  }
}