/**
 * Featured Grid Component
 * Bento-style grid for featured content
 *
 * Layout: 1 hero (2x2) + 4 side + 4 bottom = 9 cards
 *
 * @package MyChooz_Aesthetic
 * @version 0.0.1
 */

/* ═══════════════════════════════════════════════════════════════
   FEATURED GRID
   ═══════════════════════════════════════════════════════════════ */
.hp-featured {
    --featured-gap: 18px;
    --featured-radius: 12px;
    /* padding управляется в components/homepage-posts.css (combined-island) */
}

.hp-featured__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 2 ряда (hero + 4 side), без bottom — пустой ряд даёт лишний gap */
    grid-template-rows: minmax(140px, auto) minmax(140px, auto);
    gap: var(--featured-gap);
}

/* ═══════════════════════════════════════════════════════════════
   FEATURED CARD
   ═══════════════════════════════════════════════════════════════ */
.hp-fc {
    position: relative;
    border-radius: var(--featured-radius);
    background: var(--mca-text);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    box-shadow: var(--mca-card-shadow-dark);
}

.hp-fc__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.hp-fc__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 400ms ease;
}

.hp-fc__img--placeholder {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.hp-fc:hover .hp-fc__img {
    transform: scale(1.05);
}

.hp-fc__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.hp-fc__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.hp-fc__badge {
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
    color: #fff;
    opacity: 0.92;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Видимый только NEW — минимум визуального шума. Категории спрятаны. */
.hp-fc__badge--rating,
.hp-fc__badge--review,
.hp-fc__badge--news,
.hp-fc__badge--hot { display: none; }

.hp-fc__badge--new {
    background: var(--mca-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    letter-spacing: 0.6px;
    box-shadow: 0 2px 6px rgba(231, 29, 29, 0.4);
    opacity: 1;
}

.hp-fc__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 8px 8px;
    z-index: 2;
}

.hp-fc__title {
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    /* Ограничение в 2 строки с многоточием */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   GRID POSITIONS
   ═══════════════════════════════════════════════════════════════ */

/* Hero: spans 2 columns, matches height of 2 side cards */
.hp-fc--hero {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    aspect-ratio: auto;
}
.hp-fc--hero .hp-fc__title { font-size: 26px; }
.hp-fc--hero .hp-fc__content { padding: 16px 20px; }

/* Side: columns 3-4, rows 1-2 */
.hp-fc--side .hp-fc__title { font-size: 15px; }

/* Bottom: row 3, all columns */
.hp-fc--bottom .hp-fc__title { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .hp-featured__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }
    .hp-fc--hero {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
        aspect-ratio: 16 / 9;
    }
    .hp-fc--hero .hp-fc__title { font-size: 22px; }
}

@media (max-width: 640px) {
    .hp-featured__grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .hp-fc {
        aspect-ratio: 16 / 9;
    }
    .hp-fc--hero {
        grid-column: 1;
        grid-row: 1;
        aspect-ratio: 16 / 9;
    }
    .hp-fc--hero .hp-fc__title { font-size: 20px; }
}
