/**
 * C4mulo5 – Welt-/Kategorie-Showcase Section
 *
 * Kachel-Grid mit konfigurierbarer Spaltenanzahl (2/3/4/6/8/9).
 * Jede Kachel mit Icon, Titel, Untertitel und Link.
 * Optional mit Hintergrundbild (als Cover hinter halbtransparentem Overlay).
 */

/* ═══ ::before/::after Reset ═══════════════════════════════════ */
.c4mulo5-category-showcase .c4m5-cs-grid::before,
.c4mulo5-category-showcase .c4m5-cs-grid::after,
.c4mulo5-category-showcase .c4m5-cs-tile::before,
.c4mulo5-category-showcase .c4m5-cs-tile::after,
.c4mulo5-category-showcase .c4m5-cs-tile-inner::before,
.c4mulo5-category-showcase .c4m5-cs-tile-inner::after {
    display: none !important;
    content: none !important;
}

/* ═══ GRID ══════════════════════════════════════════════════════ */
.c4mulo5-category-showcase .c4m5-cs-grid {
    display: grid;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.c4mulo5-category-showcase.c4m5-cs-cols-2 .c4m5-cs-grid { grid-template-columns: repeat(2, 1fr); }
.c4mulo5-category-showcase.c4m5-cs-cols-3 .c4m5-cs-grid { grid-template-columns: repeat(3, 1fr); }
.c4mulo5-category-showcase.c4m5-cs-cols-4 .c4m5-cs-grid { grid-template-columns: repeat(4, 1fr); }
.c4mulo5-category-showcase.c4m5-cs-cols-6 .c4m5-cs-grid { grid-template-columns: repeat(3, 1fr); }
.c4mulo5-category-showcase.c4m5-cs-cols-8 .c4m5-cs-grid { grid-template-columns: repeat(4, 1fr); }
.c4mulo5-category-showcase.c4m5-cs-cols-9 .c4m5-cs-grid { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 992px) {
    .c4mulo5-category-showcase.c4m5-cs-cols-6 .c4m5-cs-grid { grid-template-columns: repeat(6, 1fr); }
    .c4mulo5-category-showcase.c4m5-cs-cols-8 .c4m5-cs-grid { grid-template-columns: repeat(4, 1fr); }
    .c4mulo5-category-showcase.c4m5-cs-cols-9 .c4m5-cs-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══ BENTO-Layout (erste Kachel groß) ═══════════════════════════ */
.c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-grid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: minmax(180px, auto);
}
.c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-tile:first-child {
    grid-row: span 2;
    grid-column: span 2;
}
@media (max-width: 768px) {
    .c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-grid {
        grid-template-columns: 1fr;
    }
    .c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-tile:first-child {
        grid-row: auto;
        grid-column: auto;
    }
}

/* ═══ KACHEL ═════════════════════════════════════════════════════ */
.c4mulo5-category-showcase .c4m5-cs-tile {
    position: relative;
    display: block;
    min-height: 180px;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #1a5490; /* Fallback, wird von data-bg überschrieben via inline style */
    color: #ffffff;
}

.c4mulo5-category-showcase .c4m5-cs-tile:hover,
.c4mulo5-category-showcase .c4m5-cs-tile:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    text-decoration: none !important;
    outline: none;
}

/* Hintergrundbild wenn gesetzt */
.c4mulo5-category-showcase .c4m5-cs-tile[style*="background-image"] {
    background-size: cover;
    background-position: center;
}

/* Overlay bei Bild-Kacheln */
.c4mulo5-category-showcase .c4m5-cs-tile[style*="background-image"]::after {
    content: "" !important;
    display: block !important;
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.c4mulo5-category-showcase .c4m5-cs-tile-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 24px;
    box-sizing: border-box;
}

/* ═══ ICON ═══════════════════════════════════════════════════════ */
.c4mulo5-category-showcase .c4m5-cs-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: background 0.25s ease, transform 0.25s ease;
}
.c4mulo5-category-showcase .c4m5-cs-tile:hover .c4m5-cs-tile-icon {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}

.c4mulo5-category-showcase .c4m5-cs-tile-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══ TEXT ═══════════════════════════════════════════════════════ */
.c4mulo5-category-showcase .c4m5-cs-tile-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.c4mulo5-category-showcase .c4m5-cs-tile-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.c4mulo5-category-showcase .c4m5-cs-tile-subtitle {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.45;
    opacity: 0.9;
}

/* ═══ Bento-Layout: erste Kachel etwas größerer Text ═══════════ */
.c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-tile:first-child .c4m5-cs-tile-title {
    font-size: 1.5rem;
}
.c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-tile:first-child .c4m5-cs-tile-icon {
    width: 56px;
    height: 56px;
}
.c4mulo5-category-showcase.c4m5-cs-layout-bento .c4m5-cs-tile:first-child .c4m5-cs-tile-icon svg {
    width: 32px;
    height: 32px;
}

/* ═══ RESPONSIVE ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .c4mulo5-category-showcase .c4m5-cs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .c4mulo5-category-showcase .c4m5-cs-tile {
        min-height: 140px;
    }
    .c4mulo5-category-showcase .c4m5-cs-tile-inner {
        padding: 16px;
    }
    .c4mulo5-category-showcase .c4m5-cs-tile-title {
        font-size: 1rem;
    }
    .c4mulo5-category-showcase .c4m5-cs-tile-subtitle {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .c4mulo5-category-showcase .c4m5-cs-grid {
        grid-template-columns: 1fr !important;
    }
}
