/* ================================
   Title Video – Mobile first
================================ */

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Wrapper */
.c-title-video {
    --this-color: var(--color-white);

    width: 100%;
    position: relative;
    padding: calc(40/16*1rem) calc(24/16*1rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.c-title-video__background-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;

    & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.c-title-video__background-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.30) 0%, rgba(0, 0, 0, 0.30) 100%), rgba(84, 84, 84, 0.20);
    background-blend-mode: normal, luminosity;
    backdrop-filter: blur(50px);
}
.c-title-video__inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width--block);
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: calc(28/16*1rem);
    background-color: rgba(255, 255, 255, 0.10);
    border-radius: calc(10/16*1rem);
    padding: calc(22/16*1rem) calc(12/16*1rem) calc(12/16*1rem);

}

.c-title-video__title {
    font: var(--typo--mobile-headline-02);
    color: var(--this-color);
    margin: 0;
    white-space: pre-line;
    text-align: center;
}

/* ================================
   Video Container
================================ */

.c-title-video__video-wrapper {
    width: 100%;
    max-width: calc(1130/16*1rem);
    aspect-ratio: 302/428;
    margin: 0 auto;
}

.c-title-video__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.c-title-video__video-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: calc(14/16*1rem);
    overflow: hidden;
    background-color: var(--color-black);
}

.c-title-video__content {
    position: relative;
    width: 100%;
    height: 100%;
}

.c-title-video__media {
    position: relative;
    width: 100%;
    height: 100%;
    & video,
    & iframe {
        display: block;
        width: 100%;
        height: 100%;
        aspect-ratio: 16 / 9;
        background-color: var(--color-black);
        border: none;
    }
}

/* ================================
   Trigger / Cover (Play Button + Image)
================================ */

.c-title-video__trigger {
    position: absolute;
    inset: 0;
    z-index: 2;
    transition: opacity 0.4s ease;
}

/* Hide trigger when video is launched */
.c-title-video[data-launched="true"] .c-title-video__trigger {
    opacity: 0;
    pointer-events: none;
}

.c-title-video__cover-image {
    display: block;
    height: 100%;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

.c-title-video__cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.4) 100%);
}

/* ================================
   Play Button
================================ */

.c-title-video__play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    
    color: var(--color-white);
    
    transition: transform 0.3s ease;

    &:hover {
        transform: translate(-50%, -50%) scale(1.1);
    }

    &:focus-visible {
        outline: calc(3/16*1rem) solid var(--color-primary--gold);
        outline-offset: calc(8/16*1rem);
        border-radius: 50%;
    }
}

.c-title-video__play-icon {
    width: calc(80/16*1rem);
    height: calc(80/16*1rem);
    filter: drop-shadow(0 calc(4/16*1rem) calc(16/16*1rem) rgba(0, 0, 0, 0.4));
}

/* ================================
   Transcript
================================ */

.c-title-video__transcript {
    margin-top: calc(24/16*1rem);
    max-width: calc(810/16*1rem);
    margin-inline: auto;
}

.c-title-video__transcript-toggle {
    font: var(--typo--transverse-small-body-02);
    color: var(--color-white);
    cursor: pointer;
    padding: calc(12/16*1rem);
    border: calc(1/16*1rem) solid rgba(255, 255, 255, 0.3);
    border-radius: calc(4/16*1rem);
    text-align: center;
    background: none;
    width: 100%;
    transition: background-color 0.2s ease;

    &:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    &:focus-visible {
        outline: calc(2/16*1rem) solid var(--color-primary--gold);
        outline-offset: calc(2/16*1rem);
    }

    &[hidden] {
        display: none;
    }
}

.c-title-video__transcript-content {
    margin-top: calc(16/16*1rem);
    padding: calc(16/16*1rem);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: calc(4/16*1rem);
    color: var(--color-white);
    font: var(--typo--transverse-small-body-02);
    line-height: 1.6;

    &[hidden] {
        display: none;
    }
}

/* ================================
   Preview Mode
================================ */

.c-title-video__preview {
    padding: calc(40/16*1rem);
    text-align: center;
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: calc(8/16*1rem);
}

/* ================================
   Desktop & up
================================ */

@media (min-width: 48em) {

    .c-title-video__video-wrapper {
        aspect-ratio: 1130/574;
    }

    .c-title-video {
        padding: calc(70/16*1rem) calc(24/16*1rem);
    }
    
    .c-title-video__title {
        font: var(--typo--desktop-headline-02);
    }

    .c-title-video__inner {
        gap: calc(48/16*1rem);
        padding: calc(35/16*1rem) calc(25/16*1rem) calc(25/16*1rem);
    }

    .c-title-video__play-icon {
        width: calc(100/16*1rem);
        height: calc(100/16*1rem);
    }
}
