/**
 * Quote Block Carousel - Frontend Styles
 * 
 * Full-width carousel container with centered, width-constrained cards
 * Cards slide edge-to-edge within the full viewport width
 * 
 * @package SOEC_Theme
 * @version 1.4.0
 */

/* ============================================================================
 * FULL-WIDTH CAROUSEL CONTAINER
 * ============================================================================ */

/* Break out of parent container to full viewport width */
.quote-carousel {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.quote-carousel .quote-carousel-track {
    position: relative;
    width: 100%;
    /* Height set by JS */
}

/* ============================================================================
 * CAROUSEL CARDS - CENTERED AND CONSTRAINED
 * ============================================================================ */

.quote-carousel .quote-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    transform: translateX(100%);
    transition: none;
    will-change: transform;
    opacity: 1 !important; /* Always solid - never fade */
}

/* Match card width to theme content width */
.quote-carousel .quote-card > blockquote,
.quote-carousel .quote-card > .quote-card-inner {
    width: calc(100% - 40px);
    max-width: 1140px;
    margin: 0 auto;
    box-sizing: border-box;
    opacity: 1 !important;
    transition: none !important;
}

/* Ensure blockquote and all children stay solid during animation */
.quote-carousel .quote-card blockquote,
.quote-carousel .quote-card blockquote * {
    transition: opacity 0s !important;
}

/* But allow quote marks and lines to have their own opacity */
.quote-carousel .quote-card .quote-mark-svg,
.quote-carousel .quote-card .line-top,
.quote-carousel .quote-card .line-bottom {
    /* Opacity controlled by inline style from PHP */
}

/* Responsive width adjustments to match theme */
@media (min-width: 1200px) {
    .quote-carousel .quote-card > blockquote,
    .quote-carousel .quote-card > .quote-card-inner {
        width: 1140px;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .quote-carousel .quote-card > blockquote,
    .quote-carousel .quote-card > .quote-card-inner {
        width: calc(100% - 60px);
        max-width: 960px;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .quote-carousel .quote-card > blockquote,
    .quote-carousel .quote-card > .quote-card-inner {
        width: calc(100% - 40px);
        max-width: 720px;
    }
}

@media (max-width: 767px) {
    .quote-carousel .quote-card > blockquote,
    .quote-carousel .quote-card > .quote-card-inner {
        width: calc(100% - 30px);
    }
}

/* Active card - visible in place */
.quote-carousel .quote-card.active {
    transform: translateX(0);
    z-index: 2;
    opacity: 1 !important;
}

/* Standby cards - hidden off-screen right */
.quote-carousel .quote-card.standby {
    transform: translateX(100%);
    z-index: 1;
    pointer-events: none;
    opacity: 1 !important;
}

/* Exiting card - slides out to the left */
.quote-carousel .quote-card.exiting {
    z-index: 1;
    opacity: 1 !important;
    animation: carouselSlideOutLeft 1.4s ease-in-out forwards;
}

.quote-carousel .quote-card.exiting blockquote,
.quote-carousel .quote-card.exiting blockquote .content,
.quote-carousel .quote-card.exiting blockquote .quote-text,
.quote-carousel .quote-card.exiting blockquote .author {
    opacity: 1 !important;
}

/* Entering card - slides in from the right */
.quote-carousel .quote-card.entering {
    z-index: 2;
    opacity: 1 !important;
    animation: carouselSlideInRight 1.4s ease-in-out forwards;
}

/* ============================================================================
 * KEYFRAME ANIMATIONS - SLOW, SMOOTH, NO FADE
 * ============================================================================ */

@keyframes carouselSlideOutLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 1;
    }
}

@keyframes carouselSlideInRight {
    0% {
        transform: translateX(100%);
        opacity: 1;
    }
    /* Hold position for first 20% (delay while exit begins) */
    20% {
        transform: translateX(100%);
        opacity: 1;
    }
    /* Then slide in */
    90% {
        transform: translateX(-1%);
        opacity: 1;
    }
    95% {
        transform: translateX(0.3%);
        opacity: 1;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
 * NAVIGATION DOTS - Only visible when mouse near bottom
 * ============================================================================ */

.quote-carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.1s ease-out; /* Fast fade out */
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    pointer-events: none;
}

/* Hover detection zone at bottom of carousel */
.quote-carousel-hover-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 9;
}

/* Show dots when hovering the bottom zone or dots themselves */
.quote-carousel-hover-zone:hover ~ .quote-carousel-dots,
.quote-carousel-dots:hover {
    opacity: 1;
    transition: opacity 0.2s ease-in;
    pointer-events: auto;
}

.quote-carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.quote-carousel-dots .dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.quote-carousel-dots .dot.active {
    background: #fff;
    transform: scale(1.1);
}

/* ============================================================================
 * QUOTE MARK SIZE VARIATIONS
 * ============================================================================ */

.quote-mark-svg.size-small {
    width: 30px !important;
    height: 30px !important;
}

.quote-mark-svg.size-medium {
    width: 45px !important;
    height: 45px !important;
}

.quote-mark-svg.size-large {
    width: 65px !important;
    height: 65px !important;
}

/* Position adjustments for different sizes */
blockquote.has-svg-marks .quote-mark-left.size-small {
    top: 10px;
    left: 10px;
}

blockquote.has-svg-marks .quote-mark-right.size-small {
    bottom: 10px;
    right: 10px;
}

blockquote.has-svg-marks .quote-mark-left.size-large {
    top: 15px;
    left: 15px;
}

blockquote.has-svg-marks .quote-mark-right.size-large {
    bottom: 15px;
    right: 15px;
}

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

@media (max-width: 768px) {
    .quote-carousel-dots {
        bottom: 10px;
        padding: 6px 10px;
    }
    
    .quote-carousel-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    .quote-mark-svg.size-large {
        width: 50px !important;
        height: 50px !important;
    }
}

@media (max-width: 480px) {
    .quote-mark-svg.size-large {
        width: 40px !important;
        height: 40px !important;
    }
    
    .quote-mark-svg.size-medium {
        width: 35px !important;
        height: 35px !important;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .quote-carousel .quote-card.entering,
    .quote-carousel .quote-card.exiting {
        animation: none !important;
        transition: transform 0.5s ease;
    }
}