/**
 * File: cases-carousel.css
 *
 * @author Daniel Sturm <d.sturm@zirkeldesign.de>
 */

/* ── Section wrapper ────────────────────────────────────────────────────── */
.bp-cases-carousel {
    padding: 60px 0 80px;
    background: #fff;
}

/* ── Inner container — container query root for arrow positioning ────────── */
.bp-cases-carousel__inner {
    container-type: inline-size;
    container-name: cases-inner;
    max-width: 1100px;
    width: 90%;
    margin: 0 auto;
}

/* ── Heading — mirrors Bridge section title style ───────────────────────── */
.bp-cases-carousel__heading {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 400;
    font-size: 1.25rem;
    margin: 0;
    color: inherit;
}

/* Teal rule — matches Bridge separator (6px × 32px, #468f9e) */
.bp-cases-carousel__heading::after {
    content: "";
    display: block;
    width: 32px;
    height: 6px;
    background: #468f9e;
    margin: 24px auto 36px;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.bp-cases-carousel__item {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.bp-cases-carousel__image {
    overflow: hidden;
}

.bp-cases-carousel__image img,
.bp-cases-carousel__image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.bp-cases-carousel__image img {
    transition: transform 0.4s ease;
}

.bp-cases-carousel__item:hover .bp-cases-carousel__image img {
    transform: scale(1.04);
}

.bp-cases-carousel__image-placeholder {
    background: #c8c8c8;
}

/* ── Overlay — CSS Grid: row 1 (hover-content), row 2 (title) ───────────── */
.bp-cases-carousel__overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, transparent 65%);
    color: #fff;
    transition: background 0.35s ease;
}

.bp-cases-carousel__item:hover .bp-cases-carousel__overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.28) 100%);
}

/* Hover content (excerpt + CTA) — sits in row 1, aligned to its bottom.
   Uses opacity/transform so it never takes extra space; title stays pinned. */
.bp-cases-carousel__hover-content {
    align-self: end;
    padding-block-end: 12px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bp-cases-carousel__item:hover .bp-cases-carousel__hover-content {
    opacity: 1;
    transform: translateY(0);
}

/* Title — row 2, always visible at the bottom of the card */
.bp-cases-carousel__title {
    margin: 0;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.bp-cases-carousel__excerpt {
    margin: 0 0 10px;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.5;
    font-weight: 400;
}

/* CTA button — CI blue bg + white; hover: CI orange */
.bp-cases-carousel__cta {
    display: inline-block;
    padding: 8px 20px;
    background: #468f9e;
    color: #fff;
    border: none;
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: background 0.2s ease;
}

.bp-cases-carousel__item:hover .bp-cases-carousel__cta:hover {
    background: #ef6a00;
}

/* ── Splide arrows — CI colors; outside carousel when container is wide ──── */
.bp-cases-carousel .splide__arrow {
    background: #468f9e;
    opacity: 1;
}

.bp-cases-carousel .splide__arrow:hover:not(:disabled) {
    background: #ef6a00;
    opacity: 1;
}

.bp-cases-carousel .splide__arrow svg {
    fill: #fff;
}

/* Outside the track when the inner container has enough room */
@container cases-inner (min-width: 950px) {
    .bp-cases-carousel .splide__arrow--prev {
        left: -3rem;
    }

    .bp-cases-carousel .splide__arrow--next {
        right: -3rem;
    }
}

/* ── Splide pagination — default library dots, active dot tinted teal ────── */
.bp-cases-carousel .splide__pagination__page.is-active {
    background: #468f9e;
}

/* Extra bottom space so pagination dots don't overlap content below */
.bp-cases-carousel .splide {
    padding-bottom: 48px;
}
