/* =========================================================
   IMPRINT VIDEO SPOTLIGHT MANAGER
   Premium editorial carousel card design
   Version: consolidated stylesheet
   ========================================================= */

/* ---------------------------------------------------------
   1. WRAPPER
--------------------------------------------------------- */

.ivsm-wrap {
    --ivsm-blue: #0f5384;
    --ivsm-glow: rgba(15, 83, 132, 0.14);
    --ivsm-card-border: #dfe5ea;

    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 0 22px;
    position: relative;
    font-family: inherit;
    box-sizing: border-box;
}

.ivsm-wrap *,
.ivsm-wrap *::before,
.ivsm-wrap *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   2. CAROUSEL STAGE
--------------------------------------------------------- */

.ivsm-stage {
    position: relative;
    width: 100%;
    height: clamp(380px, 40vw, 500px);
    overflow: hidden;
    isolation: isolate;
}

/* ---------------------------------------------------------
   3. VIDEO CARDS - BASE
--------------------------------------------------------- */

.ivsm-card {
    position: absolute;
    left: 50%;
    top: 50%;

    width: min(48%, 540px);
    height: 88%;
    max-height: 440px;

    display: flex;
    flex-direction: column;

    background: #ffffff;
    border: 0;
    border-radius: 14px;
    overflow: hidden;

    transform: translate(-50%, -50%) scale(0.72);

    opacity: 0;
    filter: blur(7px) brightness(0.58);

    z-index: 1;
    cursor: pointer;
    outline: none;
    pointer-events: none;

    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);

    transition:
        transform 0.55s cubic-bezier(0.22, 0.75, 0.25, 1),
        opacity 0.5s ease,
        filter 0.5s ease,
        box-shadow 0.4s ease;
}

/*
   A separate border layer stays attached to the card
   while the card scales on hover. This avoids the
   border appearing uneven or displaced.
*/
.ivsm-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--ivsm-card-border);
    border-radius: 14px;
    pointer-events: none;
    z-index: 10;
}

/* ---------------------------------------------------------
   4. CENTRE / ACTIVE CARD
--------------------------------------------------------- */

.ivsm-card.is-center {
    transform: translate(-50%, -50%) scale(1);

    opacity: 1;
    filter: none;

    z-index: 3;
    pointer-events: auto;

    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.07),
        0 0 12px rgba(15, 83, 132, 0.07);
}

/* Only the centre card grows gently on hover */
.ivsm-card.is-center:hover {
    transform: translate(-50%, -50%) scale(1.025);
    opacity: 1;
    filter: none;
    z-index: 5;

    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.09),
        0 0 16px rgba(15, 83, 132, 0.12);
}

.ivsm-card.is-center:hover::after {
    border-color: #d4dee6;
}

/* ---------------------------------------------------------
   5. LEFT AND RIGHT SIDE CARDS
--------------------------------------------------------- */

.ivsm-card.is-left {
    transform: translate(calc(-50% - 65%), -50%) scale(0.76);
    opacity: 0.62;
    filter: blur(4px) brightness(0.68);
    z-index: 2;
    pointer-events: auto;
}

.ivsm-card.is-right {
    transform: translate(calc(-50% + 65%), -50%) scale(0.76);
    opacity: 0.62;
    filter: blur(4px) brightness(0.68);
    z-index: 2;
    pointer-events: auto;
}

/*
   Side cards remain visually stationary on hover.
   They remain clickable so a visitor can bring one
   into the centre position.
*/
.ivsm-card.is-left:hover {
    transform: translate(calc(-50% - 65%), -50%) scale(0.76);
    opacity: 0.62;
    filter: blur(4px) brightness(0.68);
    z-index: 2;
}

.ivsm-card.is-right:hover {
    transform: translate(calc(-50% + 65%), -50%) scale(0.76);
    opacity: 0.62;
    filter: blur(4px) brightness(0.68);
    z-index: 2;
}

/* ---------------------------------------------------------
   6. THUMBNAIL
   Inset slightly inside the white card.
   Play button is positioned relative to this area only.
--------------------------------------------------------- */

.ivsm-card-image {
    position: relative;

    flex: 0 0 auto;
    display: block;

    width: calc(100% - 12px);
    aspect-ratio: 16 / 9;
    height: auto;

    margin: 6px auto 0;
    padding: 0;

    overflow: hidden;
    background: #f1f3f5;

    border: 1px solid #E1E6EB;
    border-radius: 8px;
    box-shadow: none;
}

.ivsm-card-image img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    border: 1px solid #E1E6EB;
    border-radius: 7px;
}


/* No dark overlay across the thumbnail */
.ivsm-card-shade {
    display: none;
}

/* ---------------------------------------------------------
   7. PLAY BUTTON
   It appears only on the centre card's thumbnail.
--------------------------------------------------------- */

.ivsm-play {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;

    background: rgba(15, 83, 132, 0.96);

    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;

    z-index: 5;
    pointer-events: none;

    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        background 0.3s ease;
}

/* Show the play button only on the active thumbnail */
.ivsm-card.is-center .ivsm-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ivsm-play span {
    display: block;
    width: 0;
    height: 0;

    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #ffffff;

    margin-left: 4px;
}

.ivsm-card.is-center:hover .ivsm-play {
    background: #0b659f;
    transform: translate(-50%, -50%) scale(1.08);
}

/* ---------------------------------------------------------
   8. TITLE AND DESCRIPTION
   Both appear below the thumbnail, on the white card.
--------------------------------------------------------- */

.ivsm-card-caption {
    position: relative;

    flex: 1 1 auto;
    min-height: 0;

    display: block;

    padding: 11px 16px 13px;

    color: #222222;
    background: #ffffff;

    opacity: 1;
    transform: none;

    z-index: 2;
    overflow: hidden;

    transition: none;
}

/* Video title: reserve space for two lines */
.ivsm-card-caption h3 {
    color: #171717;
    font-family: inherit;

    font-size: clamp(15px, 1.4vw, 19px);
    font-weight: 700;
    line-height: 1.32;

    margin: 0 0 6px;

    min-height: 2.64em;
    max-height: 2.64em;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}

/* Video description: maximum two lines */
.ivsm-card-caption p {
    color: #666666;
    font-family: inherit;

    font-size: 12px;
    line-height: 1.5;

    margin: 0;
    max-width: 100%;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* ---------------------------------------------------------
   9. PREMIUM CAROUSEL NAVIGATION
--------------------------------------------------------- */

.ivsm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-top: 20px;
}

/* CIRCULAR ARROW BUTTONS */

.ivsm-arrow {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;

    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #0F5384 !important;
    border-radius: 50% !important;

    background: #FFFFFF !important;
    color: #0F5384 !important;

    font-size: 0 !important;
    line-height: 1;

    cursor: pointer;

    box-shadow: none !important;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* ARROW SHAFT */

.ivsm-arrow::before {
    content: "";

    position: absolute;
    top: 50%;

    width: 14px;
    height: 1.5px;

    background: currentColor;

    transform: translateY(-50%);
}

/* ARROW HEAD */

.ivsm-arrow::after {
    content: "";

    position: absolute;
    top: 50%;

    width: 7px;
    height: 7px;

    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;

    transform: translateY(-50%) rotate(45deg);
}

/* LEFT ARROW */

.ivsm-controls .ivsm-arrow:first-of-type::before {
    left: 12px;
}

.ivsm-controls .ivsm-arrow:first-of-type::after {
    left: 11px;
    transform: translateY(-50%) rotate(-135deg);
}

/* RIGHT ARROW */

.ivsm-controls .ivsm-arrow:last-of-type::before {
    right: 12px;
}

.ivsm-controls .ivsm-arrow:last-of-type::after {
    right: 11px;
    transform: translateY(-50%) rotate(45deg);
}

/* Arrow fills only while mouse is hovering */
.ivsm-arrow:hover {
    background: #0F5384 !important;
    border-color: #0F5384 !important;
    color: #FFFFFF !important;

    box-shadow: 0 3px 12px rgba(15, 83, 132, 0.18) !important;
}

/* Return to normal appearance after mouse leaves */
.ivsm-arrow:not(:hover) {
    background: #FFFFFF !important;
    border-color: #0F5384 !important;
    color: #0F5384 !important;
    box-shadow: none !important;
}

/* Keyboard accessibility */
.ivsm-arrow:focus-visible {
    outline: 2px solid rgba(15, 83, 132, 0.3) !important;
    outline-offset: 3px;
}


/* PAGINATION DOT CONTAINER */

.ivsm-dots {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* NORMAL DOT */

.ivsm-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 auto;

    display: inline-block;

    padding: 0 !important;

    border: none !important;
    border-radius: 20px !important;

    background: #B9CBD8 !important;
    color: #0F5384 !important;

    cursor: pointer;

    box-shadow: none !important;
    outline: none;

    transition:
        width 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;
}

/* ACTIVE DOT */

.ivsm-dot.is-active {
    width: 25px;

    background: #0F5384 !important;
    border-color: #0F5384 !important;
}

/* DOT HOVER - BLUE, NEVER PINK */

.ivsm-dot:hover,
.ivsm-dot:focus,
.ivsm-dot:focus-visible,
.ivsm-dot:active {
    background: #0F5384 !important;
    border-color: #0F5384 !important;

    box-shadow: none !important;
    outline: none;
}

/* KEEP ACTIVE DOT BLUE ON HOVER */

.ivsm-dot.is-active:hover,
.ivsm-dot.is-active:focus {
    background: #0F5384 !important;
    border-color: #0F5384 !important;
}

/* ACCESSIBILITY */

.ivsm-arrow:focus-visible,
.ivsm-dot:focus-visible {
    outline: 2px solid rgba(15, 83, 132, 0.3) !important;
    outline-offset: 3px;
}


/* ---------------------------------------------------------
   10. YOUTUBE POPUP
--------------------------------------------------------- */

.ivsm-modal {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 999999;

    align-items: center;
    justify-content: center;

    padding: 24px;
}

.ivsm-modal.is-open {
    display: flex;
}

.ivsm-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(4, 13, 22, 0.88);
    backdrop-filter: blur(5px);
}

.ivsm-modal-dialog {
    position: relative;
    width: min(940px, 94vw);
    z-index: 1;
}

.ivsm-player {
    position: relative;

    padding-top: 56.25%;

    background: #000000;
    border-radius: 12px;
    overflow: hidden;

    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.ivsm-player iframe {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    border: 0;
}

.ivsm-modal-close {
    position: absolute;
    right: 0;
    top: -48px;

    border: 0;
    background: transparent;

    color: #ffffff;
    font-size: 38px;
    line-height: 1;

    cursor: pointer;
}

/* ---------------------------------------------------------
   11. EMPTY STATE
--------------------------------------------------------- */

.ivsm-empty {
    padding: 18px;

    background: #f3f8fc;
    border: 1px solid #d9eaf5;
    border-radius: 8px;

    color: #31536b;
}

/* ---------------------------------------------------------
   12. ELEMENTOR INITIALISATION FALLBACK
   Keep the first card visible before JS initialises.
--------------------------------------------------------- */

.ivsm-stage:not(.ivsm-initialized) .ivsm-card:first-child {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: none;
    z-index: 3;
    pointer-events: auto;
}

.ivsm-stage:not(.ivsm-initialized) .ivsm-card:first-child .ivsm-card-caption {
    opacity: 1;
    transform: none;
}

/* ---------------------------------------------------------
   13. TABLET AND MOBILE
--------------------------------------------------------- */

@media (max-width: 767px) {

    .ivsm-wrap {
        padding: 18px 0;
    }

    .ivsm-stage {
        height: clamp(320px, 92vw, 430px);
    }

    .ivsm-card {
        width: 68%;
        height: 82%;
        max-height: none;
    }

    .ivsm-card.is-left {
        transform: translate(calc(-50% - 57%), -50%) scale(0.72);
    }

    .ivsm-card.is-right {
        transform: translate(calc(-50% + 57%), -50%) scale(0.72);
    }

    /* Side cards do not enlarge on mobile hover either */
    .ivsm-card.is-left:hover {
        transform: translate(calc(-50% - 57%), -50%) scale(0.72);
        opacity: 0.62;
        filter: blur(4px) brightness(0.68);
        z-index: 2;
    }

    .ivsm-card.is-right:hover {
        transform: translate(calc(-50% + 57%), -50%) scale(0.72);
        opacity: 0.62;
        filter: blur(4px) brightness(0.68);
        z-index: 2;
    }

    .ivsm-card.is-center:hover {
        transform: translate(-50%, -50%) scale(1.015);
    }

    .ivsm-card-image {
        width: calc(100% - 10px);
        margin-top: 5px;
    }

    .ivsm-card-caption {
        padding: 9px 11px 11px;
    }

    .ivsm-card-caption h3 {
        font-size: 15px;
        line-height: 1.3;
        margin-bottom: 5px;
    }

    .ivsm-card-caption p {
        font-size: 11px;
        line-height: 1.4;
    }

    .ivsm-play {
        width: 48px;
        height: 48px;
    }

    .ivsm-controls {
        margin-top: 14px;
        gap: 16px;
    }

    .ivsm-arrow {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
}

/* ---------------------------------------------------------
   14. ACCESSIBILITY
--------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .ivsm-card,
    .ivsm-arrow,
    .ivsm-dot,
    .ivsm-play {
        transition: none !important;
    }
}


/* ==========================================
   VIDEO POPUP - CLOSE BUTTON
========================================== */

.ivsm-modal-close,
.ivsm-modal-close:hover,
.ivsm-modal-close:focus,
.ivsm-modal-close:active {
    background: transparent !important;
    color: #8BB9D8 !important;

    border: none !important;
    box-shadow: none !important;
    outline: none !important;

    border-radius: 0 !important;
    opacity: 1 !important;

    transition: color 0.25s ease;
}

/* Hover: Dark Imprint Blue */
.ivsm-modal-close:hover {
    color: #0F5384 !important;
}


/* ==========================================
   VIDEO POPUP - RESPONSIVE SPACING
========================================== */

.ivsm-modal {
    padding: 55px 32px !important;
    box-sizing: border-box;
}

.ivsm-modal-dialog {
    width: min(900px, calc(100vw - 64px)) !important;
    max-width: 100% !important;
    margin: auto;
}

.ivsm-player {
    border-radius: 12px;
    overflow: hidden;
}

/* Close button positioning */
.ivsm-modal-close {
    top: -46px !important;
    right: 0 !important;
    width: 38px;
    height: 38px;
    font-size: 34px !important;
    line-height: 1 !important;
}

/* Mobile spacing */
@media (max-width: 767px) {
    .ivsm-modal {
        padding: 65px 16px !important;
    }

    .ivsm-modal-dialog {
        width: 100% !important;
    }

    .ivsm-modal-close {
        top: -44px !important;
    }
}


/* ==========================================
   IVSM VIDEO POPUP - FINAL RESPONSIVE FIX
========================================== */

.ivsm-modal {
    box-sizing: border-box !important;
    padding: 55px 20px 24px !important;
    align-items: center !important;
    justify-content: center !important;
}

.ivsm-modal-dialog {
    position: relative !important;
    width: 100% !important;
    max-width: 900px !important;
    margin: auto !important;
    box-sizing: border-box !important;
}

.ivsm-player {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    padding-top: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
}

.ivsm-player iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}


/* ==========================================
   CLOSE BUTTON - BLUE ONLY
========================================== */

body .ivsm-modal .ivsm-modal-close {
    position: absolute !important;
    top: -44px !important;
    right: 0 !important;

    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #8BB9D8 !important;

    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;

    font-size: 34px !important;
    line-height: 1 !important;

    appearance: none !important;
    -webkit-appearance: none !important;

    cursor: pointer !important;
    transition: color 0.25s ease !important;
    z-index: 10 !important;
}

body .ivsm-modal .ivsm-modal-close:hover,
body .ivsm-modal .ivsm-modal-close:focus,
body .ivsm-modal .ivsm-modal-close:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #0F5384 !important;

    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}


/* ==========================================
   MOBILE RESPONSIVE
========================================== */

@media (max-width: 767px) {

    .ivsm-modal {
        padding: 58px 14px 20px !important;
    }

    .ivsm-modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
    }

    .ivsm-player {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        border-radius: 10px !important;
    }

    body .ivsm-modal .ivsm-modal-close {
        top: -43px !important;
        right: 0 !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 32px !important;
    }
}
