/* Landing Hero Providers - Adaptive Moving Columns Layout */
/* All class names prefixed with hero- to avoid global conflicts */

/* Base container */
.hero-providers-container {
    position: relative;
    width: 100%;
    min-height: 400px;
}

/* Common card styles */
.hero-provider-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-provider-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hero-provider-image-box {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f5f5f5;
}

.hero-provider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-provider-info {
    padding: 16px;
}

.hero-provider-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a1a;
    line-height: 1.3;
}

.hero-provider-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-star-rating {
    display: flex;
    gap: 2px;
    color: #5f60b9;
    font-size: 14px;
}

.hero-rating-number {
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.hero-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Keyboard focus style (H5) */
.hero-card-link:focus-visible .hero-provider-card {
    outline: 3px solid var(--bs-primary, #5f60b9);
    outline-offset: -3px;
}

/* Single large featured card */
.hero-provider-card-large {
    max-width: 460px;
    margin: 0 auto;
}

.hero-provider-card-large .hero-provider-card {
    position: relative;
}

.hero-provider-chips {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-chip {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Increased contrast for accessibility (MEDIUM - chip contrast >= 4.5:1) */
.hero-chip-available {
    background: #15803d;
    color: #fff;
}

/* Staggered layout (2-3 providers) - H3 fixes */
.hero-providers-staggered-wrapper {
    display: grid;
    gap: 24px;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 2 providers: 2 columns */
.hero-providers-staggered-wrapper[data-count="2"] {
    grid-template-columns: repeat(2, minmax(240px, 280px));
}

/* 3 providers: 3 columns */
.hero-providers-staggered-wrapper[data-count="3"] {
    grid-template-columns: repeat(3, minmax(220px, 260px));
}

.hero-provider-card-staggered {
    position: relative;
}

/* Stagger offsets */
.hero-stagger-0 {
    transform: translateY(-20px);
}

.hero-stagger-1 {
    transform: translateY(20px);
}

.hero-stagger-2 {
    transform: translateY(-20px);
}

/* Soft radial glow behind staggered cards (H3 - missing) */
.hero-providers-staggered-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(95, 96, 185, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Marquee layout (4+ providers) */
.hero-providers-marquee {
    display: flex;
    gap: 20px;
    height: 460px;
    overflow: hidden;
    position: relative;
}

/* Fade masks using mask-image (MEDIUM - theme-agnostic) */
.hero-providers-marquee {
    mask-image: linear-gradient(transparent, #000 80px, #000 calc(100% - 80px), transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 80px, #000 calc(100% - 80px), transparent);
}

/* Desktop: 2 or 3 columns */
.hero-providers-marquee-desktop {
    display: flex;
}

/* Narrow: always 2 columns, hidden by default */
.hero-providers-marquee-narrow {
    display: none;
}

.hero-marquee-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* C1 fix: align-self flex-start, height auto, gap 0 */
    align-self: flex-start;
    height: auto;
    gap: 0;
    will-change: transform;
}

.hero-marquee-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* C1 fix: gap inside content as padding-bottom so (content + gap) is exactly 50% */
.hero-marquee-content > * {
    padding-bottom: 20px;
}

.hero-provider-card-wrapper {
    flex-shrink: 0;
    width: 100%;
}

/* Marquee animations - C1 fix: scale duration by item count */
@keyframes heroMarqueeDown {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

.hero-marquee-column-down {
    animation: heroMarqueeDown calc(var(--hero-item-count, 3) * 15s) linear infinite;
}

/* C1 fix: use animation-direction reverse for up column */
.hero-marquee-column-up {
    animation: heroMarqueeDown calc(var(--hero-item-count, 3) * 15s) linear infinite;
    animation-direction: reverse;
}

/* Pause on hover/focus */
.hero-providers-marquee:hover .hero-marquee-column,
.hero-providers-marquee:focus-within .hero-marquee-column {
    animation-play-state: paused;
}

/* Reduced motion (H2 + MEDIUM M6) */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations */
    .hero-marquee-column-down,
    .hero-marquee-column-up {
        animation: none;
    }

    /* Disable hover effects */
    .hero-provider-card:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .hero-card-link {
        will-change: auto;
    }

    /* H2 fix: flex 1 1 0, min-width 0 for columns */
    .hero-providers-marquee {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        max-height: 600px;
    }

    .hero-marquee-column {
        flex: 1 1 0;
        min-width: 0;
    }

    .hero-marquee-content[aria-hidden="true"] {
        display: none;
    }
}

/* Dark mode */
html[data-bs-theme="dark"] .hero-provider-card {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-bs-theme="dark"] .hero-provider-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html[data-bs-theme="dark"] .hero-provider-name {
    color: #f5f5f5;
}

html[data-bs-theme="dark"] .hero-rating-number {
    color: #aaa;
}

html[data-bs-theme="dark"] .hero-provider-image-box {
    background: #1a1a1a;
}

/* MEDIUM - lighten star color in dark mode for 3:1 contrast */
html[data-bs-theme="dark"] .hero-star-rating {
    color: #8b8cdf;
}

/* MEDIUM - lighten glow in dark mode */
html[data-bs-theme="dark"] .hero-providers-staggered-wrapper::before {
    background: radial-gradient(circle, rgba(139, 140, 223, 0.2) 0%, transparent 70%);
}

/* Responsive */
@media (max-width: 1199px) {
    .hero-providers-marquee {
        height: 420px;
    }

    /* H2 fix: narrow viewport uses 2-col partition, desktop hidden */
    .hero-providers-marquee-desktop {
        display: none;
    }

    .hero-providers-marquee-narrow {
        display: flex;
    }

    /* 3-col staggered becomes 2+1 wrap on tablet */
    .hero-providers-staggered-wrapper[data-count="3"] {
        grid-template-columns: repeat(2, minmax(220px, 260px));
    }
}

@media (max-width: 767px) {
    .hero-providers-staggered-wrapper {
        gap: 16px;
    }

    .hero-providers-staggered-wrapper[data-count="2"],
    .hero-providers-staggered-wrapper[data-count="3"] {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .hero-providers-marquee {
        height: 360px;
        gap: 12px;
    }

    .hero-provider-name {
        font-size: 15px;
    }

    .hero-provider-info {
        padding: 12px;
    }

    .hero-star-rating {
        font-size: 12px;
    }

    .hero-rating-number {
        font-size: 12px;
    }

    .hero-provider-chips {
        top: 12px;
        left: 12px;
        gap: 6px;
    }

    .hero-chip {
        padding: 4px 10px;
        font-size: 11px;
    }
}
