/* testimonials widget styles. Loaded per-page outside the sanitized region (survives the HTML sanitizer that strips inline <style>). */
:where(.testimonials-section) {
    background-color: var(--bg-secondary, #f8f9fa);
}

/* site-gaps 19 fixup b: the section title inherits the band's readable
   foreground; without this a #1b1f3a band carried a dark grey h2 (main.css
   paints every heading with the theme heading colour). The testimonial CARDS
   keep their own colours: `.testimonial-card` sets its colour/background and
   the heading rule stops at the section-level h2. `section
   .testimonials-surface h2` weighs (0,1,2), beating main.css's (0,0,1) and a
   landing page's `.landing-page-content h2` (0,1,1), no important declaration. */
section .testimonials-surface h2 {
    color: inherit;
}

.testimonial-card {
    background: var(--bg-card, #fff);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    display: flex;
    flex-direction: column;
    position: relative;
    color: var(--text-primary, #212529);
}

.testimonial-card:where(:hover) {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 4rem;
    color: color-mix(in srgb, var(--color-primary, var(--bs-primary, #0d6efd)) 10%, transparent);
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-rating {
    display: flex;
    gap: 0.25rem;
}

.testimonial-rating i {
    font-size: 1rem;
}

.testimonial-quote {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary, #495057);
    position: relative;
    z-index: 2;
}

.testimonial-author {
    border-top: 1px solid var(--border-color, #f1f3f4);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

:where(.author-avatar) img {
    /* site-gaps 19 fixup b: a plain path / external URL renders through the
       plain-<img> branch, which used to drop the width/height attributes, so
       the avatar painted at its intrinsic size (measured 204x204). Pin the
       size here as well; the 40px phone rule below still wins. */
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid var(--border-color, #f8f9fa);
}

:where(.testimonial-card) .author-name {
    font-weight: 600;
    color: var(--text-primary, #212529);
    font-size: 1rem;
}

.author-title {
    font-size: 0.875rem;
    line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :where(.testimonials-section) .display-5 {
        font-size: 2rem;
    }

    .testimonial-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .testimonial-card::before {
        font-size: 3rem;
        top: 0.5rem;
        right: 1rem;
    }

    .testimonial-quote {
        font-size: 1rem;
    }

    :where(.author-avatar) img {
        width: 40px;
        height: 40px;
    }

    :where(.testimonial-card) .author-name {
        font-size: 0.9rem;
    }

    .author-title {
        font-size: 0.8rem;
    }
}

/* Ensure equal height cards */
@media (min-width: 768px) {
    .testimonial-card {
        height: 100%;
    }
}

/* Touch targets for mobile */
@media (max-width: 768px) {
    .testimonial-card {
        min-height: 44px;
    }
}

/* Star rating accessibility */
.testimonial-rating {
    role: img;
    aria-label: "Rating";
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .testimonial-card {
        border: 2px solid var(--text-primary, #000);
    }

    .testimonial-card::before {
        color: var(--text-muted, #666);
    }
}
