/**
 * Quotes Slider Widget CSS
 * Matches Figma design: transparent widget, white speech bubble, gold accents
 */

/* ── Main Container ── */
.quotes-slider-widget {
    position: relative;
    text-align: center;
    overflow: visible;
    background: transparent;
}

/* ── Quote Slider Area ── */
.quote-slider-container {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Main Swiper ── */
.quotes-main-slider {
    overflow: visible;
    margin-bottom: 0;
}

.quotes-main-slider .swiper-wrapper {
    min-height: 180px;
    height: var(--quotes-slide-height, auto) !important;
}

.quotes-main-slider .swiper-slide {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--quotes-slide-height, auto) !important;
}

.quotes-main-slider .swiper-slide.swiper-slide-active {
    opacity: 1;
}

/* ── Quote Bubble ── */
.quote-bubble-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    height: 100%;
}

.quote-bubble {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 42px;
    position: relative;
    box-shadow: 5px 5px 40px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Speech bubble triangle pointer */
.quote-bubble-tail {
    width: 0;
    height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    border-top: 22px solid #ffffff;
    margin-top: -1px; /* overlap with bubble bottom */
    align-self: center;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.03));
}

/* ── Quote Text ── */
.quote-text {
    color: #153246 !important;
    font-size: 1.5rem;
    line-height: 2rem;
    text-align: center;
    direction: rtl;
    font-family: "Heebo", Arial, sans-serif !important;
    font-weight: 400;
    margin: 0;
}

/* ── Quote Marks Icon (mobile only) ── */
.quote-marks-icon {
    display: none; /* hidden on desktop */
    flex-shrink: 0;
}

.quote-marks-icon svg,
.quote-marks-icon img {
    width: 61px;
    height: 42px;
    object-fit: contain;
}

/* ── Bottom Section (name + arrows + thumbs) ── */
.quote-bottom-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 24px;
    gap: 21px;
}

/* ── Thumbnail: shared base styles ── */
.quote-thumb {
    width: 144px;
    height: 144px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f9c466;
    cursor: pointer;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 1;
    flex-shrink: 0;
    margin: 0 auto; /* center within Swiper slide */
}

.quote-thumb.active {
    opacity: 1;
}

.quote-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ── Person Name ── */
.quote-person-name {
    color: #f9c466;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "Assistant", "Heebo", Arial, sans-serif !important;
    text-align: center;
    white-space: nowrap;
    min-height: 28px;
    transition: opacity 0.3s ease;
}

/* ── Navigation Arrows ── */
.quote-nav-arrows {
    display: flex;
    align-items: center;
    gap: 50px;
}

.quote-arrow {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

.quote-arrow:hover {
    opacity: 0.7;
}

.quote-arrow svg {
    width: 26px;
    height: 42px;
}

/* ── DESKTOP LAYOUT (>768px) ── */
@media (min-width: 769px) {
    /* Arrows sit on the sides of the entire widget */
    .quote-nav-arrows {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% + 120px);
        justify-content: space-between;
        pointer-events: none;
        z-index: 10;
    }

    .quote-arrow {
        pointer-events: auto;
    }

    /* Bottom section order: thumbs first, then name */
    .quote-bottom-section {
        margin-top: 40px;
    }

    .quote-thumbs-grid {
        order: 1;
    }

    .quote-person-name {
        order: 2;
    }

    .quote-nav-arrows-mobile {
        display: none;
    }

    /* ── Desktop Thumbnail Custom Carousel ── */
    .quote-thumbs-grid.custom-carousel {
        width: 100%;
        max-width: 860px;
        padding: 0;
        overflow: hidden; /* clip off-screen slides horizontally */
    }

    /* Override Swiper wrapper — static positioned block */
    .quote-thumbs-grid.custom-carousel .swiper-wrapper {
        display: block !important;
        position: relative !important;
        transform: none !important;
        height: 148px; /* 144px thumb + border */
    }

    /* All slides absolutely positioned, animated via `left` */
    .quote-thumbs-grid.custom-carousel .swiper-slide {
        position: absolute !important;
        top: 50%;
        transform: translateY(-50%);
        width: 144px !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        transition: left 0.4s ease, opacity 0.4s ease;
    }

    .quote-thumbs-grid.custom-carousel .quote-thumb.active {
        opacity: 1;
    }
}

/* Hide Swiper's default arrows — we use custom ones */
.quote-slider-container .swiper-button-prev,
.quote-slider-container .swiper-button-next {
    display: none !important;
}


/* ── MOBILE LAYOUT (≤768px) ── */
@media (max-width: 768px) {
    .quote-slider-container {
        max-width: 100%;
    }

    .quote-bubble {
        padding: 24px 16px;
    }

    .quote-text {
        font-size: 1.125rem;
        line-height: 1.375rem;
    }

    /* Hide quote marks on mobile — they stay above the bubble on desktop only */
    .quote-marks-icon {
        display: none;
    }

    /* Bottom section: name → arrows → thumbs (stacked) */
    .quote-bottom-section {
        margin-top: 20px;
        gap: 16px;
    }

    .quote-person-name {
        order: 1;
    }

    .quote-nav-arrows {
        order: 2;
        position: static;
        width: auto;
        transform: none;
        pointer-events: auto;
        justify-content: center;
        gap: 50px;
    }

    .quote-arrow svg {
        width: 16px;
        height: 26px;
    }

    /* Override Swiper on mobile — display as flex-wrap grid */
    .quote-thumbs-grid {
        order: 3;
        overflow: visible !important;
    }

    .quote-thumbs-grid .swiper-wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        transform: none !important;
        gap: 10px;
        height: auto !important;
    }

    .quote-thumbs-grid .swiper-slide {
        width: auto !important;
        flex-shrink: 0;
        position: static !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .quote-thumb {
        width: 56px;
        height: 56px;
        opacity: 1;
        transform: none;
        border-width: 2px;
    }

    .quote-thumb.active {
        width: 56px;
        height: 56px;
        opacity: 1;
        transform: none;
        border-color: #f9c466;
        box-shadow: 0 0 0 3px rgba(249, 196, 102, 0.5);
    }
}

/* ── Title (optional, if shown) ── */
.quotes-slider-title {
    color: #d4af37 !important;
    font-size: 2.25rem;
    font-weight: 600;
    margin: 0 0 40px 0;
    text-align: center;
    font-family: "Heebo", Arial, sans-serif !important;
}

@media (max-width: 768px) {
    .quotes-slider-title {
        font-size: 1.75rem;
        margin-bottom: 24px;
    }
}
