/* ============================================================================
   Featured Cards Component
   Shared by: featured-news.php, featured-events.php, featured-products.php
   Plutonium CMS 6.2
   ============================================================================ */

/* Three-column responsive grid */
.featured-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--Space6);
    width: 100%;
    padding: var(--Space4) 0 var(--Space8);
}

@media (max-width: 960px) {
    .featured-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .featured-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Card — wrapper
   ============================================================================ */

.featured-card {
    background: hsla(var(--White), 1);
    border-radius: var(--RadiusMD, 8px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Anchor wraps the whole card */
.featured-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ============================================================================
   Card — image region
   ============================================================================ */

.featured-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 300px;
    overflow: hidden;
    background: hsla(var(--ColorBrand), 0.06);
    flex-shrink: 0;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.featured-card:hover .featured-card-image img {
    transform: scale(1.04);
}

.featured-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsla(var(--ColorBrand), 0.06);
    color: hsla(var(--ColorBrand), 0.35);
    font-size: 2.5rem;
}

/* ============================================================================
   Card — body
   ============================================================================ */

.featured-card-body {
    padding: var(--Space4) var(--Space4) var(--Space3);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--Space2);
}

.featured-card-meta {
    font-size: var(--FontSizeSM, 0.8rem);
    color: hsla(var(--ColorBrand), 0.85);
    font-family: var(--FontFamilyMono, monospace);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

[data-featured-events-carousel] .featured-card-meta {
    font-family: var(--FontFamily);
}

.featured-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.featured-card-excerpt {
    font-size: var(--FontSizeSM, 0.875rem);
    line-height: 1.55;
    margin: 0;
    flex: 1;
    opacity: 0.75;
}

/* Small inline badge (e.g. event location, product price) */
.featured-card-badge {
    display: inline-block;
    font-size: var(--FontSizeSM, 0.8rem);
    background: hsla(var(--ColorBrand), 0.1);
    color: hsla(var(--ColorBrand), 1);
    padding: 2px 9px;
    border-radius: var(--RadiusSM, 4px);
    font-weight: 600;
    margin: 0;
}

/* ============================================================================
   Card — footer
   ============================================================================ */

.featured-card-footer {
    padding: var(--Space3) var(--Space4) var(--Space4);
    border-top: 1px solid hsla(var(--ColorBrand), 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.featured-card-cta {
    color: hsla(var(--ColorBrand), 1);
    font-size: var(--FontSizeSM, 0.875rem);
    font-weight: 600;
    transition: letter-spacing 0.15s ease;
}

.featured-card:hover .featured-card-cta {
    letter-spacing: 0.25px;
}

/* ============================================================================
   Empty state
   ============================================================================ */

.featured-cards-empty {
    padding: var(--Space8);
    text-align: center;
    opacity: 0.5;
    font-style: italic;
    grid-column: 1 / -1;
}

/* ============================================================================
   Featured News Carousel (single-card view)
   ============================================================================ */

.featured-news-carousel {
    width: 100%;
    padding: var(--Space4) 0 var(--Space8);
}

.featured-news-track {
    position: relative;
    width: 100%;
    min-height: 420px;
}

.featured-news-slide {
    display: none;
    margin: 0 auto;
}

.featured-news-slide.is-active {
    display: flex;
}

/* Events carousel: fade between slides like the general slider */
[data-featured-events-carousel] .featured-news-slide {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 1s ease-in-out;
}

[data-featured-events-carousel] .featured-news-slide.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
    z-index: 3;
}

[data-featured-events-carousel] .featured-news-slide.is-leaving {
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.featured-news-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--Space3);
    margin-top: var(--Space4);
}

.featured-news-control {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.featured-news-control:hover,
.featured-news-control:focus-visible {
    background: hsla(var(--ColorBrand), 1);
    color: hsla(var(--White), 1);
    border-color: hsla(var(--ColorBrand), 1);
    outline: none;
}

#featured-news-carousel .featured-news-control,
[data-featured-events-carousel] .featured-news-control {
    border: 0;
    background: none;
    background-color: transparent;
    color: hsla(var(--ColorBrand), 1);
    font-size: 0;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 50%;
    transition: color 0.2s ease;
}

#featured-news-carousel .featured-news-control .material-icons,
[data-featured-events-carousel] .featured-news-control .material-icons {
    font-size: 34px;
    line-height: 1;
}

#featured-news-carousel .featured-news-control:hover,
#featured-news-carousel .featured-news-control:focus-visible,
#featured-news-carousel .featured-news-control:active,
[data-featured-events-carousel] .featured-news-control:hover,
[data-featured-events-carousel] .featured-news-control:focus-visible,
[data-featured-events-carousel] .featured-news-control:active {
    background: none;
    background-color: transparent;
    border-color: transparent;
    box-shadow: none !important;
    transform: none !important;
    color: hsla(var(--ColorBrand), 0.85);
}

.featured-news-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-news-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: hsla(var(--ColorBrand), 0.28);
    cursor: pointer;
    padding: 0;
}

.featured-news-dot.is-active {
    background: hsla(var(--ColorBrand), 1);
}

@media (max-width: 768px) {
    .featured-card-image {
        max-height: 300px;
    }

    .featured-news-track {
        min-height: 0;
    }

    .featured-news-control {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}
