/* =========================================================
   COSSELIE Style Reel — Frontend
   ========================================================= */

/* ---------- Base section ---------- */

.cosselie-style-reel {
    --sr-text: #201916;
    --sr-muted: #766b65;
    --sr-border: rgba(32, 25, 22, 0.12);
    --sr-card: #fffaf6;

    width: 100%;
    max-width: none;
    margin: 52px 0;
    clear: both;
}

.cosselie-style-reel__inner {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 42px);
    text-align: center;
}

/* ---------- Headings ---------- */

.cosselie-style-reel__title {
    margin: 0;
    color: var(--sr-text);
    font-size: clamp(26px, 3vw, 42px);
    line-height: 1.08;
    font-weight: 850;
}

.cosselie-style-reel__subtitle {
    max-width: 760px;
    margin: 12px auto 26px;
    color: var(--sr-muted);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
}

/* ---------- Swiper carousel ---------- */

.cosselie-style-reel__shell {
    position: relative;
}

.cosselie-style-reel__swiper {
    width: 100%;
    overflow: hidden;
    padding: 8px 4px 16px;
}

.cosselie-style-reel__swiper .swiper-wrapper {
    align-items: stretch;
}

.cosselie-style-reel__item {
    height: auto;
    overflow: hidden;
    border: 1px solid var(--sr-border);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 16px 45px rgba(32, 25, 22, 0.08);
    text-align: left;
    cursor: default;
}

.cosselie-style-reel__item[data-cosselie-sr-open-media="1"] .cosselie-style-reel__media {
    cursor: zoom-in;
}

/* ---------- Media ---------- */

.cosselie-style-reel__media {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--sr-card);
}

.cosselie-style-reel__media img,
.cosselie-style-reel__media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cosselie-style-reel__media video:not([controls]) {
    cursor: pointer;
}

/* ---------- Meta ---------- */

.cosselie-style-reel__meta {
    display: grid;
    gap: 5px;
    padding: 14px 16px 16px;
    color: var(--sr-muted);
    font-size: 14px;
    line-height: 1.45;
}

.cosselie-style-reel__meta strong {
    color: var(--sr-text);
    font-size: 15px;
}

.cosselie-style-reel__meta a {
    color: var(--sr-text);
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Carousel arrows / pagination ---------- */

.cosselie-style-reel__arrow {
    position: absolute;
    top: 43%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #201916;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(32, 25, 22, 0.22);
}

.cosselie-style-reel__arrow--prev {
    left: 8px;
}

.cosselie-style-reel__arrow--next {
    right: 8px;
}

.cosselie-style-reel__pagination {
    position: static;
    margin-top: 8px;
}

.cosselie-style-reel--is-static .cosselie-style-reel__pagination {
    display: none;
}

/* ---------- CTA ---------- */

.cosselie-style-reel__cta-wrap {
    margin-top: 24px;
}

.cosselie-style-reel__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    background: #201916;
    color: #fff !important;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 14px 30px rgba(32, 25, 22, 0.18);
}

.cosselie-style-reel__cta:hover {
    background: #4d3a32;
    color: #fff !important;
}

/* ---------- Swiper modal / lightbox ---------- */

html.cosselie-sr-modal-open,
html.cosselie-sr-modal-open body {
    overflow: hidden !important;
}

.cosselie-sr-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.92);
}

.cosselie-sr-modal__swiper {
    width: 100%;
    height: 100%;
}

.cosselie-sr-modal__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 54px 18px 44px;
}

.cosselie-sr-modal__slide img,
.cosselie-sr-modal__slide video {
    display: block;
    width: auto;
    max-width: min(96vw, 1400px);
    height: auto;
    max-height: calc(100dvh - 110px);
    object-fit: contain;
    border-radius: 16px;
}

.cosselie-sr-modal__slide video {
    width: min(96vw, 1200px) !important;
    max-width: min(96vw, 1200px) !important;
    background: #000;
}

.cosselie-sr-modal__close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #201916;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.cosselie-sr-modal__nav {
    position: fixed;
    top: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #201916;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.cosselie-sr-modal__nav--prev {
    left: 14px;
}

.cosselie-sr-modal__nav--next {
    right: 14px;
}

.cosselie-sr-modal__pagination {
    bottom: 14px !important;
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
    .cosselie-style-reel__inner {
        padding: 0 12px;
    }

    .cosselie-style-reel__subtitle {
        margin-bottom: 22px;
    }

    .cosselie-style-reel__arrow {
        display: none;
    }

    .cosselie-sr-modal__slide {
        padding: 52px 10px 42px;
    }

    .cosselie-sr-modal__slide img,
    .cosselie-sr-modal__slide video {
        max-width: calc(100vw - 20px);
        max-height: calc(100dvh - 102px);
        border-radius: 12px;
    }

    .cosselie-sr-modal__slide video {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
    }

    .cosselie-sr-modal__nav {
        display: none;
    }
}

/* Single-item launch state: keep one video/image as a centered reel card, not huge full-width */
/* Static reels: keep 1–8 items as sane centered cards, not huge Swiper columns */
.cosselie-style-reel--is-static .cosselie-style-reel__swiper .swiper-wrapper {
    justify-content: center;
}

.cosselie-style-reel--is-static .cosselie-style-reel__swiper .swiper-slide {
    width: min(calc((100% - ((var(--cosselie-sr-visible-count) - 1) * 18px)) / var(--cosselie-sr-visible-count)),
            420px) !important;
    max-width: 420px;
}

@media (max-width: 900px) {
    .cosselie-style-reel--is-static .cosselie-style-reel__swiper .swiper-slide {
        width: calc((100% - 12px) / 2) !important;
        max-width: none;
    }

    .cosselie-style-reel--is-static .cosselie-style-reel__swiper .swiper-slide:only-child {
        width: min(100%, 340px) !important;
        max-width: 340px;
    }
}