/*
 * Advanced Hero Section Styles
 * Version: 2.0.0
 * Features: Responsive layout, smooth animations, accessibility support
 */

:root {
    /* Color Scheme */
    --hero-primary-color: #D32F2F; /* Theme primary color */
    --hero-secondary-color: #1E88E5; /* Complementary color */
    --hero-text-light: #ffffff;
    --hero-text-dark: #212121;
    --hero-text-muted: #757575;
    --hero-bg-dark: #121212;
    --hero-border-color: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --hero-gap: 1.5rem;
    --hero-padding: 2rem;
    
    /* Effects */
    --hero-border-radius: 12px;
    --hero-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --hero-transition-speed: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Typography */
    --hero-font-heading: 'Georgia', serif;
    --hero-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Hero Section Styles */
.hero-section-advanced {
    position: relative;
    padding: var(--hero-padding) 0;
    margin-bottom: 3rem;
    background-color: var(--hero-bg-dark);
    color: var(--hero-text-light);
    overflow: hidden;
}

.hero-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hero-gap);
    position: relative;
    z-index: 2;
}

/* Main Hero Post */
.hero-main-post {
    position: relative;
    border-radius: var(--hero-border-radius);
    overflow: hidden;
    min-height: 400px;
    isolation: isolate;
}

.hero-article-main {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform var(--hero-transition-speed);
    z-index: -1;
    will-change: transform;
}

.hero-main-post:hover .hero-background-image {
    transform: scale(1.05);
}

.hero-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 60%;
}

.hero-category-badge {
    display: inline-block;
    background-color: var(--hero-primary-color);
    color: var(--hero-text-light);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    align-self: flex-start;
    transition: all var(--hero-transition-speed);
    opacity: 0;
    transform: translateY(20px);
}

.hero-title {
    font-family: var(--hero-font-heading);
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    line-height: 1.2;
    font-weight: 700;
    margin: 0.5rem 0 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--hero-transition-speed);
}

.hero-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 80ch;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--hero-transition-speed);
}

.hero-article-main.is-active .hero-category-badge,
.hero-article-main.is-active .hero-title,
.hero-article-main.is-active .hero-excerpt {
    opacity: 1;
    transform: translateY(0);
}

.hero-category-badge { transition-delay: 0.1s; }
.hero-title { transition-delay: 0.2s; }
.hero-excerpt { transition-delay: 0.3s; }

/* Secondary Posts */
.hero-secondary-posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.hero-article-secondary {
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--hero-border-radius);
    overflow: hidden;
    transition: all var(--hero-transition-speed);
    border: 1px solid var(--hero-border-color);
}

.hero-article-secondary.is-active,
.hero-article-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: var(--hero-shadow);
}

.hero-link-secondary {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--hero-text-light);
    gap: 1rem;
}

.hero-thumbnail-secondary {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.hero-thumbnail-secondary img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--hero-transition-speed);
}

.hero-article-secondary:hover .hero-thumbnail-secondary img {
    transform: scale(1.1);
}

.hero-content-secondary {
    flex: 1;
}

.hero-item-number {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hero-primary-color);
    margin-bottom: 0.5rem;
    transition: color var(--hero-transition-speed);
}

.hero-article-secondary:hover .hero-item-number {
    color: var(--hero-text-light);
}

.hero-title-secondary {
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
    margin: 0;
    transition: color var(--hero-transition-speed);
}

/* Responsive Design */
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    .hero-main-post {
        min-height: 500px;
    }
    
    .hero-content-overlay {
        padding: 3rem;
    }
}

@media (min-width: 992px) {
    .hero-section-advanced {
        padding: 3rem 0;
    }
    
    .hero-main-post {
        min-height: 600px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .hero-article-secondary {
        background-color: rgba(255, 255, 255, 0.03);
    }
    
    .hero-article-secondary.is-active,
    .hero-article-secondary:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }
}

/* Accessibility Focus Styles */
.hero-article-main:focus,
.hero-link-secondary:focus {
    outline: 2px solid var(--hero-primary-color);
    outline-offset: 3px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .hero-background-image,
    .hero-thumbnail-secondary img,
    .hero-category-badge,
    .hero-title,
    .hero-excerpt,
    .hero-article-secondary {
        transition: none !important;
    }
    
    .hero-category-badge,
    .hero-title,
    .hero-excerpt {
        opacity: 1;
        transform: none;
    }
}

/* Loading State */
.hero-section-advanced.is-loading .hero-background-image,
.hero-section-advanced.is-loading .hero-thumbnail-secondary {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}