/* =========================================================
   RAVEN QUOTE SECTION
========================================================= */

.raven-quote {
    position: relative;
    isolation: isolate;

    padding:
        clamp(6rem, 10vw, 10rem)
        var(--page-gutter)
        clamp(7rem, 11vw, 11rem);

    overflow: hidden;

    background: var(--color-black);
    color: var(--color-white);
}

.raven-quote__inner {
    width: min(100%, 76rem);
    margin-inline: auto;
}

/* =========================================================
   MEDIA
========================================================= */

.raven-quote__media {
    position: relative;

    display: grid;
    place-items: center;

    width: 100%;
    min-height: clamp(30rem, 58vw, 48rem);

    overflow: hidden;

    background: #000;
}

.raven-quote__fallback,
.raven-quote__video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;

    pointer-events: none;
    user-select: none;

    will-change:
        opacity,
        transform,
        filter;
}

.raven-quote__fallback {
    z-index: 1;

    opacity: 1;

    transform: scale(1.04);

    transition:
        opacity 600ms ease,
        transform 1600ms var(--ease-premium),
        filter 600ms ease;

    animation:
        ravenQuoteBreath
        8s
        ease-in-out
        infinite;
}

.raven-quote__video {
    z-index: 2;

    opacity: 0;

    transition:
        opacity 600ms ease;
}

/*
 * Το section αποκτά αυτόματα αυτή την class
 * όταν το video φορτώσει και μπορεί να παίξει.
 */
.raven-quote.has-video .raven-quote__video {
    opacity: 1;
}

.raven-quote.has-video .raven-quote__fallback {
    opacity: 0;

    transform: scale(1);

    animation-play-state: paused;
}

/* =========================================================
   QUOTE CONTENT
========================================================= */

.raven-quote__content {
    position: relative;
    z-index: 4;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: min(100%, 34rem);

    margin-top: clamp(9rem, 19vw, 16rem);

    color: #333;

    text-align: center;

    pointer-events: none;

    will-change:
        opacity,
        transform,
        filter;
}

.raven-quote__text {
    margin: 0;

    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: -0.03em;
}

.raven-quote__author {
    margin:
        clamp(1rem, 2vw, 1.6rem)
        0
        0;

    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2.2vw, 1.8rem);
    font-weight: 400;
    line-height: 1;
}

/* =========================================================
   SUBTLE EDGE MASK
========================================================= */

.raven-quote__media::after {
    content: "";

    position: absolute;
    z-index: 3;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            to right,
            #000 0%,
            transparent 15%,
            transparent 85%,
            #000 100%
        ),
        linear-gradient(
            to bottom,
            #000 0%,
            transparent 10%,
            transparent 88%,
            #000 100%
        );
}

/* =========================================================
   BREATHING FALLBACK ANIMATION
========================================================= */

@keyframes ravenQuoteBreath {
    0%,
    100% {
        transform: scale(1.025);
    }

    50% {
        transform: scale(1.035);
    }
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1024px) {
    .raven-quote__media {
        min-height: clamp(28rem, 70vw, 42rem);
    }

    .raven-quote__content {
        margin-top: clamp(8rem, 21vw, 13rem);
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
    .raven-quote {
        padding:
            clamp(5rem, 17vw, 7rem)
            var(--page-gutter)
            clamp(6rem, 20vw, 8rem);
    }

    .raven-quote__media {
        min-height: clamp(28rem, 125vw, 39rem);
    }

    .raven-quote__fallback,
    .raven-quote__video {
        width: 135%;
        max-width: none;

        left: 50%;

        transform: translateX(-50%) scale(1.025);
    }

    .raven-quote.has-video .raven-quote__fallback {
        transform: translateX(-50%) scale(1);
    }

    .raven-quote__content {
        width: min(82%, 24rem);

        margin-top: clamp(8rem, 44vw, 12rem);
    }

    .raven-quote__text {
        font-size: clamp(1.8rem, 8.7vw, 2.8rem);
    }

    .raven-quote__author {
        font-size: clamp(1.05rem, 5.2vw, 1.45rem);
    }

    .raven-quote__media::after {
        background:
            linear-gradient(
                to right,
                #000 0%,
                transparent 7%,
                transparent 93%,
                #000 100%
            ),
            linear-gradient(
                to bottom,
                #000 0%,
                transparent 8%,
                transparent 90%,
                #000 100%
            );
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .raven-quote__fallback {
        animation: none;
        transition: none;
        transform: none;
    }

    .raven-quote__video {
        transition: none;
    }
}