/* =====================================================================
   HEROES — one title style per hero type, used site-wide, plus shared
   mobile behaviour for image heroes.

   The theme has two hero layouts:
   1. Image hero  — full-width photo with white title (About, Media,
      Capacity, Research, Outreach, Resource Creation, Our Approach and
      every project page).
   2. Minimal hero — plain background with green title (resource lists,
      alphabet charts, Blog, Our Work, Resources hub).

   Page stylesheets set colour and layout of their hero, but title
   typography lives only here, so every hero matches. Loaded after page
   stylesheets.
   ===================================================================== */

/* Both hero types use the same title size: --fs-hero-title in default.css */

/* 1. Image hero */
.about-hero h1,
.media-hero h1,
.capacity-hero h1,
.research-hero h1,
.outreach-hero h1,
.rc-hero h1,
.approach-hero-title,
.cnc-hero h1,
.cop-hero h1,
.game-hero h1,
.nbsel-hero h1,
.neaf-hero h1,
.nem-hero h1,
.sm-hero h1 {
    font-family: var(--font-heading);
    font-size: var(--fs-hero-title);
    font-weight: 700;
    line-height: var(--lh-hero-title);
    letter-spacing: 1px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    overflow-wrap: break-word;
}

/* 2. Minimal hero */
.resources-hero-title {
    font-family: var(--font-heading);
    font-size: var(--fs-hero-title);
    font-weight: 700;
    line-height: var(--lh-hero-title);
    letter-spacing: 1px;
    overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------
   Space between the header and the page title — the same on every page.
   Plain heroes and photo heroes both start their text --hero-top-space
   from the top of the page (the header floats over that space). The
   photo keeps its full height; the text sits at the top of it.
   The hero grows if its text is longer than the photo (long intros used
   to be cut off behind the header).
   Home page carousel is not included.
   --------------------------------------------------------------------- */

/* heroes laid out in a row: vertical position is align-items */
.about-hero,
.media-hero,
.capacity-hero,
.research-hero,
.outreach-hero,
.rc-hero,
.approach-hero,
.resources-hero.hero-v2 {
    align-items: flex-start;
}

/* heroes laid out in a column: vertical position is justify-content */
.cnc-hero,
.cop-hero,
.game-hero,
.nbsel-hero,
.neaf-hero,
.nem-hero,
.sm-hero {
    justify-content: flex-start;
}

.about-hero,
.media-hero,
.capacity-hero,
.research-hero,
.outreach-hero,
.rc-hero,
.approach-hero,
.resources-hero.hero-v2,
.cnc-hero,
.cop-hero,
.game-hero,
.nbsel-hero,
.neaf-hero,
.nem-hero,
.sm-hero {
    min-height: fit-content;
    padding-top: var(--hero-top-space);
    padding-bottom: 60px;
}

/* the text box inside a hero adds no extra space of its own, so the title
   starts exactly --hero-top-space from the top on every page */
.resources-hero .resources-hero-content,
.capacity-hero-content,
.outreach-hero-content {
    padding-top: 0;
}

/* About was pulled 6px higher than every other hero */
.about-hero {
    margin-top: -130px !important;
}

/* ---------------------------------------------------------------------
   Image heroes on phones and tablets: grow with their content instead of
   clipping it (long intros used to push the title under the header).
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
    .about-hero {
        margin-top: -85px !important;
    }

    /* plain heroes: same starting point as photo heroes */
    .resources-hero {
        margin-top: -85px;
    }

    .about-hero,
    .media-hero,
    .capacity-hero,
    .research-hero,
    .outreach-hero,
    .rc-hero,
    .approach-hero,
    .cnc-hero,
    .cop-hero,
    .game-hero,
    .nbsel-hero,
    .neaf-hero,
    .nem-hero,
    .sm-hero,
    .resources-hero.hero-v2 {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        margin-top: -85px;
        padding-top: var(--hero-top-space);
        padding-bottom: 60px;
        overflow: visible;
    }

    .approach-hero-description {
        font-size: var(--fs-hero-intro);
        line-height: 1.6;
    }
}

/* ---------------------------------------------------------------------
   Intro text under the page title: justified (straight edges on both
   sides) with the last line centred under the title. Same on every page.
   --------------------------------------------------------------------- */
.resources-hero-subtitle,
.approach-hero-description,
.game-hero-description,
.media-hero-description,
.nbsel-hero-subtitle,
.neaf-hero-subtitle,
.nem-hero-subtitle,
.cnc-hero-subtitle,
.cop-hero-subtitle,
.sm-hero-subtitle,
.resources-hero-subtitle p,
.approach-hero-description p,
.game-hero-description p,
.media-hero-description p,
.nbsel-hero-subtitle p,
.neaf-hero-subtitle p,
.nem-hero-subtitle p,
.cnc-hero-subtitle p,
.cop-hero-subtitle p,
.sm-hero-subtitle p,
.capacity-hero-content p,
.outreach-hero-content p,
.research-hero-content p,
.bt-hero p,
.hh-hero p,
.ns-hero p,
.nm-hero p,
.ac-hero p {
    text-align: justify !important;
    text-align-last: center;
}

/* Phones: lines are too short to justify without big gaps between words,
   so the intro is centred under the title there, with balanced line
   breaks (justified from tablet width up) */
@media (max-width: 767px) {
    .resources-hero-subtitle,
    .approach-hero-description,
    .game-hero-description,
    .media-hero-description,
    .nbsel-hero-subtitle,
    .neaf-hero-subtitle,
    .nem-hero-subtitle,
    .cnc-hero-subtitle,
    .cop-hero-subtitle,
    .sm-hero-subtitle,
    .capacity-hero-content p,
    .outreach-hero-content p,
    .research-hero-content p,
    .bt-hero p,
    .hh-hero p,
    .ns-hero p,
    .nm-hero p,
    .ac-hero p,
    .resources-hero-subtitle p,
    .approach-hero-description p,
    .game-hero-description p,
    .media-hero-description p,
    .nbsel-hero-subtitle p,
    .neaf-hero-subtitle p,
    .nem-hero-subtitle p,
    .cnc-hero-subtitle p,
    .cop-hero-subtitle p,
    .sm-hero-subtitle p {
        text-align: center !important;
        text-align-last: center;
        text-wrap: pretty;
        line-height: 1.7;
    }
}
