/* ================================================================
   FINEASTRA VIDEO SECTION
   Scoped component styles
   ================================================================ */

.fa-video-section {
    --video-dark: var(--fa-dark, #0b303a);
    --video-dark-2: var(--fa-dark-2, #0a2831);
    --video-dark-3: var(--fa-dark-3, #061e25);
    --video-gold: var(--fa-gold, #e0954a);
    --video-accent: var(--fa-accent, #e0954a);
    --video-text: var(--fa-text, #1a1a1a);
    --video-muted: var(--fa-muted, #6b7280);
    --video-border: var(--fa-border, #e5e7eb);
    --video-radius: var(--fa-radius, 10px);
    --video-display: var(--fa-font-display, 'Manrope', sans-serif);
    --video-body: var(--fa-font-body, 'Inter', sans-serif);

    position: relative;
    width: 100%;
    padding: clamp(5rem, 9vw, 9rem) 0;
    background: #fff;
    overflow: hidden;
}

.fa-video-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: min(1200px, 90vw);
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(
        90deg,
        transparent,
        var(--video-border),
        transparent
    );
}

.fa-video-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
}


/* ================================================================
   INTRO
   ================================================================ */

.fa-video-intro {
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.fa-video-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    color: var(--video-gold);
    font-family: var(--video-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    line-height: 1;
    text-transform: uppercase;
}

.fa-video-eyebrow-line {
    width: 38px;
    height: 1px;
    background: currentColor;
}

.fa-video-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
}

.fa-video-title {
    max-width: 850px;
    margin: 0;
    color: var(--video-dark);
    font-family: var(--video-display);
    font-size: clamp(2.5rem, 5vw, 5.25rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 0.98;
}

.fa-video-lead {
    max-width: 680px;
    margin: 1.5rem 0 0;
    color: var(--video-muted);
    font-family: var(--video-body);
    font-size: clamp(0.95rem, 1.3vw, 1.08rem);
    line-height: 1.75;
}

.fa-video-index {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
    padding-bottom: 4px;
    font-family: var(--video-display);
    font-weight: 600;
}

.fa-video-index-current {
    color: var(--video-dark);
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.fa-video-index-separator {
    color: var(--video-border);
    font-size: 1.25rem;
}

.fa-video-index-total {
    color: var(--video-muted);
    font-size: 0.8rem;
}


/* ================================================================
   VIDEO CARD
   ================================================================ */

.fa-video-card {
    position: relative;
    margin-bottom: clamp(4rem, 8vw, 7rem);
}

.fa-video-card:last-child {
    margin-bottom: 0;
}

.fa-video-card-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.fa-video-card-title {
    margin: 0;
    color: var(--video-dark);
    font-family: var(--video-display);
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.fa-video-card-subtitle {
    max-width: 650px;
    margin: 0.55rem 0 0;
    color: var(--video-muted);
    font-family: var(--video-body);
    font-size: 0.9rem;
    line-height: 1.65;
}

.fa-video-card-number {
    color: var(--video-border);
    font-family: var(--video-display);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.07em;
    line-height: 0.8;
    user-select: none;
}


/* ================================================================
   PLAYER
   ================================================================ */

.fa-video-player {
    position: relative;
    width: 100%;
}

.fa-video-player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--video-dark-3);
    border-radius: var(--video-radius);
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(6, 30, 37, 0.14),
        0 8px 20px rgba(6, 30, 37, 0.08);
}

.fa-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.fa-video-player-frame.is-loading .fa-video-iframe {
    opacity: 0.35;
}

.fa-video-loader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.fa-video-player-frame.is-loading .fa-video-loader {
    opacity: 1;
    visibility: visible;
}

.fa-video-loader span {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--video-gold);
    border-radius: 50%;
    animation: fa-video-spin 0.8s linear infinite;
}

.fa-video-corner {
    position: absolute;
    z-index: 4;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.fa-video-corner-tl {
    top: 18px;
    left: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.55);
    border-left: 1px solid rgba(255, 255, 255, 0.55);
}

.fa-video-corner-br {
    right: 18px;
    bottom: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}


/* ================================================================
   SELECTOR
   ================================================================ */

.fa-video-selector-wrapper {
    margin-top: 1.5rem;
}

.fa-video-selector-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.fa-video-selector-label {
    color: var(--video-dark);
    font-family: var(--video-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.fa-video-selector-hint {
    color: var(--video-muted);
    font-family: var(--video-body);
    font-size: 0.72rem;
}

.fa-video-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.fa-video-thumbnail {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.fa-video-thumbnail-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 7px;
    background: var(--video-dark-3);
}

.fa-video-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.72;
    transform: scale(1.001);
    transition:
        transform 0.45s cubic-bezier(.2,.7,.2,1),
        opacity 0.35s ease,
        filter 0.35s ease;
}

.fa-video-thumbnail-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(6, 30, 37, 0.05) 0%,
            rgba(6, 30, 37, 0.15) 45%,
            rgba(6, 30, 37, 0.65) 100%
        );
    transition: opacity 0.3s ease;
}

.fa-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    background: rgba(6, 30, 37, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translate(-50%, -50%);
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.fa-video-play span {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #fff;
}

.fa-video-thumbnail-number {
    position: absolute;
    right: 10px;
    bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--video-body);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}


/* ================================================================
   ACTIVE STATE
   ================================================================ */

.fa-video-thumbnail.is-active {
    cursor: default;
}

.fa-video-thumbnail.is-active .fa-video-thumbnail-media {
    box-shadow:
        inset 0 0 0 2px var(--video-gold);
}

.fa-video-thumbnail.is-active img {
    opacity: 0.9;
}

.fa-video-thumbnail.is-active .fa-video-play {
    background: var(--video-gold);
    border-color: var(--video-gold);
}


/* ================================================================
   HOVER / FOCUS
   ================================================================ */

@media (hover: hover) and (pointer: fine) {

    .fa-video-thumbnail:not(.is-active):hover img {
        opacity: 0.92;
        transform: scale(1.055);
    }

    .fa-video-thumbnail:not(.is-active):hover .fa-video-overlay {
        opacity: 0.8;
    }

    .fa-video-thumbnail:not(.is-active):hover .fa-video-play {
        border-color: rgba(255, 255, 255, 0.9);
        background: rgba(6, 30, 37, 0.8);
        transform: translate(-50%, -50%) scale(1.08);
    }

    .fa-video-thumbnail:focus-visible {
        outline: 2px solid var(--video-gold);
        outline-offset: 4px;
    }
}


/* ================================================================
   LOADING STATE
   ================================================================ */

.fa-video-thumbnail.is-loading {
    pointer-events: none;
}

.fa-video-thumbnail.is-loading .fa-video-thumbnail-media {
    opacity: 0.55;
}

.fa-video-thumbnail.is-loading .fa-video-play {
    animation: fa-video-pulse 1s ease-in-out infinite;
}


/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes fa-video-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fa-video-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(0.9);
    }
}


/* ================================================================
   TABLET
   ================================================================ */

@media (max-width: 992px) {

    .fa-video-shell {
        width: min(100% - 32px, 900px);
    }

    .fa-video-heading-row {
        align-items: flex-start;
    }

    .fa-video-index {
        display: none;
    }

    .fa-video-thumbnails {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}


/* ================================================================
   MOBILE
   ================================================================ */

@media (max-width: 576px) {

    .fa-video-section {
        padding: 4.5rem 0;
    }

    .fa-video-shell {
        width: calc(100% - 24px);
    }

    .fa-video-intro {
        margin-bottom: 2.5rem;
    }

    .fa-video-eyebrow {
        margin-bottom: 1rem;
        font-size: 0.62rem;
    }

    .fa-video-eyebrow-line {
        width: 26px;
    }

    .fa-video-title {
        font-size: clamp(2.25rem, 11vw, 3.4rem);
    }

    .fa-video-lead {
        margin-top: 1rem;
        font-size: 0.88rem;
        line-height: 1.65;
    }

    .fa-video-card {
        margin-bottom: 4rem;
    }

    .fa-video-card-heading {
        margin-bottom: 1rem;
    }

    .fa-video-card-title {
        font-size: 1.25rem;
    }

    .fa-video-card-number {
        display: none;
    }

    .fa-video-player-frame {
        border-radius: 7px;
        box-shadow:
            0 18px 40px rgba(6, 30, 37, 0.12);
    }

    .fa-video-corner {
        width: 20px;
        height: 20px;
    }

    .fa-video-corner-tl {
        top: 12px;
        left: 12px;
    }

    .fa-video-corner-br {
        right: 12px;
        bottom: 12px;
    }

    .fa-video-selector-heading {
        margin-bottom: 0.6rem;
    }

    .fa-video-selector-hint {
        font-size: 0.65rem;
    }

    .fa-video-thumbnails {
        gap: 7px;
    }

    .fa-video-thumbnail-media {
        border-radius: 5px;
    }

    .fa-video-play {
        width: 32px;
        height: 32px;
    }

    .fa-video-play span {
        border-top-width: 5px;
        border-bottom-width: 5px;
        border-left-width: 8px;
    }

    .fa-video-thumbnail-number {
        right: 7px;
        bottom: 5px;
        font-size: 0.55rem;
    }
}


/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {

    .fa-video-thumbnail img,
    .fa-video-play,
    .fa-video-iframe,
    .fa-video-loader {
        transition: none;
    }

    .fa-video-loader span,
    .fa-video-thumbnail.is-loading .fa-video-play {
        animation: none;
    }
}
