/* ==========================================================================
   Hero Component — Consolidated
   2 variants (image / gradient) × 3 sizes (full / medium / compact)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Animations (GPU-accelerated: transform + opacity only)
   -------------------------------------------------------------------------- */
@keyframes heroFadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroSubtitleFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroImageZoom {
    from { transform: scale(1); }
    to   { transform: scale(1.05); }
}

/* --------------------------------------------------------------------------
   Base — .hero (shared by both variants)
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Title / Subtitle / Meta (BEM children)
   -------------------------------------------------------------------------- */
.hero__title {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px;
    animation: heroFadeSlideUp 0.6s ease-out both;
}

.hero__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin: 0 0 20px;
    max-width: 700px;
    animation: heroSubtitleFadeIn 0.6s ease-out 0.15s both;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    animation: heroSubtitleFadeIn 0.6s ease-out 0.25s both;
}

.hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero__meta i {
    color: var(--accent, #f47920);
}

.hero__meta a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 2px;
}

.hero__meta a:hover {
    color: #fff;
    text-decoration-color: #fff;
}

/* --------------------------------------------------------------------------
   Search form (homepage only)
   -------------------------------------------------------------------------- */
.hero__search {
    animation: heroSubtitleFadeIn 0.6s ease-out 0.3s both;
}

/* --------------------------------------------------------------------------
   Variant A: Image hero  (.hero--image)
   -------------------------------------------------------------------------- */
.hero--image {
    background: linear-gradient(
        to bottom,
        rgba(30, 58, 95, 0.75) 0%,
        rgba(30, 58, 95, 0.4) 40%,
        rgba(30, 58, 95, 0.6) 100%
    );
}

/* Background image element */
.hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    animation: heroImageZoom 8s ease-out both;
}

/* Wrapper needed for overflow: hidden + picture child */
.hero__bg-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero__bg-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroImageZoom 8s ease-out both;
}

/* --------------------------------------------------------------------------
   Variant B: Gradient hero  (.hero--gradient)
   -------------------------------------------------------------------------- */
.hero--gradient {
    background: linear-gradient(135deg, var(--primary, #1e3a5f) 0%, #2a4a6f 100%);
}

/* --------------------------------------------------------------------------
   Size: Full  (.hero--full) — Homepage only
   Desktop 480px / Mobile 360px
   -------------------------------------------------------------------------- */
.hero--full {
    min-height: 480px;
    padding: 100px 20px 60px;
}

/* --------------------------------------------------------------------------
   Size: Medium  (.hero--medium) — Index pages, About, FAQ
   Desktop 320px / Mobile 240px
   -------------------------------------------------------------------------- */
.hero--medium {
    min-height: 320px;
    padding: 100px 20px 40px;
}

/* --------------------------------------------------------------------------
   Size: Compact  (.hero--compact) — Ad list, Contact, Legal
   Desktop 200px / Mobile 160px
   -------------------------------------------------------------------------- */
.hero--compact {
    min-height: 200px;
    padding: 100px 20px 30px;
}

.hero--compact .hero__title {
    font-size: 2rem;
    margin-bottom: 8px;
}

.hero--compact .hero__subtitle {
    font-size: 1rem;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Medium-specific title sizing
   -------------------------------------------------------------------------- */
.hero--medium .hero__title {
    font-size: 2.25rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero--medium .hero__subtitle {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Article show — image via inline style (no <picture>)
   Container-scoped content for left-aligned meta
   -------------------------------------------------------------------------- */
.hero--article-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    align-items: flex-start;
    text-align: left;
}

.hero--article-image .hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero--article-image .hero__title {
    max-width: 900px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

.hero--article-image .hero__meta {
    justify-content: flex-start;
}

.hero--article-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(30, 58, 95, 0.7), rgba(30, 58, 95, 0.85));
    z-index: 0;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet (768px – 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .hero--medium .hero__title {
        font-size: 1.9rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive: Mobile (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .hero--full {
        min-height: 360px;
        padding: 80px 20px 40px;
    }

    .hero--full .hero__title {
        font-size: 1.6rem;
    }

    .hero--full .hero__subtitle {
        font-size: 1rem;
    }

    .hero--medium {
        min-height: 240px;
        padding: 80px 20px 30px;
    }

    .hero--medium .hero__title {
        font-size: 1.6rem;
    }

    .hero--medium .hero__subtitle {
        font-size: 1rem;
    }

    .hero--compact {
        min-height: 160px;
        padding: 80px 16px 24px;
    }

    .hero--compact .hero__title {
        font-size: 1.5rem;
    }

    .hero--compact .hero__subtitle {
        font-size: 0.9rem;
    }

    .hero__meta {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .hero--article-image {
        min-height: 280px;
    }

    .hero--article-image .hero__title {
        font-size: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Responsive: Small mobile (< 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .hero--full {
        min-height: 320px;
    }

    .hero--full .hero__title {
        font-size: 1.4rem;
    }

    .hero--medium {
        min-height: 200px;
    }

    .hero--medium .hero__title {
        font-size: 1.4rem;
    }

    .hero--medium .hero__subtitle {
        font-size: 0.95rem;
    }

    .hero--compact {
        min-height: 140px;
    }

    .hero--compact .hero__title {
        font-size: 1.25rem;
    }

    .hero--article-image {
        min-height: 250px;
    }

    .hero--article-image .hero__title {
        font-size: 1.25rem;
    }

    .hero__meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .hero--article-image .hero__meta {
        align-items: flex-start;
    }
}

/* --------------------------------------------------------------------------
   Accessibility: prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero__title,
    .hero__subtitle,
    .hero__meta,
    .hero__search,
    .hero__bg,
    .hero__bg-wrap img {
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   Print: hide hero entirely
   -------------------------------------------------------------------------- */
@media print {
    .hero {
        display: none;
    }
}
