/* ============================================================
   PAGE HERO — the image + title banner at the top of every page
   ------------------------------------------------------------
   Markup (copy this for a new page):

   <section class="page-hero" style="--focus: 70% 40%;">
     <img class="page-hero__img" src="images/x.jpg" alt="…" fetchpriority="high">
     <div class="page-hero__content">
       <p class="page-hero__script">Script line</p>
       <h1 class="page-hero__title">Title</h1>
       <div class="page-hero__actions">…optional buttons…</div>
     </div>
   </section>

   Rules:
   - The text always starts below the site header (--header-h from
     header.css), so it can't collide with the logo or Menu button.
   - The section sets the height; the image just fills it
     (object-fit: cover). Pick the crop with --focus (object-position).
   - Page stylesheets may set the variables below or use the modifiers,
     but must not restyle .page-hero__* selectors.

   Variables a page may set (inline style or page CSS):
     --focus        object-position of the photo         (default: center)
     --hero-h       preferred height                     (default: 40vw)
     --hero-min     smallest height                      (default: header + 12rem)
     --hero-max     tallest height                       (default: min(75vh, 860px))
     --hero-ink     title colour                         (default: white)
     --hero-script  script line colour                   (default: maroon)
     --hero-fade    colour the bottom edge fades into    (default: none)

   Modifiers:
     .page-hero--ink-dark  dark title, for light photos
     .page-hero--scrim     dark gradient on the left, white script line
     .page-hero--home      taller hero with room for buttons (index)
     .page-hero--fade      fade the bottom edge into --hero-fade
     .page-hero--image-only  no text block (e.g. the Classes page)
     .page-hero--band      mid-page band, text centred, uses __heading + __text
                           (Who We Are on the home page)
   ============================================================ */

.page-hero {
  --hero-h: 40vw;
  --hero-min: calc(var(--header-h) + 12rem);
  --hero-max: min(75vh, 860px);
  --hero-ink: var(--white);
  --hero-script: var(--marron-btn);

  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  width: 100%;
  /* min-height (not height): if the text ever needs more room, the hero grows
     instead of clipping it */
  min-height: clamp(var(--hero-min), var(--hero-h), var(--hero-max)); /* min wins if min > max */
  margin: 0;
  padding: 0;
  background-color: #1a0d08;
}

.page-hero__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, center);
}

.page-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(1200px, 100%);
  padding-top: calc(var(--header-h) + 8px);
  padding-left: var(--header-pad-x);
  padding-right: var(--header-pad-x);
  padding-bottom: clamp(24px, 5vw, 96px);
}

.page-hero__script {
  display: block;
  margin: 0;
  font-family: 'photograph_signatureregular';
  font-size: clamp(1.5rem, 4.6vw, 6rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  color: var(--hero-script);
}

.page-hero__title {
  margin: 0;
  font-family: var(--prata);
  font-size: clamp(2rem, 6vw, 7rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  color: var(--hero-ink);
  overflow-wrap: break-word;
}

.page-hero__actions {
  margin-top: clamp(20px, 2.8vw, 44px);
}
.page-hero__actions .cmn-btn-dv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.page-hero__actions .cmn-btn-dv .cmn-btn { margin-left: 0 !important; }

/* ── Modifiers ─────────────────────────────────────────────── */

.page-hero--ink-dark { --hero-ink: #111; }
/* On narrow screens the crop puts the subject behind the title, so give dark
   text a soft light wash to read against */
@media only screen and (max-width: 767px) {
  .page-hero--ink-dark::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(80deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,.35) 45%, rgba(255,255,255,0) 75%);
    pointer-events: none;
  }
}

.page-hero--scrim { --hero-script: var(--white); }
.page-hero--scrim::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, rgba(10,6,4,.82) 0%, rgba(10,6,4,.55) 38%, rgba(10,6,4,.15) 68%, rgba(10,6,4,0) 88%);
  pointer-events: none;
}

.page-hero--fade::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 8%;
  background: linear-gradient(to bottom, transparent, var(--hero-fade, #fff));
  pointer-events: none;
}

.page-hero--home {
  --hero-h: 56.25vw;                        /* 16:9 */
  --hero-max: 100vh;
  --hero-min: calc(var(--header-h) + 22rem); /* script + 2-line title + buttons */
}
.page-hero--home .page-hero__content { padding-bottom: clamp(32px, 9vw, 180px); }

.page-hero--image-only { --hero-min: calc(var(--header-h) + 6rem); }

/* Band: the same image + text block used mid-page (e.g. "Who We Are" on the
   home page). No header above it, so the text is centred vertically instead
   of being pushed below --header-h. Use __heading (h2) instead of the
   script + h1 pair, and __text for a short paragraph. */
.page-hero--band {
  --hero-h: 47vw;
  --hero-min: 24rem;
  --hero-max: 90vh;
  align-items: center;
}
.page-hero--band .page-hero__content {
  padding-top: clamp(40px, 6vw, 120px);
  padding-bottom: clamp(40px, 6vw, 120px);
  max-width: min(760px, 55%); /* keep the text in the left half, clear of the subject */
}
.page-hero--band .page-hero__text { max-width: min(26em, 75%); }

.page-hero__heading {
  margin: 0 0 clamp(14px, 1.4vw, 24px);
  font-family: var(--prata);
  font-size: clamp(1.6rem, 3.2vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hero-ink);
}
.page-hero__text {
  max-width: 32em;
  margin: 0;
  font-family: var(--poppins);
  font-size: clamp(15px, 1.25vw, 22px);
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--hero-ink) 80%, transparent);
}

/* Narrow screens: the text spans the full width, so the scrim covers it all
   (darker at the bottom where hero text sits) instead of fading out to the right */
@media only screen and (max-width: 767px) {
  .page-hero--scrim::after {
    background: linear-gradient(to top, rgba(10,6,4,.82) 0%, rgba(10,6,4,.55) 55%, rgba(10,6,4,.3) 100%);
  }

  /* Band on narrow screens: behave like the home page image cards
     (.cat-slide-link / .rbi-home-card): a taller fixed shape (4:5) with the
     photo cropped to fill it, and the text overlaid at the bottom on a dark
     gradient that fades up into the photo. Grows if the text needs more room. */
  .page-hero--band {
    --hero-h: 125vw;
    --hero-min: 0px;
    --hero-max: 200vh;
    align-items: flex-end;
  }
  .page-hero--band.page-hero--scrim::after {
    background: linear-gradient(to top, rgba(10,3,1,.85) 0%, rgba(10,3,1,.7) 40%, rgba(10,3,1,0) 72%);
  }
  .page-hero--band.page-hero--fade::before { display: none; }
  .page-hero--band .page-hero__content {
    max-width: none;
    padding: 80px var(--header-pad-x) clamp(22px, 6vw, 36px);
  }
  /* Type scales with the card, like .cat-slide-label / .cat-slide-desc */
  .page-hero--band .page-hero__heading { font-size: clamp(1.4rem, 6vw, 2.4rem); margin-bottom: 10px; }
  .page-hero--band .page-hero__text { font-size: clamp(14px, 3.6vw, 17px); line-height: 1.6; }
  .page-hero--band .page-hero__actions { margin-top: clamp(16px, 4vw, 24px); }
}

/* Phones: a little more room under the text */
@media only screen and (max-width: 575px) {
  .page-hero__content { padding-bottom: 28px; }
  .page-hero__actions .cmn-btn-dv { gap: 8px; }
}
