/*
  Capabilities section — matches references/home/3, what we do/
  BRUNNBAUER-Budapest_intro_HU.png, a full export of slide 11 of the
  Brunnbauer intro deck. Unlike hero/about, this reference is Brunnbauer's
  own slide (not a sibling-company reskin), so its copy is kept verbatim.

  Background photo is photo-valve-handwheels-reflection, confirmed by
  extracting image18.jpeg from the pptx and matching it to the already
  curated file. Same overlay tokens as the hero (--color-overlay-navy /
  --overlay-hero-opacity), since this is another full-bleed photo section.

  The reference's round "B S B" certification-body seal has no exported
  equivalent and isn't approximated (real third-party mark) — a generic
  certificate icon (icon-certified-badge-navy.svg, a navy recolor of the
  already-exported white badge glyph) stands in instead, per explicit
  user decision.
*/

.capabilities {
  position: relative;
  overflow: hidden;
  padding-top: var(--space-9); padding-bottom: var(--space-9);
  background: var(--color-navy-900);
}

.capabilities__media {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: var(--z-base);
}

/* The <picture> wrapper needs a size of its own, or the img's height:100%
   resolves to nothing and the photo keeps its square shape: on phones it
   covered only the top 393px of the 2185px section, the rest was plain
   navy (2026-11-17). On desktop the square happened to cover it. */
.capabilities__media picture {
  display: block;
  height: 100%;
}

.capabilities__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center;
  animation: capabilities-ken-burns 18s var(--ease-out) forwards;
  animation-play-state: paused;
}

.capabilities__media img.is-in-view {
  animation-play-state: running;
}

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

.capabilities__overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--color-overlay-navy);
  opacity: var(--overlay-hero-opacity);
}

.capabilities__inner {
  position: relative;
  z-index: var(--z-elevated);
}

.capabilities__eyebrow {
  color: var(--color-slate-200);
  font-family: var(--font-eyebrow);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  text-transform: uppercase;
  text-align: center;
}

.capabilities__title {
  margin-top: var(--space-3);
  max-width: 720px;
  margin-left: auto; margin-right: auto;
  color: var(--color-white);
  font-weight: var(--fw-display);
  letter-spacing: var(--tracking-tight);
  text-align: center;
}

/* Same treatment as .about__divider, centered under the headline (the
   about-us divider sits left-aligned under a left-aligned headline;
   here the headline itself is centered, per explicit user instruction). */
.capabilities__divider {
  width: 56px;
  height: 3px;
  margin-top: var(--space-5);
  margin-left: auto; margin-right: auto;
  background: var(--color-red-600);
  border-radius: 2px;
}

/* ---- Certification box + red tag row (share one horizontal band) ---- */
.capabilities__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.capabilities__cert {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
  padding: var(--space-2) var(--space-6);
  background: #b4c7e7; /* one-off light blue per explicit user color pick, not a site token */
  border-radius: 24px 0 24px 0; /* top-left/bottom-right cut per explicit user instruction */
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  /* No lift on hover (user, 2026-11-15, same as the cards): only its
     arrow badge reacts, to its own hover. */
}

.capabilities__cert-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  /* Source SVG's viewBox carries extra canvas from the full compass-logo
     export (see logomark-compass-navy.svg) — its actual seal content is
     a centered circle, so object-fit:cover crops in to just that circle
     instead of squashing the wide canvas into a square. */
  object-fit: cover;
}

.capabilities__cert-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capabilities__cert-lines p {
  font-weight: var(--fw-bold);
  color: var(--color-navy-900);
}

/* ---- Red tag row ---- */
.capabilities__tags {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  width: 100%;
  max-width: 620px;
}

.capabilities__tag {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: var(--space-3);
  /* 25% opacity on the fill only (not the whole element), so the label
     text inside stays fully readable. rgba() is written literally since
     var(--color-red-600) can't carry its own alpha here. */
  background: rgba(213, 48, 32, 0.65);
  border-radius: 50%;
  text-align: center;
}

.capabilities__tag p {
  color: #b8c6e4; /* one-off light navy-blue per explicit user color pick, not a site token */
  font-weight: var(--fw-bold);
  font-size: calc(var(--fs-small) * 1.265);
  line-height: var(--lh-heading);
}

/* ---- Photo-badge + card grid ---- */
.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  margin-top: var(--space-9);
}

.capabilities__item {
  --photo-size: clamp(160px, 22vw, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  /* No lift/shadow on hover (user, 2026-11-15): only the photo zooms and
     the "Bővebben" button changes colour. */
}

.capabilities__photo {
  position: relative;
  z-index: var(--z-base);
  width: var(--photo-size);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50%;
  /* Same 65% translucent red as .capabilities__tag, per explicit user
     instruction. rgba() literal for the same reason as the tag fill —
     var(--color-red-600) can't carry its own alpha here. */
  border: 20px solid rgba(213, 48, 32, 0.65);
  box-shadow: var(--shadow-lg);
}

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

.capabilities__item:hover .capabilities__photo img,
.capabilities__item:focus-visible .capabilities__photo img {
  transform: scale(1.06);
}

.capabilities__card {
  position: relative;
  z-index: var(--z-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: calc(var(--photo-size) * 0.968);
  margin-top: calc(-1 * var(--space-6) * 1.771);
  padding: 4% 5%;
  background: var(--color-overlay-navy); /* #23304d, per explicit user color pick — matches this token exactly */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.capabilities__card-title {
  color: #b8c6e4; /* one-off light navy-blue per explicit user color pick, not a site token */
  font-weight: var(--fw-bold);
  font-size: calc(var(--fs-body) * 0.968);
  line-height: 1.5;
}

.capabilities__card-list {
  margin-top: 0;
  list-style: none;
  text-align: left;
}

.capabilities__card-list li {
  position: relative;
  padding-left: var(--space-4);
  color: #b8c6e4; /* one-off light navy-blue per explicit user color pick, not a site token */
  font-weight: var(--fw-bold);
  font-size: calc(var(--fs-small) * 0.85);
  line-height: 1.5;
}

.capabilities__card-list li:not(:first-child) {
  margin-top: calc(var(--space-1) / 2);
}

.capabilities__card-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px;
  height: 4px;
  background: #b8c6e4; /* matches .capabilities__card-list li text color, per explicit user instruction */
  border-radius: 50%;
}

.capabilities__card-text {
  margin-top: 0;
  color: #b8c6e4; /* one-off light navy-blue per explicit user color pick, not a site token */
  font-weight: var(--fw-bold);
  font-size: calc(var(--fs-small) * 0.85);
}

/* Cert box: red arrow badge (square, button corners) at the right end (user, 2026-11-15:
   the arrow, not the button, on this box). Hover works like the
   .capabilities__btn buttons: only on the badge's own hover (or keyboard
   focus on the box) it turns white with a red arrow; the 2px border in the
   fill colour keeps the size unchanged. The box itself doesn't move. */
.capabilities__go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-button); /* same corners as the buttons (user) */
  border: var(--button-border) solid var(--color-red-600);
  background: var(--color-red-600);
  color: var(--color-white);
  /* No shadow (user, 2026-11-15; buttons have none either). */
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-spring);
}

.capabilities__go:hover,
.capabilities__cert:focus-visible .capabilities__go {
  background: var(--color-white);
  color: var(--color-red-600);
}

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

/* Cards: a footer row (the "Bővebben" button) pinned to the card bottom, so
   all three cards share one baseline. The auto margins on the first child and
   on the footer split the free space, keeping the text visually centred
   above the footer.*/
.capabilities__card {
  padding-bottom: var(--space-4);
}

.capabilities__card > :first-child {
  margin-top: auto;
}

/* Minimum breathing room above the footer in the tallest card (Gyártás),
   where the auto margin above resolves to 0. */
.capabilities__card > :nth-last-child(2) {
  margin-bottom: var(--space-4);
}

.capabilities__more {
  display: flex;
  justify-content: center;
  align-self: stretch;
  margin-top: auto;
}

/* "Bővebben" button: same pattern as every site button (.about__cta etc.):
   red fill, 2px border in the fill colour, 3px radius, Orbitron 700
   --fs-label; hover = white fill + red text. It is a <span> because the
   whole card is already the link (no nested <a>). */
.capabilities__btn {
  display: inline-flex;
  align-items: center;
  padding: calc(var(--space-3) - var(--button-border)) calc(var(--space-6) - var(--button-border));
  background: var(--color-red-600);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  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),
    transform var(--duration-fast) var(--ease-spring);
}

/* Only the button's own hover changes it (user, 2026-11-15); hovering the
   rest of the card zooms the photo only. Keyboard focus on the card link
   still shows the button state. */
.capabilities__btn:hover,
.capabilities__item:focus-visible .capabilities__btn {
  background: var(--color-white);
  color: var(--color-red-600);
}

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

/* ---- Tablet / small laptop (<= 1279px): circles under the cert box ----
   Beside the cert box (~490px with its arrow badge) the 4 circles only get
   48px (780) to 138px (1260), and "Szelepvezérlő" touches the edge from
   ~124px down; at full size they are 143px (142 at 1280). Below 1280 the
   row stacks: cert box centred, the 4 circles in one row under it at their
   620px max width (143px each). <=768 below takes over (2x2). */
@media (max-width: 1279px) {
  .capabilities__row {
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
  }
}

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

  .capabilities__row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-5);
  }

  .capabilities__cert {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    /* No extra right padding: the arrow sits beside the icon row, above
       the text, so the text can use the full width. */
  }

  .capabilities__go {
    position: absolute;
    right: var(--space-4);
    /* Top-right (user, 2026-11-18), vertically centred on the 56px seal
       icon: box padding-top + (56 - 36) / 2. */
    top: calc(var(--space-2) + 10px);
  }

  .capabilities__tags {
    grid-template-columns: repeat(2, 1fr);
    max-width: 420px;
    margin-left: auto; margin-right: auto;
  }

  .capabilities__grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-left: auto; margin-right: auto;
    gap: var(--space-7);
  }

  /* One card per row: the 22vw size (meant for 3 across) sat at its 160px
     floor here (155px cards, 2026-11-17), so a fixed size instead.
     Circle and card share one width (user, 2026-11-18): 300px, or the
     column width on phones narrower than that. Roomier padding and larger
     text than desktop. Mobile only; desktop keeps 0.968 x the photo. */
  .capabilities__item {
    --photo-size: min(300px, 100%);
  }

  .capabilities__card {
    width: var(--photo-size);
    padding: var(--space-6) var(--space-5) var(--space-5);
  }

  .capabilities__card-title {
    font-size: calc(var(--fs-body) * 1.15);
  }

  /* Breathing room between "Gyártás" and its first bullet (user,
     2026-11-18): the title and list otherwise touch. */
  .capabilities__card-title + .capabilities__card-list {
    margin-top: var(--space-3);
  }

  .capabilities__card-list li,
  .capabilities__card-text {
    font-size: var(--fs-small);
  }
}

/* ---- Mobile (<= 480px) ---- */
@media (max-width: 480px) {
  .capabilities__tags {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .capabilities__tag {
    padding: var(--space-3);
  }
}
