/* MIURA inner-page Hero System v2
   Shared presentation contract for Products, Engines, Racing, Brand and Contact.
   CMS content, imagery and focal-point authority remain page-owned. */

:root {
  --miura-hero-story-desktop: clamp(560px, 75svh, 760px);
  --miura-hero-story-mobile: clamp(560px, 72svh, 720px);
  --miura-hero-gutter: max(32px, calc((100vw - 1240px) / 2));
  --miura-hero-padding-top: 112px;
  --miura-hero-padding-bottom: 48px;
  --miura-hero-copy-max: 860px;
  --miura-hero-body-max: 600px;
}

:is(section.page-hero, section.pw-intro, section.race-hero, section.brand-story-hero, section.contact-hero).hero--standard {
  box-sizing: border-box;
  width: 100%;
  height: var(--miura-hero-story-desktop) !important;
  min-height: var(--miura-hero-story-desktop) !important;
  padding: var(--miura-hero-padding-top) var(--miura-hero-gutter) var(--miura-hero-padding-bottom);
  align-items: flex-start;
  justify-content: flex-start;
}

section.page-hero.hero--standard {
  flex-direction: column;
  padding: 0;
}

:is(
  .pw-intro .pw-shell,
  .race-hero .race-hero-inner,
  .brand-story-hero .brand-story-inner,
  .contact-hero .contact-hero-inner
) {
  box-sizing: border-box;
  width: 100%;
  max-width: 1240px;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  align-items: flex-start;
}

:is(
  .page-hero .label,
  .pw-intro .pw-eyebrow,
  .race-hero .race-kicker,
  .brand-story-hero .brand-kicker,
  .contact-hero .contact-eyebrow
) {
  width: auto;
  min-height: 16px;
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--orange);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 4px;
  text-transform: uppercase;
}

:is(
  .page-hero .label,
  .pw-intro .pw-eyebrow,
  .race-hero .race-kicker,
  .brand-story-hero .brand-kicker,
  .contact-hero .contact-eyebrow
)::before {
  content: "";
  flex: 0 0 24px;
  width: 24px;
  height: 2px;
  display: inline-block;
  background: var(--orange);
}

:is(
  .page-hero h1,
  .pw-intro .pw-title,
  .race-hero h1,
  .brand-story-hero h1,
  .contact-hero h1
) {
  width: min(100%, var(--miura-hero-copy-max));
  max-width: var(--miura-hero-copy-max);
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(60px, 5.5vw, 84px);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.02em;
  text-wrap: balance;
  text-transform: uppercase;
}

:is(
  .page-hero p,
  .pw-intro .pw-intro-copy p,
  .race-hero p,
  .brand-story-hero p,
  .contact-hero p.lead
) {
  width: min(100%, var(--miura-hero-body-max));
  max-width: var(--miura-hero-body-max);
  margin: 0;
  color: rgba(255,255,255,.76);
  font-size: 16px;
  line-height: 1.75;
}

.pw-intro .pw-intro-copy {
  max-width: var(--miura-hero-body-max);
  margin-top: 0;
  padding-bottom: 0;
}

:is(.race-hero .race-actions, .brand-story-hero .brand-actions, .contact-hero .contact-hero-cta) {
  margin-top: 28px;
}

:is(.page-hero, .pw-intro, .race-hero, .brand-story-hero, .contact-hero) > :is(.page-hero-media, .pw-intro-media, .race-hero-media, .brand-hero-media, .contact-hero-media) {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  width: 100%;
  height: 100% !important;
  overflow: hidden;
  background: #111;
}

section.page-hero.hero--standard > .page-hero-media {
  z-index: 1 !important;
}

section.page-hero.hero--standard::after {
  display: none !important;
}

section.page-hero.hero--standard .page-hero-watermark {
  z-index: 1;
}

section.page-hero.hero--standard .page-hero-copy {
  z-index: 2;
}

section.page-hero.hero--standard .page-hero-media picture img {
  filter: saturate(.82) contrast(1.05) brightness(.68);
}

.brand-hero-media {
  position: absolute;
}

:is(.page-hero, .pw-intro, .race-hero, .brand-story-hero, .contact-hero) :is(.page-hero-media, .pw-intro-media, .race-hero-media, .brand-hero-media, .contact-hero-media) picture {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100% !important;
  display: block;
}

:is(
  .page-hero .page-hero-media picture img,
  .pw-intro .pw-intro-media picture img,
  .race-hero .race-hero-media picture img,
  .brand-story-hero .brand-hero-media picture img,
  .contact-hero .contact-hero-media picture img
) {
  width: 100%;
  height: 100% !important;
  max-height: none;
  display: block;
  object-fit: cover !important;
  object-position: var(--hero-position-desktop, center center);
  transform: none !important;
}

/* Legacy backdrop markup is hidden while old cached templates drain. */
:is(.page-hero-media, .pw-intro-media, .race-hero-media, .brand-hero-media, .contact-hero-media) > .miura-hero-backdrop {
  display: none !important;
}

/* Desktop media composition keeps text readable while the focal point owns crop direction. */
@media (min-width: 768px) {
  .pw-intro .pw-intro-media {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .pw-intro .pw-intro-media picture {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    transform: none;
  }

  .race-hero .race-hero-media {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .race-hero .race-hero-media::after {
    display: none;
  }

  .contact-hero .contact-hero-media {
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :is(
    .page-hero .page-hero-media picture img,
    .pw-intro .pw-intro-media picture img,
    .race-hero .race-hero-media picture img,
    .brand-story-hero .brand-hero-media picture img,
    .contact-hero .contact-hero-media picture img
  ) {
    object-position: var(--hero-position-tablet, var(--hero-position-desktop, center center));
  }
}

/* Racing and Contact use one uninterrupted photograph, not a black text zone. */
.race-hero.hero--standard::before,
.race-hero.hero--standard .race-hero-media::after,
.contact-hero.hero--standard .contact-hero-media::after {
  display: none !important;
}

.race-hero.hero--standard .race-hero-media picture img {
  filter: saturate(.9) contrast(1.04) brightness(.72);
}

.contact-hero.hero--standard .contact-hero-media picture img {
  filter: saturate(.88) contrast(1.04) brightness(.68);
}

:is(.race-hero.hero--standard, .contact-hero.hero--standard) :is(h1, p, .race-kicker, .contact-eyebrow) {
  text-shadow: 0 2px 18px rgba(0,0,0,.72);
}

@media (max-width: 767px) {
  :root {
    --miura-hero-gutter: 22px;
    --miura-hero-padding-top: 104px;
    --miura-hero-padding-bottom: 48px;
  }

  :is(section.page-hero, section.pw-intro, section.race-hero, section.brand-story-hero, section.contact-hero).hero--standard {
    height: var(--miura-hero-story-mobile) !important;
    min-height: var(--miura-hero-story-mobile) !important;
  }

  :is(
    .page-hero h1,
    .pw-intro .pw-title,
    .race-hero h1,
    .brand-story-hero h1,
    .contact-hero h1
  ) {
    width: 100%;
    max-width: 100%;
    font-size: clamp(44px, 12vw, 56px);
    line-height: .98;
  }

  body:not(.lang-en) :is(
    .page-hero h1,
    .pw-intro .pw-title,
    .race-hero h1,
    .brand-story-hero h1,
    .contact-hero h1
  ) {
    line-height: 1.04;
    letter-spacing: -.03em;
  }

  :is(
    .page-hero p,
    .pw-intro .pw-intro-copy p,
    .race-hero p,
    .brand-story-hero p,
    .contact-hero p.lead
  ) {
    width: 100%;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.72;
  }

  :is(
    .page-hero .page-hero-media picture img,
    .pw-intro .pw-intro-media picture img,
    .race-hero .race-hero-media picture img,
    .brand-story-hero .brand-hero-media picture img,
    .contact-hero .contact-hero-media picture img
  ) {
    object-position: var(--hero-position-mobile, center center);
  }

  .pw-intro .pw-intro-media picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }
}

@media (max-width: 430px) {
  :root {
    --miura-hero-padding-top: 100px;
    --miura-hero-padding-bottom: 44px;
  }

  :is(
    .page-hero .label,
    .pw-intro .pw-eyebrow,
    .race-hero .race-kicker,
    .brand-story-hero .brand-kicker,
    .contact-hero .contact-eyebrow
  ) {
    margin-bottom: 16px;
    font-size: 12px;
    letter-spacing: 3px;
  }

  :is(.race-hero .race-actions, .brand-story-hero .brand-actions, .contact-hero .contact-hero-cta) {
    margin-top: 24px;
  }
}
