/* =============================================
   Hero Section Styles
   ============================================= */

.hero-section {
    width: 100%;
    padding: 1.25rem 0 1.5rem;
    background: #f8fafc;
}

.hero-section > .container {
    width: min(1280px, 92vw);
    margin: 0 auto;
}

/* Hero Grid Layout */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 280px);
    gap: 1.25rem;
}

/* Featured card spans 2 columns and 2 rows */
.hero-card--featured {
    grid-column: span 2;
    grid-row: span 2;
}

/* Hero Card Base */
.hero-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #1f2937;
}

.hero-card__link {
    display: block;
    width: 100%;
    height: 100%;
    color: #fff;
    text-decoration: none;
}

/* Card Image */
.hero-card__image {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-card:hover .hero-card__img {
    transform: scale(1.05);
}

/* Placeholder when no image */
.hero-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.hero-card__image--placeholder svg {
    width: 48px;
    height: 48px;
    color: #6b7280;
}

.hero-card--featured .hero-card__image--placeholder svg {
    width: 80px;
    height: 80px;
}

/* Card Overlay */
.hero-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    transition: background 0.3s ease;
}

.hero-card:hover .hero-card__overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

.hero-card--featured .hero-card__overlay {
    padding: 2rem;
}

/* Card Content */
.hero-card__content {
    position: relative;
    z-index: 1;
}

/* Category Badge */
.hero-card__category {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: var(--theme-primary);
    border-radius: 3px;
}

.hero-card--featured .hero-card__category {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

/* Card Title */
.hero-card__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-card--featured .hero-card__title {
    font-size: 1.75rem;
    line-height: 1.25;
    -webkit-line-clamp: 3;
}

/* Card Excerpt (featured only) */
.hero-card__excerpt {
    margin: 0.75rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Meta */
.hero-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.hero-card--featured .hero-card__meta {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.hero-card__reading-time::before {
    content: '·';
    margin-right: 1rem;
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 320px repeat(2, 200px);
    }

    .hero-card--featured {
        grid-column: span 2;
        grid-row: span 1;
    }

    .hero-card--featured .hero-card__title {
        font-size: 1.5rem;
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    /* Match global container padding on mobile */
    .hero-section > .container {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-section {
        padding: 1.5rem 0 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px repeat(4, 180px);
        gap: 1rem;
    }

    .hero-card--featured {
        grid-column: span 1;
    }

    .hero-card {
        border-radius: 4px;
    }

    .hero-card__overlay {
        padding: 1rem;
    }

    .hero-card--featured .hero-card__overlay {
        padding: 1.5rem;
    }

    .hero-card__title {
        font-size: 1rem;
    }

    .hero-card--featured .hero-card__title {
        font-size: 1.375rem;
    }

    .hero-card__excerpt {
        display: none;
    }

    .hero-card__meta {
        font-size: 0.75rem;
    }
}

/* Grid adjustments based on post count */
.hero-grid[data-count="3"] {
    grid-template-rows: repeat(2, 280px);
}

.hero-grid[data-count="3"] .hero-card:not(.hero-card--featured) {
    grid-row: span 1;
}

.hero-grid[data-count="4"] {
    grid-template-rows: repeat(2, 280px);
}

@media (max-width: 640px) {
    .hero-grid[data-count="3"] {
        grid-template-rows: 300px repeat(2, 180px);
    }

    .hero-grid[data-count="4"] {
        grid-template-rows: 300px repeat(3, 180px);
    }
}

