/* ===== Portfolio Brochures Carousel ===== */

.sp-brochures {
    width: 100%;
    padding: 120px 5vw;
    background: var(--neutral-850);
    color: var(--color-text);
}

.sp-brochures__heading {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    margin: 0 0 48px;
    text-align: center;
    letter-spacing: -0.01em;
}

.sp-brochures__swiper {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4px 60px;
    overflow: visible;
}

.sp-brochures__swiper .swiper-wrapper {
    padding: 2px 0;
}

.sp-brochures.is-solo .sp-brochures__swiper {
    max-width: 420px;
    padding: 0;
}

.sp-brochures.is-solo .swiper-wrapper {
    justify-content: center;
}

/* ===== Card ===== */

.sp-brochures__slide {
    height: auto;
    display: flex;
}

.sp-brochures__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--neutral-750);
    border: 1px solid var(--neutral-700);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.3s ease;
}

.sp-brochures__card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
}

.sp-brochures__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--neutral-900);
    cursor: pointer;
}

.sp-brochures__media._df_button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}



/* dFlip Lite lightbox theming — scoped to single portfolio */

.df-popup-button:hover {
    background: none;
}

.single-portfolio .df-lightbox-wrapper {
    backdrop-filter: blur(12px);
}

.single-portfolio .df-ui-overlay {
    background: rgba(14, 14, 14, 0.7);
}

.single-portfolio .df-container,
.single-portfolio .df-ui-wrapper {
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.single-portfolio .df-ui-controls {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 0 0 8px 8px;
}

.single-portfolio .df-ui-btn {
    color: var(--neutral-750);
    transition: color 0.3s ease;
}

.single-portfolio .df-ui-btn:hover {
    color: var(--color-accent);
}

.single-portfolio .df-lightbox-controls {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
}

.single-portfolio .df-lightbox-close {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.single-portfolio .df-lightbox-close::before {
    color: var(--neutral-0);
    font-size: 16px;
    filter: none;
}

.single-portfolio .df-lightbox-close:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.single-portfolio .df-lightbox-close:hover::before {
    color: var(--neutral-900);
}

/* Navigation arrows */
.single-portfolio .df-ui-nav {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    opacity: 1;
}

.single-portfolio .df-ui-nav:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.single-portfolio .df-ui-nav .df-ui-btn {
    top: 45%;
}

.single-portfolio .df-ui-nav.df-ui-prev .df-ui-btn {
    left: 13px;
}

.single-portfolio .df-ui-nav.df-ui-next .df-ui-btn {
    right: 13px;
}

.single-portfolio .df-ui-nav .df-ui-btn {
    color: var(--neutral-0);
}

.single-portfolio .df-ui-nav .df-ui-btn::before {
    filter: none;
    color: var(--neutral-0);
    font-size: 16px;
}

.single-portfolio .df-ui-nav:hover .df-ui-btn::before {
    color: var(--neutral-900);
}

.single-portfolio .df-container .df-bg {
    background-color: transparent !important;
}

.single-portfolio .df-lightbox-wrapper .df-lightbox-bg {
    background-color: transparent !important;
}

.sp-brochures__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.sp-brochures__card:hover .sp-brochures__thumb {
    transform: scale(1.04);
}

.sp-brochures__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--color-accent);
}

.sp-brochures__ext {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* ===== Body ===== */

.sp-brochures__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
}

.sp-brochures__swiper .sp-brochures__title {
    font-size: 2rem !important;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.sp-brochures__meta {
    font-size: 0.8rem;
    opacity: 0.55;
    letter-spacing: 0.04em;
}

.sp-brochures__download {
    margin-top: auto;
    padding-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-decoration: none;
    width: fit-content;
    transition: gap 0.3s ease;
}

.sp-brochures__download:hover {
    gap: 14px;
}

.sp-brochures__icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    overflow: hidden;
}

.sp-brochures__icon svg {
    position: absolute;
    left: 0;
    top: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-brochures__icon svg:nth-child(2) {
    transform: translateY(100%);
}

.sp-brochures__download:hover .sp-brochures__icon svg:nth-child(1) {
    transform: translateY(-100%);
}

.sp-brochures__download:hover .sp-brochures__icon svg:nth-child(2) {
    transform: translateY(0);
}


/* ===== Swiper controls ===== */

.sp-brochures__pagination {
    position: relative;
    margin-top: 56px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.sp-brochures__pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: var(--neutral-600);
    opacity: 1;
    margin: 0 !important;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.sp-brochures__pagination .swiper-pagination-bullet-active {
    background: var(--color-accent);
}

.sp-brochures__prev,
.sp-brochures__next {
    position: absolute;
    top: auto;
    bottom: 0;
    width: 44px;
    height: 44px;
    background: var(--neutral-750);
    border: 1px solid var(--neutral-700);
    border-radius: 50%;
    color: var(--color-text);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    margin: 0;
    transform: translateY(50%);
}

.sp-brochures__prev:hover,
.sp-brochures__next:hover,
.sp-brochures__prev:active,
.sp-brochures__next:active,
.sp-brochures__prev:focus,
.sp-brochures__next:focus,
.sp-brochures__prev:focus-visible,
.sp-brochures__next:focus-visible {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--neutral-900);
    outline: none;
}

.sp-brochures__prev::after,
.sp-brochures__next::after {
    font-size: 14px;
    font-weight: 700;
}

.sp-brochures__next { right: 0; left: auto; }
.sp-brochures__prev { right: 56px; left: auto; }

.sp-brochures__swiper .swiper-button-disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
    .sp-brochures {
        padding: 80px 5vw;
    }

    .sp-brochures__swiper {
        padding: 0 40px;
    }

    .sp-brochures__prev,
    .sp-brochures__next {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 600px) {
    .sp-brochures {
        padding: 64px 5vw;
    }

    .sp-brochures__swiper {
        padding: 0 14vw;
    }

    .sp-brochures__heading {
        margin-bottom: 32px;
    }

    .sp-brochures.is-solo .sp-brochures__swiper {
        max-width: 320px;
    }

    .sp-brochures__media {
        aspect-ratio: 4 / 3;
    }

    .sp-brochures__swiper .sp-brochures__title {
        font-size: 1.35rem !important;
    }

    .sp-brochures__prev,
    .sp-brochures__next {
        display: none;
    }

    .sp-brochures__pagination {
        justify-content: center;
        margin-top: 32px;
    }

    .sp-brochures__body {
        padding: 20px;
    }
}


/* =============================================================
   Coverflow Carousel (new design)
   ============================================================= */

.sp-brochures--coverflow .sp-brochures__pagination {
    display: none;
}

.sp-brochures--coverflow {
    padding: 160px 0;
    overflow: hidden;
}

/* Top bar — counter + heading */
.sp-brochures--coverflow .sp-brochures__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 5vw;
    margin-bottom: 48px;
}

.sp-brochures__counter {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.sp-brochures--coverflow .sp-brochures__heading {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-soft);
    text-align: right;
}

/* Swiper overrides for coverflow */
.sp-brochures--coverflow .sp-brochures__swiper {
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.sp-brochures--coverflow .sp-brochures__swiper .swiper-wrapper {
    padding: 0;
    align-items: center;
}

/* Slides — scale, blur and fade non-active */
.sp-brochures--coverflow .sp-brochures__slide {
    height: auto;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
    opacity: 0.25;
    filter: blur(6px);
}

.sp-brochures--coverflow .sp-brochures__slide.swiper-slide-active {
    opacity: 1;
    filter: blur(0);
    z-index: 2;
}

.sp-brochures--coverflow .sp-brochures__slide.swiper-slide-prev,
.sp-brochures--coverflow .sp-brochures__slide.swiper-slide-next {
    opacity: 0.45;
    filter: blur(3px);
}

/* Solo brochure — Swiper not initialised, center the single slide */
.sp-brochures--coverflow.sp-brochures--solo .sp-brochures__swiper {
    mask-image: none;
    -webkit-mask-image: none;
}

.sp-brochures--coverflow.sp-brochures--solo .swiper-wrapper {
    justify-content: center;
}

/* Solo brochure — width matches active slide of multi-slide carousel
   (100vw / slidesPerView at each breakpoint, see brochures.js) */
.sp-brochures--coverflow.sp-brochures--solo .sp-brochures__slide {
    width: 80vw !important;
    max-width: 80vw;
    opacity: 1;
    filter: none;
}

@media (min-width: 768px) {
    .sp-brochures--coverflow.sp-brochures--solo .sp-brochures__slide {
        width: 66.67vw !important;
        max-width: 66.67vw;
    }
}

@media (min-width: 1400px) {
    .sp-brochures--coverflow.sp-brochures--solo .sp-brochures__slide {
        width: 58.82vw !important;
        max-width: 58.82vw;
    }
}

.sp-brochures--coverflow.sp-brochures--solo .sp-brochures__prev,
.sp-brochures--coverflow.sp-brochures--solo .sp-brochures__next {
    display: none;
}

/* Page (image container) */
.sp-brochures__page {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    background: var(--neutral-900);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.sp-brochures__page:active {
    transform: scale(0.97);
}

.sp-brochures--coverflow .swiper-slide-active .sp-brochures__page {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.sp-brochures--coverflow .swiper-slide-active .sp-brochures__page:hover {
    transform: scale(1.02);
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.65);
}

.sp-brochures__page:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.sp-brochures__image {
    width: 100%;
    height: auto;
    /* Preserve full aspect ratio — never crop the brochure */
    object-fit: contain;
    display: block;
    /* Cap the height so very tall brochures stay within the viewport,
       but let landscape brochures grow as wide as the slide allows. */
    max-height: 54vh;
    margin: 0 auto;
}

/* Page falls back to placeholder when no thumbnail — match image slide proportions */
.sp-brochures--coverflow .sp-brochures__page.is-placeholder {
    width: 100%;
    aspect-ratio: 19 / 8;
}

@media (max-width: 1199px) {
    .sp-brochures--coverflow .sp-brochures__page.is-placeholder {
        aspect-ratio: 16 / 10;
    }
}

/* Active slide gets a generous min-height so even ultra-wide brochures
   feel impactful and the carousel never collapses to a thin strip. */
.sp-brochures--coverflow .swiper-slide-active .sp-brochures__page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-brochures--coverflow .sp-brochures__placeholder {
    color: var(--color-accent);
    gap: 16px;
}

.sp-brochures--coverflow .sp-brochures__placeholder svg {
    width: 72px;
    height: 84px;
}

.sp-brochures--coverflow .sp-brochures__ext {
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    opacity: 0.85;
}

/* Navigation arrows — coverflow version */
.sp-brochures--coverflow .sp-brochures__prev,
.sp-brochures--coverflow .sp-brochures__next {
    position: absolute;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 10;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: var(--neutral-0);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    margin: 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.sp-brochures--coverflow .sp-brochures__prev { left: 3vw; right: auto; }
.sp-brochures--coverflow .sp-brochures__next { right: 3vw; left: auto; }

.sp-brochures--coverflow .sp-brochures__prev svg,
.sp-brochures--coverflow .sp-brochures__next svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.75;
}

.sp-brochures--coverflow .sp-brochures__prev::after,
.sp-brochures--coverflow .sp-brochures__next::after {
    display: none;
}

.sp-brochures--coverflow .sp-brochures__prev:hover,
.sp-brochures--coverflow .sp-brochures__next:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--neutral-900);
    transform: translateY(-50%) scale(1.05);
}

.sp-brochures--coverflow .sp-brochures__prev:active,
.sp-brochures--coverflow .sp-brochures__next:active {
    transform: translateY(-50%) scale(0.96);
}

/* Coverflow responsive */

/* Tablet — let the image grow taller; preserve full aspect ratio. */
@media (max-width: 1199px) {
    .sp-brochures--coverflow .swiper-slide-active .sp-brochures__page {
        min-height: 50vh;
    }

    .sp-brochures--coverflow .sp-brochures__image {
        max-height: 65vh;
    }
}

@media (max-width: 768px) {
    .sp-brochures--coverflow {
        padding: 64px 0;
    }

    .sp-brochures--coverflow .sp-brochures__top {
        margin-bottom: 32px;
    }

    .sp-brochures--coverflow .sp-brochures__counter {
        font-size: 1rem;
        letter-spacing: 0.04em;
    }

    .sp-brochures--coverflow .sp-brochures__heading {
        font-size: 0.75rem !important;
        letter-spacing: 0.08em;
    }

    /* Mobile — keep aspect ratio intact, just cap the height. */
    .sp-brochures--coverflow .swiper-slide-active .sp-brochures__page {
        min-height: 40vh;
    }

    .sp-brochures--coverflow .sp-brochures__image {
        max-height: 55vh;
    }

    .sp-brochures--coverflow .sp-brochures__prev,
    .sp-brochures--coverflow .sp-brochures__next {
        display: none;
    }

    .sp-brochures--coverflow .sp-brochures__pagination {
        display: flex;
        justify-content: center;
        margin-top: 24px;
        position: relative;
    }

    .single-portfolio .df-ui-nav .df-ui-btn {
        top: 42%;
    }
}
