/*
  About-us teaser — matches the shared NAVIGATOR Group template seen in
  references/home/2, about us/ (a jglobe.hu screenshot): eyebrow label →
  H2 → red divider → two short paragraphs → CTA, white background,
  two-column on desktop with a photo on the right.

  Two deviations from that reference, both deliberate:
  - The reference's right-column visual is a Julius-Globe-specific
    isometric illustration. Brunnbauer has no equivalent illustration
    asset, so a real curated photo (photo-hq-building-exterior) fills
    that slot instead, following the same "reskin the shared template
    with real Brunnbauer content" precedent as the hero section.
  - A second reference image (a dark SaaS stat-strip: value + label ×3)
    is redesigned here as a navy elevated card (.about__stats) using
    brand tokens and real Brunnbauer facts, not the source's dark theme
    or content.
*/

.about {
  background: var(--color-white);
  padding-top: var(--space-10); padding-bottom: var(--space-10);
}

/*
  Header (eyebrow/title/divider) sits in its own row spanning only the
  text column, separate from .about__text — this is what lets the media
  column start exactly at the first paragraph's top edge rather than the
  header's, per explicit user request that the photos "start on top when
  the paragraph starts and end at the bottom of the Rólunk button."
  .about__text and .about__media-col share row 2 with the grid's default
  stretch alignment, so the media column's height always matches
  .about__text's natural height (paragraph -> stats -> cta), and
  .about__media-col's own flex layout (see below) puts the leftover
  height entirely into .about__gallery, never into the fixed-ratio
  .about__media photo.
*/
.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--space-8);
  row-gap: var(--space-5);
}

.about__header {
  grid-column: 1;
  grid-row: 1;
}

.about__text {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* The row-gap above already supplies the header -> first-paragraph
   space; without this the first paragraph's own margin-top would add
   it a second time and offset .about__text's box below the row's top
   edge, breaking the top-alignment with the media column. */
.about__text > :first-child {
  margin-top: 0;
}

.about__eyebrow {
  color: var(--color-slate-600);
  font-family: var(--font-eyebrow);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  text-transform: uppercase;
}

.about__title {
  margin-top: var(--space-3);
}

.about__divider {
  width: 56px;
  height: 3px;
  margin-top: var(--space-5);
  background: var(--color-red-600);
  border-radius: 2px;
}

.about__paragraph {
  margin-top: var(--space-5);
}

.about__paragraph strong {
  font-weight: var(--fw-bold);
  color: var(--color-navy-900);
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  container-type: inline-size; /* for the stat value size below */
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-4);
  background: var(--color-navy-900);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-md);
}

.about__stat {
  padding-left: var(--space-2); padding-right: var(--space-2);
  text-align: center;
}

.about__stat:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.about__stats { --stat-value-em: 5.72; }
html:lang(de) .about__stats { --stat-value-em: 6.1; }
html:lang(en) .about__stats { --stat-value-em: 7.13; }

.about__stat-value {
  display: block;
  font-family: var(--font-display);
  /* jglobe.hu stat numbers use the h2 size (24 / 30.8 / 40px, Orbitron 800),
     2026-11-15. Capped so the widest value, "ISO 9001" (5.02em), still fits
     its column: cqi is the box's content width, so 100cqi / 3 - 16px column
     padding, / 5.33 = (100cqi - 48px) / 16. All three values stay one size.
     5.33em, not 5.2: WebKit draws the synthetic-bold Orbitron ~1.5% wider
     than Chromium, so /15.6 overflowed by 1-2px in Safari (2026-11-17).
     2026-11-27: the widest value is the third one and differs per language
     (WebKit em widths: HU "2025 óta" 5.61, DE "Seit 2025" 5.98, EN
     "Since 2025" 6.99; Chromium ~4% narrower), so the divisor is
     3 x --stat-value-em, set per language with ~2% margin. EN "Since 2025"
     overflowed its column by ~25px at 1440 before. */
  font-size: min(var(--fs-h2), calc((100cqi - 48px) / (3 * var(--stat-value-em))));
  line-height: 1.3;
  font-weight: var(--fw-display-strong);
  letter-spacing: var(--tracking-tight);
  color: var(--color-white);
  white-space: nowrap;
}

.about__stat-label {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
  color: var(--color-slate-200);
  /* Equal thirds AND one row (user, 2026-11-15): "a NAVIGATOR Csoport
     tagja" is 14.39em wide (measured 2026-11-21, Chromium + WebKit; the
     "a " came with the language review, before it was 13.5em / 14), so
     every label is sized to fit it in a third:
     (100cqi / 3 - 16px column padding) / 15 = (100cqi - 48px) / 45.
     All three labels stay one size. Floor 10px: where that is still too
     big (box under ~470px: laptops 769-1180px, phones) the label wraps,
     balanced, rather than turning unreadable. */
  font-size: clamp(10px, calc((100cqi - 48px) / 45), var(--fs-small));
  text-wrap: balance;
}

.about__cta {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-6);
  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);
}

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

.about__cta:active {
  transform: scale(0.97);
}

/* Wraps .about__media (unchanged, keeps its own 3/2 aspect-ratio) plus
   a two-photo row added underneath it. Sits in the same grid row as
   .about__text (grid's default stretch alignment matches its height to
   that row), so the wrapper's total height tracks the text column's
   height — the big photo's own height never does, only .about__gallery
   (flex: 1 below) absorbs the leftover space. */
.about__media-col {
  grid-column: 2;
  /* Spans header + text rows (2026-11-15, user request): the image column
     runs from the eyebrow's top to the Rólunk button's bottom, so both
     columns are the same height. */
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* 12px big photo -> photo row (24px tried, user chose 12) */
}

.about__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 24px 0 24px 0;
  box-shadow: var(--shadow-lg);
}

.about__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform var(--duration-slow) var(--ease-spring);
}

.about__media:hover img {
  transform: scale(1.06);
}

/* Color-treatment layer: a navy multiply tint ties the photo into the
   site's navy palette, matching the hero's overlay treatment. */
.about__media::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--color-navy-900);
  opacity: 0.18;
  mix-blend-mode: multiply;
}

/* Grounding gradient for depth, per the Anti-Generic Guardrails.
   rgba(29, 47, 66, *) is --color-navy-900, written literally since
   var() can't carry its own alpha here (same reasoning as
   .hero__overlay in hero.css). */
.about__media::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(to top, rgba(29, 47, 66, 0.55), rgba(29, 47, 66, 0) 55%);
}

/* Two-photo row under the big media photo — same bento-tile treatment
   (diagonal radius, navy-multiply + gradient overlay, hover-zoom) as
   .product-intro__gallery-item elsewhere on the site, kept here rather
   than shared since .about has no other bento-style component.
   flex: 1 (not aspect-ratio) so this row absorbs whatever height is
   left over once .about__media-col is stretched to match .about__text —
   that's what keeps .about__media's own height fixed while still making
   the whole column end flush with the bottom of the Rólunk button. */
.about__gallery {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: var(--space-3);
  min-height: 0;
}

.about__gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 24px 0 24px 0;
  box-shadow: var(--shadow-md);
}

/* Positioned out of flow (rather than width/height: 100%) so the image
   never contributes its own intrinsic aspect-ratio to .about__gallery's
   height — with an in-flow height:100% inside an auto-height flex/grid
   chain, browsers fall back to the image's native ratio during the
   outer grid's content-sizing pass, inflating .about__media-col's
   height past .about__text's and breaking the bottom alignment with
   the Rólunk button. Positioning it absolutely removes it from that
   calculation; it still fills the tile exactly via inset: 0. */
.about__gallery-item img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform var(--duration-slow) var(--ease-spring);
}

.about__gallery-item:hover img {
  transform: scale(1.08);
}

.about__gallery-item::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--color-navy-900);
  opacity: 0.18;
  mix-blend-mode: multiply;
}

.about__gallery-item::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(to top, rgba(29, 47, 66, 0.5), rgba(29, 47, 66, 0) 55%);
}

/* ---- Tablet / mobile (<= 768px) ---- */
@media (max-width: 768px) {
  .about {
    padding-top: var(--space-8); padding-bottom: var(--space-8);
  }

  /* Stacked single column: header -> text -> media-col in DOM order.
     The desktop stretch-alignment trick only makes sense with the media
     column beside the text column, so it's dropped here in favor of a
     plain top-to-bottom flow with its own gap. */
  .about__inner {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    row-gap: initial;
    gap: var(--space-6);
  }

  .about__media {
    aspect-ratio: 16 / 9;
  }

  /* No stretch-derived height to fill on mobile — restore a fixed ratio
     so the two photos don't collapse to zero height. */
  .about__gallery {
    flex: none;
  }

  .about__gallery-item {
    aspect-ratio: 4 / 3;
  }

  .about__paragraph {
    max-width: 100%;
  }

  .about__stats,
  .about__cta {
    width: 100%;
  }

  .about__cta {
    justify-content: center;
  }
}

/* ---- Mobile (<= 480px) ---- */
@media (max-width: 480px) {
  .about__stats {
    padding: var(--space-4);
  }

  .about__stat {
    padding-left: var(--space-2); padding-right: var(--space-2);
  }

  /* Too narrow for one row at a readable size: wrap, full size. */
  .about__stat-label {
    font-size: var(--fs-small);
    white-space: normal;
    text-wrap: balance;
  }
}

/* ~320px phones: "NAVIGATOR" alone (~74px) is wider than a stat column
   with 8px side padding (69px), so the padding shrinks to 4px here. */
@media (max-width: 400px) {
  .about__stat {
    padding-left: var(--space-1); padding-right: var(--space-1);
  }

  /* At 320px even with 4px padding the column (74px) is narrower than
     "NAVIGATOR" at 12.6px (6.27em = 79px), 2026-11-17: shrink the labels
     so that word fits, (100cqi / 3 - 8px) / 6.5. Capped at --fs-small, so
     this only bites below ~370px (11.5px at 320). */
  .about__stat-label {
    font-size: min(var(--fs-small), calc((100cqi - 24px) / 19.5));
  }
}
