/* Featured Grid Block - Сетка избранных статей */

.featured-grid-wrapper {
    margin: 2rem 0;
}

.featured-grid__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111111;
}

html.dark .featured-grid__title {
    color: #ffffff;
}

/* Основная сетка */
.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Desktop (lg+) */
@media (min-width: 1024px) {
    .featured-grid {
        flex-direction: row;
        gap: 1.5rem;
    }
    
    .featured-grid__hero {
        flex: 1;
        min-width: 0;
    }
    
    .featured-grid__cards {
        flex: 1;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        align-content: start;
    }
}

/* Tablet (md) */
@media (min-width: 768px) and (max-width: 1023px) {
    .featured-grid__cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile (sm) - 1 колонка */
@media (max-width: 767px) {
    .featured-grid__cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Hero Article (большая карточка) */
.featured-grid__hero {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

html.dark .featured-grid__hero {
    background: #1a1a1a;
    border-color: #333;
}

.featured-grid__hero:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

html.dark .featured-grid__hero:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.featured-grid__hero-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.featured-grid__hero-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
}

html.dark .featured-grid__hero-image {
    background: #2a2a2a;
}

.featured-grid__hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-grid__hero:hover .featured-grid__hero-image img {
    transform: scale(1.05);
}

.featured-grid__hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    padding: 2rem;
}

.featured-grid__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #ffc107;
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.featured-grid__hero-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-grid__category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    width: fit-content;
}

html.dark .featured-grid__category {
    background: #2a2a2a;
    color: #e0e0e0;
}

.featured-grid__hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    color: #111111;
}

html.dark .featured-grid__hero-title {
    color: #ffffff;
}

.featured-grid__hero-link:hover .featured-grid__hero-title {
    color: #007bff;
}

html.dark .featured-grid__hero-link:hover .featured-grid__hero-title {
    color: #4da6ff;
}

.featured-grid__hero-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

html.dark .featured-grid__hero-excerpt {
    color: #bbb;
}

.featured-grid__hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #999;
    margin-top: auto;
}

html.dark .featured-grid__hero-meta {
    color: #999;
}

.featured-grid__likes {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Grid Cards (4 обычные карточки) */
.featured-grid__card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

html.dark .featured-grid__card {
    background: #1a1a1a;
    border-color: #333;
}

.featured-grid__card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

html.dark .featured-grid__card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.featured-grid__card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.featured-grid__card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
}

html.dark .featured-grid__card-image {
    background: #2a2a2a;
}

.featured-grid__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-grid__card:hover .featured-grid__card-image img {
    transform: scale(1.05);
}

.featured-grid__card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}

.featured-grid__card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.featured-grid__card-category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    width: fit-content;
}

html.dark .featured-grid__card-category {
    background: #2a2a2a;
    color: #e0e0e0;
}

.featured-grid__card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    color: #111111;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html.dark .featured-grid__card-title {
    color: #ffffff;
}

.featured-grid__card-link:hover .featured-grid__card-title {
    color: #007bff;
}

html.dark .featured-grid__card-link:hover .featured-grid__card-title {
    color: #4da6ff;
}

.featured-grid__card-meta {
    font-size: 0.8rem;
    color: #999;
    margin-top: auto;
}

html.dark .featured-grid__card-meta {
    color: #999;
}

/* Адаптивность для мобильных */
@media (max-width: 767px) {
    .featured-grid__hero-image {
        aspect-ratio: 16/9;
    }
    
    .featured-grid__card-image {
        aspect-ratio: 1/1;
    }
    
    .featured-grid__hero-title {
        font-size: 1.5rem;
    }
    
    .featured-grid__card-title {
        font-size: 1rem;
    }
    
    .featured-grid__badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-grid__hero,
.featured-grid__card {
    animation: fadeInUp 0.6s ease-out;
}

.featured-grid__card:nth-child(1) {
    animation-delay: 0.1s;
}

.featured-grid__card:nth-child(2) {
    animation-delay: 0.2s;
}

.featured-grid__card:nth-child(3) {
    animation-delay: 0.3s;
}

.featured-grid__card:nth-child(4) {
    animation-delay: 0.4s;
}
