/* ============================================
   Hero - Code Blue Academy
   The one page hero: eyebrow, title with the typed
   gradient line, subtitle, actions, and a card on
   the right. Loaded by templates/layouts/story.html
   (home, program, course and CE pages) and by the
   Training Courses, CE Courses and About pages, which
   do not use the story layout. Its script is
   js/pages/hero.js.
   ============================================ */

/* ===== 1. HERO SECTION ===== */

.hero {
    position: relative;
    background-color: var(--color-midnight-950);
    overflow: hidden;
    padding-block: var(--space-16) var(--space-24);
}

/* Brand pattern overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("/static/images/patterns/Code_Blue_Academy_Pattern_Update_5-02.66f68157fc33.png");
    background-size: 400px;
    background-repeat: repeat;
    opacity: 0.06;
    pointer-events: none;
}

/* Radial glow - red left */
.hero::after {
    content: '';
    position: absolute;
    top: 30%;
    left: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(var(--accent-red-rgb), 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Blue glow right */
.hero__glow-blue {
    position: absolute;
    top: 20%;
    right: -10%;
    width: 50%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(var(--color-cb-blue-rgb), 0.08) 0%, transparent 70%);
    pointer-events: none;
}


/* 2-column grid layout */
.hero__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

@media (max-width: 64em) {
    .hero__grid {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }
}

.hero__content {
    position: relative;
}

.hero__subheading {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-cb-blue-400);
    margin-block-end: var(--space-4);
}

/* A page stylesheet that restyles .subheading (courses.css centres it in
   a smaller face) leaves the hero's eyebrow as on every other page. */
.hero__content .hero__subheading {
    max-width: none;
    margin-inline: 0;
    font-family: inherit;
    font-size: var(--text-sm);
}

.hero__title {
    /* 2rem on a phone (6vw passes it at 533 px), so the title and subtitle
       leave the buttons on the first screen. */
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--color-white);
    margin-block-end: var(--space-6);
}

.hero__title-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: var(--color-slate-400);
    max-width: 38ch;
    margin-block-end: var(--space-8);
    line-height: var(--leading-relaxed);
}

/* Phones: the subtitle steps down a size. With the smaller title, the
   hero's buttons are on the first screen of a 375 by 667 phone (they
   started below it). */
@media (max-width: 48em) {
    .hero__subtitle {
        font-size: var(--text-md);
        line-height: var(--leading-normal);
        margin-block-end: var(--space-6);
    }
}

/* The smallest phones (under 360 px wide, 568 px tall): less room above
   the hero and a size down for the title and the subtitle, so the first
   button is on the first screen there as well (it started below it). */
@media (max-width: 22.45em) {
    .hero {
        padding-block-start: var(--space-8);
    }

    .hero__title {
        font-size: var(--text-28);
    }

    .hero__subtitle {
        font-size: var(--text-base);
    }
}

.hero__actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ── Hero Visual: Success State Card ── */

.hero__visual {
    display: flex;
    justify-content: center;
}

@media (max-width: 64em) {
    .hero__visual {
        max-width: 24rem;
        margin-inline: auto;
    }
}

.hero-card {
    background-color: var(--color-midnight-800);
    border: 2px solid rgb(var(--accent-green-rgb));
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 100%;
    max-width: 22rem;
    transform: perspective(800px) rotateY(-2deg) rotateX(1deg);
    transition: transform var(--duration-slow) var(--ease-default),
                box-shadow var(--duration-slow) var(--ease-default),
                background-color var(--duration-slow) var(--ease-default);
    box-shadow:
        0 0 40px rgba(var(--accent-green-rgb), 0.25),
        0 0 80px rgba(var(--accent-green-rgb), 0.08);
}

.hero-card:hover {
    transform: perspective(800px) rotateY(0deg) rotateX(0deg);
    background-color: var(--color-midnight-700);
    box-shadow:
        0 0 60px rgba(var(--accent-green-rgb), 0.45),
        0 0 120px rgba(var(--accent-green-rgb), 0.15);
}

/* On the lighter hover surface the card's slate-400 labels would be
   4.04:1, so they step up to slate-300 (6.97:1 on midnight-700) while the
   card is hovered. :where() keeps this lighter than a linked row's own
   hover colour. */
.hero-card:hover :where(.hero-card__title, .hero-card__activity-title, .hero-card__ring-text, .hero-card__stat-label, .hero-card__activity-item, .hero-card__empty-text) {
    color: var(--color-slate-300);
}

/* Notification banner */
.hero-card__notification {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background-color: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--status-ok);
    font-weight: var(--weight-medium);
    margin-block-end: var(--space-5);
}

/* Progress ring */
.hero-card__ring-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin-inline: auto;
    margin-block-end: var(--space-5);
}

.hero-card__ring {
    width: 100%;
    height: 100%;
}

/* js/pages/hero.js draws the ring. With scripts turned off nothing does,
   so it is shown full, as its number reads (the number is in the markup). */
@media (scripting: none) {
    .hero-card__ring-fill {
        stroke-dashoffset: 0;
    }
}

.hero-card__ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-card__ring-value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    line-height: 1;
}

.hero-card__ring-text {
    font-size: var(--text-xs);
    /* Two words take two lines inside the 120 px ring at 12 px: centred. */
    line-height: var(--leading-tight);
    text-align: center;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    margin-block-start: var(--space-1);
}

/* Mini stats row */
.hero-card__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding-block: var(--space-4);
    border-top: 1px solid var(--color-midnight-700);
    border-bottom: 1px solid var(--color-midnight-700);
    margin-block-end: var(--space-4);
}

.hero-card__stat {
    text-align: center;
}

.hero-card__stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    line-height: 1;
}

.hero-card__stat-value--success {
    font-size: var(--text-sm);
    color: var(--status-ok);
}

.hero-card__stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-block-start: var(--space-1);
}

.hero-card__stat-divider {
    width: 1px;
    height: 28px;
    background-color: var(--color-midnight-700);
}

/* Recent activity list */
.hero-card__activity {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.hero-card__activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    padding: var(--space-2) var(--space-2);
    border-radius: var(--radius-sm);
    transition: background-color var(--duration-fast) var(--ease-default);
}

.hero-card__activity-item:hover {
    background-color: var(--color-midnight-900);
}

/* A row that links (the training catalog's programs). */
a.hero-card__activity-item {
    text-decoration: none;
}

a.hero-card__activity-item:hover,
a.hero-card__activity-item:focus-visible {
    color: var(--color-white);
}

.hero-card__activity-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.hero-card__activity-dot--blue  { background-color: var(--color-cb-blue); }
.hero-card__activity-dot--green { background-color: var(--color-success-600); }
.hero-card__activity-dot--red   { background-color: var(--color-cb-red); }

.hero-card__activity-hours {
    margin-left: auto;
    color: var(--status-ok);
    font-weight: var(--weight-medium);
    font-size: var(--text-xs);
}

/* The hero's eyebrow, title, subtitle, buttons and card (.gs-hidden), and
   a CAPCE Pending box under the buttons, arrive together in 400 ms. The
   reveal is CSS, so the hero shows whether or not a script runs: it once
   waited on a script timeline that brought the buttons in last, 1.7 s in,
   and never showed them without it. With reduced motion _reset.css ends
   the animation at once, so the hero is simply there. */
.hero .gs-hidden,
.hero__content > .capce-pending {
    animation: hero-in var(--duration-slow) var(--ease-out) both;
}

@keyframes hero-in {
    from {
        opacity: 0;
        transform: translateY(var(--space-3));
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ===== HERO CARD: ACCENT MODIFIER + LABELS =====
   .hero-card--accent recolours the card to its --cc accent; the company
   home uses green, program pages their own colour. */

.hero-card--accent {
    border-color: rgb(var(--cc));
    box-shadow:
        0 0 40px rgba(var(--cc), 0.25),
        0 0 80px rgba(var(--cc), 0.08);
}

.hero-card--accent:hover {
    box-shadow:
        0 0 60px rgba(var(--cc), 0.45),
        0 0 120px rgba(var(--cc), 0.15);
}

.hero-card__title,
.hero-card__activity-title {
    margin: 0;
    max-width: none;
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-slate-400);
}

.hero-card__title {
    margin-block-end: var(--space-3);
    text-align: center;
}

.hero-card__activity-title {
    margin-block-end: var(--space-1);
}
