/*
  Images ("behind the scenes") gallery section — matches
  references/home/5, images/Képernyőfotó 2026-09-01 - 22.57.32.jpg, a
  screenshot of jglobe.hu's own "Betekintés a kulisszák mögé" section.
  Like the hero/header reference, this is a sibling NAVIGATOR Group site
  screenshot, not a bespoke Brunnbauer mockup — the shared template
  (full-bleed 4x2 photo grid with one dark text cell) is reskinned with
  Brunnbauer content: eyebrow location swapped Győrújbarát -> Budapest,
  title kept verbatim (generic template phrase, not a sibling-specific
  fact), lead paragraph keeps its generic "what these photos show"
  phrasing with only the location word changed.

  Photos are shown flat, no gradient/color-treatment overlay — a
  deliberate deviation from the Anti-Generic Guardrails' usual image
  treatment, since the Reference Images hard rule (match, don't improve)
  takes precedence when a reference is provided.
*/

.images {
  display: grid;
  /* minmax(0, 1fr), not 1fr (2026-11-17): with 1fr the text panel's
     min-content widened column 1 (420px vs 201 at 1024, 377 vs 301 at
     1280), the square cells in it grew taller than their rows and spilled
     up to 163px over the references section. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Rows are at least one column tall (square cells); a row only grows
     when the text panel needs more height (769-~1300px), and the photos
     then crop to fill it instead of leaving navy holes. */
  grid-auto-rows: minmax(25vw, auto);
  gap: 0;
  /* Fallback behind any subpixel grid-rounding hairline between cells
     (see .images__photo img below) so it reads as a dark seam instead
     of a stark white line from the page background showing through. */
  background: var(--color-navy-900);
}

/* Square cells come from grid-auto-rows above 768px; the aspect-ratio
   is only for the 2-/1-column layouts below (see media queries). */

.images__text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-7) var(--space-6);
  background: var(--color-navy-900);
  text-align: right;
}

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

.images__title {
  margin-top: var(--space-3);
  color: var(--color-white);
  font-size: var(--fs-h3);
  font-weight: var(--fw-display);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-heading);
}

/* Neutral slate-blue, not brand red — the reference's own divider here
   reads as plain template chrome (like about-us's neutral eyebrow color),
   not one of the sibling's own brand colors, so it's matched literally
   rather than reskinned to the brand red used by every other divider on
   this page (about/mindset). */
.images__divider {
  width: 56px;
  height: 2px;
  margin-top: var(--space-4);
  background: var(--color-slate-400);
}

.images__lead {
  margin-top: var(--space-4);
  max-width: 32ch;
  color: var(--color-slate-200);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.images__photo {
  overflow: hidden;
}

.images__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Always slightly oversized (not just on :hover) so a fractional-pixel
     grid-rounding gap at the cell edge — otherwise an intermittent white
     hairline from the page background — stays covered at rest too, not
     only mid-transition. */
  transform: scale(1.02);
  transition: transform var(--duration-slow) var(--ease-spring);
}

.images__photo:hover img {
  transform: scale(1.1);
}

/* ---- Tablet / mobile (<= 768px) ---- */
/* 769-1199px: 4 columns made the cells tall portraits (200x441 at 800),
   because the text panel cannot fit a 200-300px square. 3 columns with the
   text panel 2 wide: row 1 = text + 1 photo, rows 2-3 = 3 photos each,
   so all 7 photos fill the grid (2026-11-17). */
@media (min-width: 769px) and (max-width: 1199px) {
  .images {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(33.333vw, auto);
  }

  .images__text {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .images__photo {
    aspect-ratio: 1 / 1;
  }

  /* Left-aligned on mobile (user, 2026-11-18): full-width panel, so the
     desktop right alignment (which faces the photo grid) has no reason here. */
  .images__text {
    grid-column: 1 / -1;
    align-items: flex-start;
    padding: var(--space-6) var(--content-padding);
    text-align: left;
  }

  .images__lead {
    max-width: none;
  }

  /* 7 photos in 2 columns: the last one spans the row instead of leaving
     an empty navy cell. */
  .images__photo:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 2 / 1;
  }
}

/* ---- Mobile (<= 480px) ---- */
@media (max-width: 480px) {
  .images {
    grid-template-columns: minmax(0, 1fr);
  }

  .images__photo:last-child {
    aspect-ratio: 1 / 1;
  }
}
