/* =====================================================================
 * BSH Hero Slider Widget – Styles
 * Collage / Bento-Grid Slider mit Cross-Fade
 *
 * Autor: Luca Petersen | Com&Sons  |  https://comandsons.com
 * ===================================================================== */

/* ── Variables ───────────────────────────────────────── */

.sr-collage {
    --sr-gap: 18px;
    --sr-vh: 85svh;
    --sr-ink: #000;
    --sr-muted: #000;

    width: 100%;
    background: #fff;
    padding: var(--sr-gap);
    overflow-x: clip;
    container-type: inline-size;
    container-name: hero-collage;
}

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

/* ── Grid ────────────────────────────────────────────── */

.sr-wrap {
    width: 100%;
    height: calc(var(--sr-vh) - (var(--sr-gap) * 2));
    min-width: 0;
    margin: 0;
    display: grid;
    gap: var(--sr-gap);
    grid-template-columns: 1.05fr 1.9fr 1.05fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "lt hero rt"
        "lb hero card";
    align-items: stretch;
}

/* ── Cross-fade layers ───────────────────────────────── */

.sr-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 780ms cubic-bezier(.22,.9,.2,1);
    will-change: opacity;
}

.sr-bg.is-on { opacity: 1; }

/* ── Tiles (Image) ───────────────────────────────────── */

.sr-tile {
    border-radius: 0;
    overflow: hidden;
    background: #f3f6fb;
    position: relative;
    min-width: 0;
    min-height: 0;
}

.sr-tile::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.06));
    pointer-events: none;
    z-index: 2;
}

.sr-left-top  { grid-area: lt; }
.sr-left-bottom { grid-area: lb; }
.sr-right-top { grid-area: rt; }

/* ── Content Tile (links oben, statisch) ─────────────── */

.sr-tile-content {
    background: #fff;
    border: 1px solid rgba(15,27,45,.06);
}

.sr-tile-content::after { display: none; }

.sr-tile-content-inner {
    height: 100%;
    min-height: 100%;
    overflow: visible;
    padding: 10px;
    display: flex;
    align-items: center;
}

.sr-tile-content-inner > section { margin: 0 !important; }

/* Content tile inner layout */
.sr-ct {
    width: 100%;
    min-width: 0;
    padding: 0;
}

.sr-ct__heading {
    margin: 0 0 16px;
    font-size: clamp(1.4em, 2.2vw, 2em);
    line-height: 1.12;
    font-weight: 700;
    color: var(--sr-ink);
}

.sr-ct__text {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sr-ink);
}

.sr-ct__icons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 18px;
    width: 100%;
    min-width: 0;
}

.sr-ct__icon-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    text-decoration: none;
    width: 100%;
    min-width: 0;
    min-height: 92px;
    padding: 10px 16px 12px;
    gap: 8px;
    border-right: 1px solid rgba(15,27,45,.12);
    transition: opacity .2s ease, background-color .2s ease;
}

.sr-ct__icon-link:last-child { border-right: 0; }

.sr-ct__icon-link:first-child { padding-left: 0; }

.sr-ct__icon-link:hover {
    opacity: .92;
    background-color: rgba(255,255,255,.26);
}

/* Icon badge – rounded square with tinted background */
.sr-ct__icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    flex-shrink: 0;
}

.sr-ct__icon-badge i,
.sr-ct__icon-badge .sr-ct__icon-svg {
    font-size: 18px;
    color: var(--sr-icon-color, #eb6a05);
}

.sr-ct__icon-badge svg {
    width: 18px;
    height: 18px;
    fill: var(--sr-icon-color, #eb6a05);
}

.sr-ct__icon-label {
    font-size: clamp(10px, 0.95vw, 13px);
    font-weight: 500;
    color: var(--sr-icon-color, #eb6a05);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.sr-ct__icon-arrow {
    font-size: 14px;
    color: var(--sr-ink);
    opacity: 1;
    line-height: 1;
    transition: opacity .2s ease, transform .2s ease;
}

.sr-ct__icon-link:hover .sr-ct__icon-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.sr-collage.is-compact {
    --sr-gap: 14px;
}

.sr-collage.is-compact .sr-wrap {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
        "lt"
        "hero"
        "card"
        "rt"
        "lb";
}

.sr-collage.is-compact .sr-left-top,
.sr-collage.is-compact .sr-card,
.sr-collage.is-compact .sr-left-bottom,
.sr-collage.is-compact .sr-right-top {
    min-height: auto;
}

.sr-collage.is-compact .sr-tile-content-inner,
.sr-collage.is-compact .sr-hero-content,
.sr-collage.is-compact .sr-card-inner {
    padding: 20px;
}

.sr-collage.is-compact .sr-tile-content-inner {
    align-items: flex-start;
}

.sr-collage.is-compact .sr-ct__heading {
    font-size: clamp(1.45rem, 3.6vw, 2.2rem);
}

.sr-collage.is-compact .sr-ct__text {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    line-clamp: 6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
}

.sr-collage.is-compact .sr-ct__icons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sr-collage.is-compact .sr-ct__icon-link {
    min-height: 84px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(15,27,45,.12);
}

.sr-collage.is-compact .sr-ct__icon-link:first-child {
    padding-left: 0;
}

.sr-collage.is-compact .sr-ct__icon-link:nth-child(odd) {
    border-right: 1px solid rgba(15,27,45,.12);
}

.sr-collage.is-compact .sr-ct__icon-link:nth-last-child(-n+2) {
    border-bottom: 0;
}

.sr-collage.is-compact .sr-hero {
    min-height: 520px;
}

.sr-collage.is-compact .sr-left-bottom,
.sr-collage.is-compact .sr-right-top {
    min-height: 220px;
}

.sr-collage.is-mobile {
    padding: 0;
    overflow: visible;
    background: transparent;
}

.sr-collage.is-mobile .sr-wrap {
    height: auto;
    min-height: 0;
    display: block;
}

.sr-collage.is-mobile .sr-left-top,
.sr-collage.is-mobile .sr-left-bottom,
.sr-collage.is-mobile .sr-right-top,
.sr-collage.is-mobile .sr-card {
    display: none;
}

.sr-collage.is-mobile .sr-hero {
    min-height: 0;
    padding-top: 0;
    overflow: visible;
    background: transparent;
}

.sr-collage.is-mobile .sr-hero-bg {
    position: relative;
    inset: auto;
    height: clamp(220px, 60vw, 300px);
    overflow: hidden;
    border-radius: 0;
}

.sr-collage.is-mobile .sr-hero-bg::after,
.sr-collage.is-mobile .sr-hero-bg-overlay {
    background:
        linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.03) 34%, rgba(15,27,45,.10) 100%),
        linear-gradient(0deg, rgba(15,27,45,.14) 0%, rgba(15,27,45,.03) 42%, rgba(255,255,255,.03) 100%);
}

.sr-collage.is-mobile .sr-hero-content {
    max-width: none;
    position: relative;
    z-index: 4;
    margin: -18px 10px 0;
    padding: 18px 16px 16px;
    height: auto;
    justify-content: flex-start;
    background: #f4f1e9;
    border: 1px solid rgba(15,27,45,.08);
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.sr-collage.is-mobile .sr-title {
    font-size: clamp(1.65rem, 8vw, 2.15rem);
    line-height: 1.04;
    margin-bottom: 8px;
}

.sr-collage.is-mobile .sr-sub {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 14px;
    max-width: 100%;
}

.sr-collage.is-mobile .sr-cta-row {
    gap: 8px;
    margin-top: 0;
}

.sr-collage.is-mobile .sr-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 0;
    font-size: 14px;
}

.sr-collage.is-mobile .sr-btn-ghost {
    background: rgba(255,255,255,.92);
}

.sr-collage.is-mobile .sr-hero-nav { display: none; }

/* ── Hero ────────────────────────────────────────────── */

.sr-hero {
    grid-area: hero;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background: #f3f6fb;
    min-width: 0;
    min-height: 100%;
}

.sr-hero-bg {
    position: absolute;
    inset: 0;
}

.sr-hero-bg::after {
    content: "";
    position: absolute; inset: 0;
    z-index: 2;
    background:
        radial-gradient(900px 600px at 35% 55%, rgba(255,255,255,.88), rgba(255,255,255,.35) 55%, rgba(255,255,255,.10) 100%),
        linear-gradient(90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 42%, rgba(255,255,255,.08) 75%);
    pointer-events: none;
}

/* Editor overlay (content_template) */
.sr-hero-bg-overlay {
    position: absolute; inset: 0;
    z-index: 2;
    background:
        radial-gradient(900px 600px at 35% 55%, rgba(255,255,255,.88), rgba(255,255,255,.35) 55%, rgba(255,255,255,.10) 100%),
        linear-gradient(90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 42%, rgba(255,255,255,.08) 75%);
    pointer-events: none;
}

.sr-hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: clamp(26px, 4vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 720px;
    min-width: 0;
}

.sr-title {
    margin: 0 0 16px;
    font-size: clamp(28px, 3.5vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--sr-ink);
    font-weight: 750;
    text-wrap: balance;
}

.sr-sub {
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--sr-muted);
    max-width: 56ch;
}

/* ── CTAs ────────────────────────────────────────────── */

.sr-cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border-radius: 0;
    text-decoration: none;
    font-size: 15px;
    font-weight: 650;
    border: 1px solid rgba(15,27,45,.14);
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.sr-btn:hover { transform: translateY(-1px); }

.sr-btn-primary {
    background: var(--sr-ink);
    border-color: rgba(15,27,45,.18);
    color: #fff;
}
.sr-btn-primary:hover { background: #0b1626; }

.sr-btn-ghost {
    background: rgba(255,255,255,.72);
    color: var(--sr-ink);
}
.sr-btn-ghost:hover { background: rgba(255,255,255,.88); }

/* ── Arrow navigation ────────────────────────────────── */

.sr-hero-nav {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.sr-arrow {
    width: 48px;
    height: 48px;
    border-radius: 0;
    border: 1px solid rgba(15,27,45,.12);
    background: #fff !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--sr-ink);
    font-size: 22px;
    cursor: pointer;
    transition: transform 200ms ease, background 200ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.sr-hero-nav button {
    background: #fff !important;
    box-shadow: none !important;
}

.sr-arrow:hover {
    transform: translateY(-2px);
    background: #fff !important;
}

/* ── Info Card (rechts unten) ────────────────────────── */

.sr-card {
    grid-area: card;
    border-radius: 0;
    overflow: hidden;
    background: #f4f7fb;
    position: relative;
    min-width: 0;
    border: 0;
}

.sr-card-inner {
    height: 100%;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    background: #f4f7fb;
    border: 0;
}

.sr-card-title {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--sr-ink);
    font-weight: 750;
}

.sr-card-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(15,27,45,.72);
    max-width: 44ch;
}

.sr-card-link {
    margin-top: 6px;
    color: var(--sr-ink);
    font-weight: 700;
    text-decoration: none;
    width: fit-content;
}

.sr-card-link:hover { text-decoration: underline; }

/* ── Smooth text swap ────────────────────────────────── */

.sr-fade {
    animation: srFade 520ms cubic-bezier(.22,.9,.2,1) both;
}

@keyframes srFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 1180px) {
    .sr-collage { --sr-gap: 14px; }

    .sr-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 1fr); }

    .sr-tile-content-inner,
    .sr-hero-content,
    .sr-card-inner { padding: 22px; }

    .sr-title { font-size: clamp(26px, 3vw, 44px); }

    .sr-ct__heading { font-size: clamp(1.35rem, 2vw, 1.8rem); }
    .sr-ct__text {
        margin-bottom: 16px;
        font-size: 14px;
        line-height: 1.45;
        display: -webkit-box;
        line-clamp: 5;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 5;
        overflow: hidden;
    }

    .sr-ct__icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sr-ct__icon-link {
        min-height: 72px;
        padding: 8px 8px 10px;
    }
    .sr-ct__icon-badge i,
    .sr-ct__icon-badge .sr-ct__icon-svg { font-size: 16px; }
    .sr-ct__icon-badge svg { width: 16px; height: 16px; }
    .sr-ct__icon-label { font-size: 11px; }
    .sr-ct__icon-arrow { font-size: 12px; }
}

@media (max-width: 980px) {
    .sr-collage { padding: 14px; }

    .sr-tile-content-inner,
    .sr-hero-content,
    .sr-card-inner { padding: 20px; }

    .sr-wrap { grid-template-columns: minmax(0, .95fr) minmax(0, 1.6fr) minmax(0, .95fr); }

    .sr-ct__heading { font-size: clamp(1.25rem, 1.8vw, 1.6rem); }
    .sr-ct__text {
        font-size: 13px;
        line-height: 1.4;
        line-clamp: 4;
        -webkit-line-clamp: 4;
    }

    .sr-ct__icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sr-ct__icon-link {
        min-height: 66px;
        padding: 8px 6px 8px;
    }
    .sr-ct__icon-badge i,
    .sr-ct__icon-badge .sr-ct__icon-svg { font-size: 14px; }
    .sr-ct__icon-badge svg { width: 14px; height: 14px; }
    .sr-ct__icon-label { font-size: 10px; }
    .sr-ct__icon-arrow { font-size: 11px; }
}

@media (max-width: 600px) {
    .sr-hero { min-height: 400px; }
    .sr-left-bottom,
    .sr-right-top { min-height: 180px; }

    .sr-ct__heading { font-size: 1.5em; }
    .sr-ct__icon-badge i,
    .sr-ct__icon-badge .sr-ct__icon-svg {
        font-size: 17px;
    }
    .sr-ct__icon-badge svg {
        width: 17px;
        height: 17px;
    }
    .sr-ct__icon-label { font-size: 12px; }
    .sr-ct__icon-arrow { font-size: 14px; }
    .sr-card-title  { font-size: 22px; }
    .sr-card-inner  { padding: 20px; }

    .sr-hero-nav { margin-top: 16px; gap: 8px; }
    .sr-arrow { width: 42px; height: 42px; font-size: 20px; }
}

@media (max-width: 767px) {
    .sr-collage {
        padding: 0;
        overflow: hidden;
    }

    .sr-wrap {
        height: auto;
        min-height: 0;
        display: block;
    }

    .sr-left-top,
    .sr-left-bottom,
    .sr-right-top,
    .sr-card {
        display: none;
    }

    .sr-hero {
        min-height: clamp(420px, 78svh, 620px);
    }

    .sr-hero-content {
        max-width: none;
        padding: 24px 18px;
        justify-content: flex-end;
    }

    .sr-title {
        font-size: clamp(28px, 9vw, 42px);
        margin-bottom: 12px;
    }

    .sr-sub {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 18px;
        max-width: 100%;
    }

    .sr-cta-row {
        gap: 10px;
    }

    .sr-btn {
        width: 100%;
        min-height: 44px;
    }

    .sr-hero-nav {
        margin-top: 18px;
    }
}

@container hero-collage (max-width: 1180px) {
    .sr-collage { --sr-gap: 14px; }

    .sr-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 1fr); }

    .sr-tile-content-inner,
    .sr-hero-content,
    .sr-card-inner { padding: 22px; }

    .sr-title { font-size: clamp(26px, 3vw, 44px); }

    .sr-ct__heading { font-size: clamp(1.35rem, 2vw, 1.8rem); }
    .sr-ct__text {
        margin-bottom: 16px;
        font-size: 14px;
        line-height: 1.45;
        display: -webkit-box;
        line-clamp: 5;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 5;
        overflow: hidden;
    }

    .sr-ct__icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    .sr-ct__icon-link {
        min-height: 72px;
        padding: 8px 8px 10px;
    }
    .sr-ct__icon-badge i,
    .sr-ct__icon-badge .sr-ct__icon-svg { font-size: 16px; }
    .sr-ct__icon-badge svg { width: 16px; height: 16px; }
    .sr-ct__icon-label { font-size: 11px; }
    .sr-ct__icon-arrow { font-size: 12px; }
}

@container hero-collage (max-width: 980px) {
    .sr-tile-content-inner,
    .sr-hero-content,
    .sr-card-inner { padding: 20px; }

    .sr-wrap { grid-template-columns: minmax(0, .95fr) minmax(0, 1.6fr) minmax(0, .95fr); }

    .sr-ct__heading {
        font-size: clamp(1.25rem, 1.8vw, 1.6rem);
    }

    .sr-ct__text {
        font-size: 13px;
        line-height: 1.4;
        line-clamp: 4;
        -webkit-line-clamp: 4;
    }

    .sr-ct__icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sr-ct__icon-link {
        min-height: 66px;
        padding: 8px 6px 8px;
    }
    .sr-ct__icon-badge i,
    .sr-ct__icon-badge .sr-ct__icon-svg { font-size: 14px; }
    .sr-ct__icon-badge svg { width: 14px; height: 14px; }
    .sr-ct__icon-label { font-size: 10px; }
    .sr-ct__icon-arrow { font-size: 11px; }
}

@container hero-collage (max-width: 767px) {
    .sr-collage {
        padding: 0;
        overflow: hidden;
    }

    .sr-wrap {
        height: auto;
        min-height: 0;
        display: block;
    }

    .sr-left-top,
    .sr-left-bottom,
    .sr-right-top,
    .sr-card {
        display: none;
    }

    .sr-hero {
        min-height: clamp(460px, 86svh, 720px);
    }

    .sr-hero-bg::after,
    .sr-hero-bg-overlay {
        background:
            linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.06) 28%, rgba(255,255,255,.84) 100%),
            linear-gradient(0deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.36) 54%, rgba(255,255,255,.08) 100%);
    }

    .sr-hero-content {
        max-width: none;
        padding: 28px 18px 22px;
        justify-content: flex-end;
    }

    .sr-title {
        font-size: clamp(2rem, 10vw, 2.75rem);
        line-height: 1.02;
        margin-bottom: 10px;
    }

    .sr-sub {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
        max-width: 100%;
    }

    .sr-cta-row {
        gap: 10px;
        margin-top: 0;
    }

    .sr-btn {
        width: 100%;
        min-height: 46px;
        padding: 0 16px;
    }

    .sr-hero-nav {
        margin-top: 14px;
        justify-content: flex-start;
    }

    .sr-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ── Reduced motion ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .sr-bg    { transition: none !important; }
    .sr-fade  { animation: none !important; }
}
