/**
 * Shared program detail hero (full-bleed image, glass meta cards, CTAs).
 * Matches program-hydroponics.html / program-microgreens.html.
 * Load after page :root tokens, before header-premium.css.
 */

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.program-hero.program-hero--power {
    padding: calc(var(--site-fixed-header-offset, 120px) + clamp(20px, 3.5vw, 36px)) 0 clamp(44px, 7vw, 64px);
}

.program-hero {
    position: relative;
    z-index: 1;
    color: #fff;
    text-align: center;
    padding: clamp(168px, 11vw + 120px, 248px) 0 clamp(52px, 9vw, 88px);
    border-bottom: 4px solid var(--primary-green, #007305);
    overflow: visible;
}

.program-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.program-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(52px);
    opacity: 0.42;
    animation: program-hero-orb-float 16s ease-in-out infinite;
}

.program-hero__orb--1 {
    width: min(440px, 58vw);
    height: min(440px, 58vw);
    top: -14%;
    left: -10%;
    background: rgba(52, 211, 153, 0.32);
}

.program-hero__orb--2 {
    width: min(380px, 50vw);
    height: min(380px, 50vw);
    bottom: -20%;
    right: -8%;
    background: rgba(0, 121, 198, 0.22);
    animation-delay: -6s;
}

.program-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 15%, transparent 78%);
    opacity: 0.55;
}

@keyframes program-hero-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(16px, -14px) scale(1.05); }
}

.program-hero-inner.is-ready .program-flagship-badge {
    animation: program-hero-badge-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.program-hero-inner.is-ready .programs-title-line {
    animation: program-hero-title-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.program-hero-inner.is-ready .programs-title-line--sub {
    animation-delay: 0.12s;
}

.program-hero-inner.is-ready .program-hero-hook {
    animation: program-hero-fade-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

@keyframes program-hero-badge-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes program-hero-title-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes program-hero-fade-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.program-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #004b04;
    background-image: linear-gradient(165deg, #003d03 0%, #004b04 48%, #002a02 100%);
    z-index: 0;
}

.program-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, rgba(0, 22, 8, 0.9) 0%, rgba(0, 48, 14, 0.82) 42%, rgba(0, 12, 4, 0.94) 100%);
    z-index: 1;
}

.program-hero .container {
    position: relative;
    z-index: 2;
}

.program-hero-inner {
    max-width: 920px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-top: 6px;
}

.program-hero-inner .program-flagship-badge {
    margin-top: 0;
    margin-bottom: clamp(16px, 3vw, 22px);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

h1.program-title {
    color: #ffffff !important;
    font-size: clamp(1.75rem, 4vw + 0.85rem, 3rem) !important;
    line-height: 1.12 !important;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
    margin-bottom: 0.4em;
    letter-spacing: -0.02em;
}

/* Two-line program hero titles — matches Programs catalogue typography */
html.ha-unified .program-hero.program-hero--power .program-title.programs-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.35em !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: clamp(2.1rem, 5.5vw + 0.35rem, 3.55rem) !important;
    line-height: 1.18 !important;
    text-wrap: pretty !important;
    letter-spacing: -0.025em !important;
    margin: 0 0 0.5em !important;
    padding: 0 !important;
    position: relative;
    z-index: 1;
    overflow: visible !important;
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
}

html.ha-unified .program-hero.program-hero--power .program-title.programs-title .programs-title-line {
    display: block !important;
    width: 100%;
    max-width: min(18ch, 100%);
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: inherit !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    filter: none !important;
}

html.ha-unified .program-hero.program-hero--power .program-title.programs-title .programs-title-line--sub {
    display: block !important;
    max-width: min(22ch, 100%);
    margin-top: 0.35em !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    font-size: clamp(0.95rem, 1.8vw + 0.35rem, 1.2rem) !important;
    font-weight: 500 !important;
    color: #86efac !important;
    -webkit-text-fill-color: #86efac !important;
    letter-spacing: 0.02em !important;
    line-height: 1.4 !important;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
}

.program-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.82rem, 1.5vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.93);
    margin-bottom: clamp(26px, 4.5vw, 42px);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

@keyframes program-meta-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-hero .hero-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(12px, 2.2vw, 18px);
    max-width: 980px;
    margin: 0 auto clamp(26px, 4vw, 38px);
}

@media (max-width: 900px) {
    .program-hero .hero-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .program-hero .hero-meta {
        grid-template-columns: 1fr;
        max-width: min(400px, 100%);
    }
}

.program-hero .meta-item {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    width: 100%;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: clamp(16px, 2.4vw, 22px) clamp(14px, 2vw, 18px);
    border-radius: 16px;
    border: 1px solid rgba(167, 243, 208, 0.28);
    transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1), border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
    opacity: 1;
    transform: none;
    animation: program-meta-in 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.program-hero .meta-item.is-active {
    border-color: rgba(134, 239, 172, 0.72);
    background: rgba(0, 115, 5, 0.32);
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22), 0 18px 40px rgba(0, 0, 0, 0.28);
    transform: translateY(-4px);
}

.program-hero .meta-item.is-pulse {
    animation: program-meta-pulse 0.52s ease;
}

@keyframes program-meta-pulse {
    0%, 100% { transform: translateY(-4px) scale(1); }
    45% { transform: translateY(-4px) scale(1.03); }
}

.program-hero .meta-item:focus-visible {
    outline: 2px solid #86efac;
    outline-offset: 3px;
}

.program-hero .meta-item:nth-child(1) { animation-delay: 0.06s; }
.program-hero .meta-item:nth-child(2) { animation-delay: 0.14s; }
.program-hero .meta-item:nth-child(3) { animation-delay: 0.22s; }
.program-hero .meta-item:nth-child(4) { animation-delay: 0.3s; }

.program-hero .meta-item:hover {
    transform: translateY(-7px);
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(52, 211, 153, 0.12);
}

.program-hero .meta-item i {
    font-size: 1.65rem;
    color: #6ee7b7;
    margin-bottom: 11px;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.program-hero .meta-item:hover i {
    transform: scale(1.14);
}

.program-hero .meta-item span {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 8px;
}

.program-hero .meta-item strong {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

.program-hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px 18px;
}

.program-hero-cta .program-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.program-hero-btn--primary {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border-color: rgba(167, 243, 208, 0.35);
    box-shadow: 0 12px 32px rgba(0, 115, 5, 0.38);
}

.program-hero-btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 115, 5, 0.48);
}

.program-hero-btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.42);
}

.program-hero-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
    transform: translateY(-3px);
}

/* Main content (batch strip) must paint above the green hero when overlapping */
html.ha-unified header + .program-hero + main#program-main,
html.ha-unified header + .program-hero + main.container {
    position: relative;
    z-index: 10;
}

html.ha-unified main#program-main .batch-info-strip {
    position: relative;
    z-index: 11;
    margin-top: 0;
    margin-bottom: clamp(24px, 4vw, 32px);
    overflow: visible;
}

html.ha-unified main#program-main:has(.batch-info-strip) {
    margin-top: 0;
    padding-top: clamp(12px, 3vw, 20px);
}

@media (prefers-reduced-motion: reduce) {
    .program-hero__orb {
        animation: none;
    }

    .program-hero-inner.is-ready .program-flagship-badge,
    .program-hero-inner.is-ready .programs-title-line,
    .program-hero-inner.is-ready .program-hero-hook {
        animation: none;
    }

    .program-hero .meta-item {
        animation: none;
        opacity: 1;
    }
    .program-hero .meta-item,
    .program-hero .meta-item i,
    .program-hero-cta .program-hero-btn {
        transition: none !important;
    }
    .program-hero .meta-item:hover,
    .program-hero .meta-item:hover i,
    .program-hero .meta-item.is-active,
    .program-hero-btn--primary:hover,
    .program-hero-btn--ghost:hover {
        transform: none;
    }
}

/* Dark training structure band on program detail pages */
.program-training-band {
    color: #f8fffb;
}

.program-training-band__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: clamp(1.45rem, 3vw, 1.8rem) !important;
    margin-bottom: 25px;
    text-align: left;
    color: #ffffff !important;
    -webkit-text-fill-color: currentColor !important;
}

.program-training-band__title i {
    color: #86efac !important;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .program-training-band {
        padding: 28px 22px !important;
    }
    .program-training-band__title {
        font-size: 1.35rem !important;
    }
}
