/* Weser Theme – Block: Kategorie-Kacheln („Alles für deinen Außenraum")
   ==========================================================================
   Gemessen aus `.figma-ref/Sprint 3/Weserwaben_Startseite.png` (Desktop 1728):

   - Raster     2×2, alle vier Kacheln gleich groß: 722 × 500px
                (x 130–851 / 876–1597, Gutter 24px; Reihenabstand ebenfalls 24px)
                → Seitenverhältnis 722:500, umgesetzt über aspect-ratio
   - Ecken      Dieselbe Diagonal-Figur wie beim Besonderheiten-Slider, nur
                größer: die Kachel oben RECHTS ist oben-rechts gerundet, die
                Kachel unten LINKS unten-links. Radius aus zwei Punkten der
                Kurve gerechnet → 48px. Die anderen Ecken bleiben scharf.
                Deshalb :nth-child() und nicht eine Klasse an jeder Kachel:
                die Rundung gehört zur POSITION im Raster, nicht zum Inhalt.
   - Text       liegt IM Bild, unten links, Innenabstand 40px
                Titel   Literata SemiBold, Versalhöhe 26px → 34px, weiß
                Subline Poppins SemiBold, Versalhöhe 15px → 20px, weiß
   - Kein dunkles Overlay im Figma. Damit der weiße Text auch auf hellen
     Motiven (Pool, heller Stein) lesbar bleibt, liegt ein weicher Verlauf
     von unten darunter – ohne ihn kippt die Lesbarkeit bei echtem Bildmaterial.

   Tablet/Mobil sind ABGELEITET – für Sprint 3 lagen nur Desktop-Screenshots
   vor. Ab Tablet bleibt das 2×2 bestehen (col-md-6), auf Mobil einspaltig;
   dort trägt die erste Kachel oben-rechts und die letzte unten-links die
   Rundung, damit die Figur als Klammer um die Gruppe erhalten bleibt.
   ========================================================================== */

.category-tiles-headline {
    color: var(--color-dark);
    margin: 0 0 16px;
}

.category-tiles-intro {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 26px;
    color: var(--color-text);
    max-width: 1092px;
    margin: 0 0 40px;
}

/* ---- Kachel -------------------------------------------------------------- */
.category-tile {
    position: relative;
    display: block;
    aspect-ratio: 722 / 500;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-white);
}

.category-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lesbarkeitsverlauf – siehe Hinweis im Kopf. */
.category-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.25) 32%,
        transparent 58%
    );
}

.category-tile-body {
    position: relative;
    z-index: 1;
    /* Text sitzt unten links; der Block wird über die volle Kachelhöhe
       gestreckt und der Inhalt nach unten geschoben. */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 40px;
}

.category-tile-title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: 34px;
    line-height: 42px;
    color: var(--color-white);
    margin: 0 0 4px;
}

.category-tile-subline {
    font-family: var(--font-body);
    font-weight: var(--fw-semibold);
    font-size: 20px;
    line-height: 30px;
    color: var(--color-white);
    margin: 0;
}

/* ---- Die Diagonal-Rundung ------------------------------------------------
   Gilt für das 2×2-Raster: zweite Kachel oben-rechts, dritte unten-links. */
@media (min-width: 768px) {
    .category-tiles-row > div:nth-child(2) .category-tile {
        border-radius: 0 48px 0 0;
    }

    .category-tiles-row > div:nth-child(3) .category-tile {
        border-radius: 0 0 0 48px;
    }
}

.category-tile:hover .category-tile-img,
.category-tile:focus-visible .category-tile-img {
    transform: scale(1.03);
}

.category-tile-img {
    transition: transform 0.4s ease;
}

/* ---- Tablet (768–1199) – abgeleitet -------------------------------------- */
@media (max-width: 1199.98px) {
    .category-tiles-intro {
        margin-bottom: 32px;
    }

    .category-tile-body {
        padding: 28px;
    }

    .category-tile-title {
        font-size: 25px;
        line-height: 32px;
    }

    .category-tile-subline {
        font-size: 16px;
        line-height: 24px;
    }
}

/* ---- Mobil (<768) – abgeleitet ------------------------------------------- */
@media (max-width: 767.98px) {
    .category-tile {
        aspect-ratio: 4 / 3;
    }

    .category-tile-body {
        padding: 24px;
    }

    .category-tile-title {
        font-size: 22px;
        line-height: 28px;
    }

    /* Einspaltig: Die Klammer umschließt die ganze Gruppe statt einer Reihe. */
    .category-tiles-row > div:first-child .category-tile {
        border-radius: 0 32px 0 0;
    }

    .category-tiles-row > div:last-child .category-tile {
        border-radius: 0 0 0 32px;
    }
}
