/* =========================================================================
   Open Case Studies - Single Template (Dark Theme)
   ========================================================================= */

/* Reset Salient theme defaults within our scope */
.ocs-single-case-study {
    background-color: #0f0f23;
    color: #e0e0e0;
    font-family: inherit;
    line-height: 1.7;
    margin: 0 -50vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

.ocs-single-case-study *,
.ocs-single-case-study *::before,
.ocs-single-case-study *::after {
    box-sizing: border-box;
}

.ocs-single-case-study a {
    color: inherit;
    text-decoration: none;
}

.ocs-single-case-study img {
    max-width: 100%;
    height: auto;
}

/* Container */
.ocs-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================================
   HERO
   ========================================================================= */

.ocs-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 24px 50px;
}

.ocs-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 15, 35, 0.95) 0%, rgba(15, 15, 35, 0.4) 50%, rgba(15, 15, 35, 0.2) 100%);
    z-index: 1;
}

.ocs-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.ocs-hero-back {
    display: inline-block;
    color: #F4A10D;
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.ocs-hero-back:hover {
    opacity: 1;
}

.ocs-hero-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 20px 0;
    max-width: 700px;
}

.ocs-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ocs-tag-pill {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.ocs-tag-pill:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* =========================================================================
   SECTIONS - Common
   ========================================================================= */

.ocs-section {
    padding: 60px 0;
}

.ocs-section-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.ocs-section-number {
    font-size: 80px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.06);
    line-height: 1;
    position: absolute;
    top: -10px;
    right: 0;
}

.ocs-text-content {
    font-size: 15px;
    line-height: 1.8;
    color: #c0c0d0;
}

.ocs-text-content p {
    margin: 0 0 12px 0;
}

/* Two column layout */
.ocs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.ocs-two-col-reverse {
    direction: ltr;
}

.ocs-col-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.ocs-col-text {
    position: relative;
}

/* =========================================================================
   CLIENT CARD
   ========================================================================= */

.ocs-client-card {
    padding: 40px 0;
}

.ocs-client-card-inner {
    background: #1a1a36;
    border-radius: 12px;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.ocs-client-info {
    flex: 1;
}

.ocs-client-card .ocs-section-title {
    font-size: 28px;
    margin-bottom: 12px;
}

.ocs-client-description {
    font-size: 14px;
    color: #a0a0b8;
    line-height: 1.7;
    margin: 0;
}

.ocs-client-logo {
    flex-shrink: 0;
    max-width: 200px;
}

.ocs-client-logo img {
    max-height: 80px;
    width: auto;
    filter: brightness(1.1);
}

/* =========================================================================
   CHALLENGE
   ========================================================================= */

.ocs-challenge {
    padding: 40px 0;
}

/* =========================================================================
   PROPOSTA
   ========================================================================= */

.ocs-proposta {
    padding: 40px 0;
}

/* =========================================================================
   PROGETTAZIONE
   ========================================================================= */

.ocs-progettazione {
    padding: 40px 0;
}

.ocs-progettazione .ocs-col-image img {
    border-radius: 8px;
}

/* =========================================================================
   STRATEGIA
   ========================================================================= */

.ocs-strategia {
    padding: 60px 0;
}

.ocs-strategia-header {
    text-align: center;
    margin-bottom: 40px;
}

.ocs-strategia-subtitle {
    font-size: 14px;
    color: #a0a0b8;
    font-style: italic;
    margin: 8px 0 0 0;
}

.ocs-strategia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.ocs-strategia-card {
    background: #1a1a36;
    border-radius: 12px;
    padding: 30px;
}

.ocs-strategia-icon {
    margin-bottom: 16px;
}

.ocs-strategia-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.ocs-strategia-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.ocs-strategia-card-text {
    font-size: 14px;
    color: #a0a0b8;
    line-height: 1.7;
    margin: 0;
}

/* =========================================================================
   SUMMARY
   ========================================================================= */

.ocs-summary {
    padding: 50px 0;
}

.ocs-summary-text {
    font-size: 15px;
    line-height: 1.8;
    color: #c0c0d0;
    max-width: 900px;
    margin: 0 auto;
}

.ocs-summary-text strong,
.ocs-summary-text b {
    color: #ffffff;
    font-weight: 700;
}

/* =========================================================================
   GALLERY
   ========================================================================= */

/* ── Gallery: Hero + Thumbs ─────────────────────────────────────────────── */
.ocs-gallery {
    padding: 40px 0 60px;
}

.ocs-gallery-layout {
    display: grid;
    grid-template-columns: 1fr 0.45fr;
    gap: 16px;
    height: 480px;
}

/* ── Main Swiper ── */
.ocs-gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.ocs-gallery-swiper {
    width: 100%;
    height: 100%;
}

.ocs-gallery-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Video slide (facade + activated iframe) ── */
.ocs-slide-video {
    position: relative;
    background: #000;
}

.ocs-slide-video .ocs-video-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a36 0%, #0f0f23 100%);
}

.ocs-slide-video .ocs-video-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ocs-slide-video .ocs-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(244, 161, 13, 0.95);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background 0.2s;
    padding-left: 4px; /* optical centering of play triangle */
    pointer-events: none;
}

.ocs-slide-video .ocs-video-facade:hover .ocs-video-play,
.ocs-slide-video .ocs-video-facade:focus-visible .ocs-video-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: #F4A10D;
}

.ocs-video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 2px; /* optical centering of play triangle */
    backdrop-filter: blur(4px);
    z-index: 2;
    pointer-events: none;
}

/* Iframe overlays the facade absolutely (not innerHTML-replacing it),
   so Swiper-cloned slides keep their facade markup intact. */
.ocs-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    z-index: 5;
    display: block;
}

/* Thumbnail badge for video thumbs */
.ocs-gallery-thumb-video .ocs-video-badge {
    width: 22px;
    height: 22px;
    top: 6px;
    right: 6px;
    backdrop-filter: none; /* avoid GPU cost when many thumbs render */
}

.ocs-gallery-thumb-video .ocs-video-badge svg {
    width: 11px;
    height: 11px;
}

/* Layout fallback when the gallery has only one item (no thumb sidebar, no arrows). */
.ocs-gallery-layout.ocs-gallery-single {
    grid-template-columns: 1fr;
}

/* Nav arrows — overlaid on main image */
.ocs-gallery-prev,
.ocs-gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #F4A10D;
    color: #ffffff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ocs-gallery-prev { left: 14px; }
.ocs-gallery-next { right: 14px; }

.ocs-gallery-prev:hover,
.ocs-gallery-next:hover {
    background: #d9900b;
    transform: translateY(-50%) scale(1.08);
}

/* ── Thumbnails sidebar ── */
.ocs-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.ocs-gallery-thumb {
    flex: 1 1 0;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, box-shadow 0.3s;
    position: relative;
}

.ocs-gallery-thumb.is-active {
    opacity: 1;
    box-shadow: 0 0 0 2px #F4A10D;
}

.ocs-gallery-thumb:hover {
    opacity: 0.85;
}

.ocs-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 768px) {
    .ocs-hero {
        min-height: 380px;
        padding: 40px 20px 30px;
    }

    .ocs-hero-title {
        font-size: 28px;
    }

    .ocs-two-col,
    .ocs-two-col-reverse {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ocs-proposta .ocs-two-col-reverse .ocs-col-image {
        order: -1;
    }

    .ocs-client-card-inner {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .ocs-client-logo {
        order: -1;
    }

    .ocs-section-number {
        font-size: 50px;
        position: static;
        margin-bottom: -10px;
    }

    .ocs-strategia-grid {
        grid-template-columns: 1fr;
    }

    .ocs-gallery-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .ocs-gallery-main {
        height: 260px;
    }

    .ocs-gallery-thumbs {
        flex-direction: row;
        height: 80px;
        overflow-x: auto;
    }

    .ocs-gallery-thumb {
        flex: 0 0 120px;
        min-height: auto;
    }

    .ocs-slide-video .ocs-video-play {
        width: 56px;
        height: 56px;
    }

    .ocs-video-badge {
        backdrop-filter: none;
    }

    .ocs-container {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .ocs-hero-title {
        font-size: 24px;
    }

    .ocs-slide-video .ocs-video-play {
        width: 48px;
        height: 48px;
    }

    .ocs-section-title {
        font-size: 24px;
    }

    .ocs-section {
        padding: 40px 0;
    }
}
