/*
  Hero — full-bleed photo with a navy overlay (color/opacity measured from
  the pptx, see --color-overlay-navy / --overlay-hero-opacity in
  tokens.css) and a dark banner strip beneath it, matching the shared
  NAVIGATOR Group template seen in references/home/1, hero/.
*/

.hero__media {
  position: relative;
  /* +40px over the original clamp(360px, 56vw, 640px): the header got
     ~40px shorter (smaller logo + tighter padding) when its height was
     reduced, so the hero absorbs that back to keep the same total
     above-the-fold composition. */
  min-height: clamp(400px, 56vw, 680px);
  overflow: hidden;
}

.hero__image {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform-origin: center 35%;
  animation: hero-ken-burns 18s var(--ease-out) forwards;
}

@keyframes hero-ken-burns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.12);
  }
}

.hero__overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  /* --color-overlay-navy (#23304d) at 0.75: lighter than the shared
     --overlay-hero-opacity (0.85, still used by capabilities, footer and
     page-hero) at the user's request, 2026-11-14. */
  background: rgba(35, 48, 77, 0.75);
}

/*
  .hero__content also carries the shared .container class (same
  max-width/margin-auto/padding-inline as the utility bar, header, and
  banner strip) so its left edge lines up with theirs at every desktop/
  laptop/wide width — position:absolute + a .container's centering still
  works since inset:0 gives it explicit left/right to center within.
  Text-column width is capped on the headline/subline themselves instead
  of here, so this element doesn't fight .container's own max-width.
*/
.hero__content {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-elevated);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--space-8); padding-bottom: var(--space-8);
}

/* No hyphenation, 3 rows (user, 2026-11-15): "Prémium minőségű / ipari
   szerelvények / gyártása". The longest row is 10.44em (689px at 66px; the
   old 640px column gave 4 rows there), so the column is 10.9em wide at every
   size (719px at 66px, 534px at 49px) and the break stays the same. Phones
   (<=430px) are narrower than 10.9em and get 4 rows. On phones the size is capped so the
   longest word, "szerelvények" (7.8em), fits the column whole:
   100vw - 2 x 20px padding. */
.hero__headline {
  max-width: 10.9em;
  color: var(--color-white);
  font-weight: var(--fw-display);
  font-size: min(var(--fs-h1), calc((100vw - 40px) / 7.9));
  line-height: var(--lh-h1);
  hyphens: manual;
  letter-spacing: var(--tracking-tight);
}

.hero__subline {
  max-width: 640px;
  margin-top: var(--space-5);
  color: var(--color-white);
  font-size: var(--fs-lead);
  font-weight: var(--fw-medium);
  opacity: 0.92;
}

.hero__banner {
  background: var(--color-navy-900);
  color: var(--color-white);
}

.hero__banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  padding-top: var(--space-5); padding-bottom: var(--space-5);
}

/* jglobe.hu hero strip: Orbitron 700, 18px desktop / 16.8px phone */
.hero__banner-text {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}

.hero__banner-cta {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
  background: var(--color-red-600);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  padding: calc(var(--space-3) - var(--button-border)) calc(var(--space-6) - var(--button-border));
  border: var(--button-border) solid var(--color-red-600);
  border-radius: var(--radius-button);
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-spring);
}

.hero__banner-cta:hover {
  background: var(--color-white);
  color: var(--color-red-600);
}

.hero__banner-cta:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.hero__banner-cta:active {
  transform: scale(0.97);
}

/*
  Desktop/laptop (landscape, >= 1024px): photo + banner fill exactly the
  first screen below the header — no banner cut off on short screens, no
  white strip under it on tall ones (user request, 2026-11-14). The header
  above is 134-154px depending on width, so main.js measures where .hero
  starts and writes it to --hero-top; 154px is the no-JS fallback. The
  photo takes whatever the banner leaves. 440px floor: below that the
  headline + subline no longer fit with breathing room (only screens
  shorter than ~690px hit it, and there the banner falls below the fold).
*/
@media (min-width: 1024px) and (orientation: landscape) {
  .hero {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--hero-top, 154px));
    height: calc(100svh - var(--hero-top, 154px));
    min-height: calc(440px + 96px);
  }

  .hero__media {
    flex: 1 1 auto;
    min-height: 440px;
  }

  .hero__banner {
    flex: none;
  }
}

/* ---- Tablet / mobile (<= 768px) ---- */
@media (max-width: 768px) {
  /* Photo + banner (with the Rólunk button) fill exactly the first screen
     below the header on mobile too (user, 2026-11-18), as on desktop: svh =
     the height with Safari's toolbars showing. The photo takes what the
     banner leaves; its floor is the headline block's own height
     (--hero-content-h, set by main.js; 320px without JS), so the headline
     is never cut and only very short screens push the banner down. */
  .hero {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--hero-top, 154px));
    height: calc(100svh - var(--hero-top, 154px));
    min-height: min-content;
  }

  .hero__media {
    flex: 1 1 auto;
    min-height: var(--hero-content-h, 320px);
  }

  .hero__banner {
    flex: none;
  }

  .hero__content {
    padding-top: var(--space-7); padding-bottom: var(--space-7);
  }

  .hero__subline {
    max-width: 100%;
  }

  .hero__banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .hero__banner-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Short phones (e.g. 320x568, 360x640): half the headline padding, so the
   photo floor (headline block height) leaves room for the banner and its
   Rólunk button on the first screen. */
@media (max-width: 768px) and (max-height: 700px) {
  .hero__content {
    padding-top: var(--space-5); padding-bottom: var(--space-5);
  }
}

/* ---- Mobile (<= 480px) ---- */
@media (max-width: 480px) {
  .hero__image {
    object-position: 65% center;
  }
}
