/* ==========================================================================
   Custom Testimonial Widget — Stylesheet
   Version: 1.0.0
   ========================================================================== */

/* ── Wrapper ────────────────────────────────────────────────────────────── */
.ew-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* ── Grid Layout ────────────────────────────────────────────────────────── */
.ew-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* ── Carousel Layout ────────────────────────────────────────────────────── */
.ew-carousel-wrapper {
    position: relative;
    padding-bottom: 48px; /* room for pagination dots */
}

.ew-carousel-wrapper .swiper {
    overflow: hidden;
    padding-bottom: 16px;
}

.ew-carousel-wrapper .swiper-slide {
    height: auto;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.ew-card {
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    height: 100%;
    box-sizing: border-box;
}

.ew-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ── Company Logo ───────────────────────────────────────────────────────── */
.ew-company-logo {
    margin-bottom: 4px;
}

.ew-company-logo img {
    max-height: 36px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.2s, opacity 0.2s;
}

.ew-card:hover .ew-company-logo img {
    filter: none;
    opacity: 1;
}

/* ── Stars ──────────────────────────────────────────────────────────────── */
.ew-stars {
    color: #f6ad55;
    font-size: 18px;
    letter-spacing: 2px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Testimonial Text ───────────────────────────────────────────────────── */
.ew-text {
    color: #4a5568;
    font-size: 0.9375rem;
    line-height: 1.75;
    margin: 0;
    padding: 0;
    border: none;
    font-style: italic;
    flex-grow: 1;
    quotes: "\201C" "\201D";
    position: relative;
}

.ew-text::before {
    content: open-quote;
    font-size: 3.5em;
    line-height: 0;
    vertical-align: -0.5em;
    color: #e2e8f0;
    font-family: Georgia, serif;
    margin-right: 2px;
    font-style: normal;
}

/* ── Client Row ─────────────────────────────────────────────────────────── */
.ew-client {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f0f4f8;
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */
.ew-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.ew-avatar img,
.ew-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid #e8ecf0;
    display: block;
}

/* ── Client Info ────────────────────────────────────────────────────────── */
.ew-client-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ew-client-name {
    font-weight: 700;
    color: #1a202c;
    font-size: 0.9375rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-client-position {
    color: #718096;
    font-size: 0.8125rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Swiper Overrides ───────────────────────────────────────────────────── */
.ew-carousel-wrapper .swiper-button-next,
.ew-carousel-wrapper .swiper-button-prev {
    background: #4a5568;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, transform 0.2s;
}

.ew-carousel-wrapper .swiper-button-next:hover,
.ew-carousel-wrapper .swiper-button-prev:hover {
    background: #2d3748;
    transform: translateY(-50%) scale(1.08);
}

.ew-carousel-wrapper .swiper-button-next::after,
.ew-carousel-wrapper .swiper-button-prev::after {
    font-size: 14px;
    color: #ffffff;
    font-weight: 700;
}

.ew-carousel-wrapper .swiper-pagination {
    bottom: 0;
}

.ew-carousel-wrapper .swiper-pagination-bullet {
    background: #cbd5e0;
    opacity: 1;
    width: 8px;
    height: 8px;
    transition: background 0.2s, width 0.2s;
    border-radius: 4px;
}

.ew-carousel-wrapper .swiper-pagination-bullet-active {
    background: #4a5568;
    width: 24px;
}

/* ── Responsive Breakpoints ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .ew-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 767px) {
    .ew-grid {
        grid-template-columns: 1fr;
    }

    .ew-card {
        padding: 24px 20px;
    }

    .ew-carousel-wrapper .swiper-button-next,
    .ew-carousel-wrapper .swiper-button-prev {
        display: none; /* hide arrows on very small screens */
    }
}

/* ── Elementor Editor Fixes ─────────────────────────────────────────────── */
.elementor-editor-active .ew-card:hover {
    transform: none; /* disable hover lift in editor to avoid confusion */
}
