/* =====================================
   CAPABILITIES PAGE — CLEAN INDUSTRIAL
   MOBILE FIXES INCLUDED:
   1) Mobile overrides remove desktop min-heights (prevents huge tiles)
   2) Mobile tiles use consistent media ratio + tighter typography
   3) Mobile icon banner more compact + readable
===================================== */

:root {
  --brand-orange: #EF7A18;

  --content-max: 1680px;
  --side-gutter: clamp(24px, 5vw, 120px);

  --banner-grey: #F2F2F2;
}

/* ============================
   PAGE BASE
============================ */

.capabilities-page {
  background: #ffffff;
  color: #111;
  width: 100%;
  overflow-x: hidden;
  font-family: 'Poppins', sans-serif;
}

/* ============================
   HERO
============================ */

.cap-hero {
  position: relative;
  min-height: 600px;
  display: grid;
  place-items: center;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
}

.cap-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.cap-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  padding: 56px 24px;
  text-align: center;
  color: #fff;
}

.cap-hero-inner h1 {
  font-size: 60px;
  margin-bottom: 10px;
}

.cap-hero-inner p {
  font-size: 21px;
  line-height: 1.8;
}

/* ============================
   TOP CAPABILITY ICON BANNER (NAV)
============================ */

.capability-banner {
  background: var(--banner-grey);
  padding: 90px 0;
}

.capability-banner-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-gutter);
}

/* GRID */
.capability-icons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px;
  align-items: start;
  text-align: center;
}

/* ITEM */
.capability-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.capability-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin-bottom: 14px;
}

.capability-item span {
  display: block;
  min-height: 40px;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(0,0,0,0.8);
  text-align: center;
}

.capability-item:hover span {
  color: var(--brand-orange);
}

/* ============================
   MAIN CONTAINER
============================ */

.capabilities-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 120px var(--side-gutter) 100px;
}

/* ============================
   GRID
============================ */

.cap-highlights {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 15px;
  align-items: stretch;
}

.cap-highlights > .cap-tile {
  align-self: stretch;
}

.cap-tile--r1a { grid-column: 1 / span 6; }
.cap-tile--r1b { grid-column: 7 / span 6; }
.cap-tile--center { grid-column: 1 / -1; }
.cap-tile--r3a { grid-column: 1 / span 4; }
.cap-tile--r3b { grid-column: 5 / span 4; }
.cap-tile--r3c { grid-column: 9 / span 4; }

/* ============================
   TILE
============================ */

.cap-tile {
  scroll-margin-top: 90px; /* slightly safer with sticky header */
  display: flex;
  flex-direction: column;
  background: #ffffff;
  height: 100%;
}

.cap-tile-media {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  flex: 0 0 auto;
}

.cap-tile--r1a .cap-tile-media,
.cap-tile--r1b .cap-tile-media {
  aspect-ratio: 16 / 9;
  min-height: 340px;
}

.cap-tile--center .cap-tile-media {
  aspect-ratio: 21 / 9;
  min-height: 420px;
}

.cap-tile--r3a .cap-tile-media,
.cap-tile--r3b .cap-tile-media,
.cap-tile--r3c .cap-tile-media {
  aspect-ratio: 4 / 3;
  min-height: 280px;
}

/* Background-image layer */
.cap-tile-bg {
  position: absolute;
  inset: 0;
  background-image: var(--tile-image);
  background-size: cover;
  background-position: center;
  transition: transform 320ms ease;
}

/* If any tile uses an <img> inside .cap-tile-media */
.cap-tile-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms ease;
}

/* Hover zoom */
.cap-tile:hover .cap-tile-bg { transform: scale(1.06); }
.cap-tile:hover .cap-tile-media img { transform: scale(1.06); }

/* ============================
   TEXT PANEL
============================ */

.cap-tile-body {
  padding: 20px 22px 24px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);

  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.cap-tile-body h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.cap-tile-body p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

/* ============================
   CTA
============================ */

.capabilities-cta {
  text-align: center;
  margin-top: 150px;
  margin-bottom: 90px;
}

.capabilities-btn {
  display: inline-block;
  padding: 16px 44px;
  background: #111;
  color: #fff;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

/* =========================
   BOTTOM LOGO BANNER
========================= */

.capability-banner--bottom {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  background: var(--banner-grey);
  padding: 36px 0 28px;
  margin-top: 0;
  margin-bottom: 0;
}

.capability-banner--bottom .capability-banner-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-gutter);
}

.capability-banner--bottom .capability-icons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  grid-template-columns: none;
}

.capability-banner--bottom .capability-icons img {
  width: 264px;
  height: 264px;
  object-fit: contain;
  display: block;
}

/* ============================
   MOBILE ≤ 999px — CLEAN CARDS (PRODUCTS STYLE)
   GOALS:
   1) Top icon banner = 2 rows of 3
   2) All capability tiles consistent (no missing / no narrow)
   3) Card style like screenshot 3:
      - Image on top
      - Text below
      - Same image size for every card
============================ */
@media (max-width: 999px) {

  /* =========================
     HERO
  ========================= */
  .cap-hero { min-height: 360px; }

  .cap-hero-inner { padding: 42px 18px; }

  .cap-hero-inner h1 { font-size: 34px; }

  .cap-hero-inner p { font-size: 15px; line-height: 1.65; }


  /* =========================
     TOP ICON NAV — 2 rows of 3
  ========================= */
  .capability-banner { padding: 44px 0; }

  .capability-icons{
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* 2 rows of 3 */
    gap: 18px;
    align-items: start;
    text-align: center;
  }

  .capability-item img{
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
  }

  .capability-item span{
    min-height: auto;
    font-size: 13.5px;
    line-height: 1.35;
  }


  /* =========================
     MAIN CONTAINER
  ========================= */
  .capabilities-container{
    padding: 44px 18px 70px;
  }


  /* =========================
     GRID → 1 COLUMN
  ========================= */
  .cap-highlights{
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
  }

  /* Ensure ALL tiles span full width on mobile */
  .cap-tile--r1a,
  .cap-tile--r1b,
  .cap-tile--center,
  .cap-tile--r3a,
  .cap-tile--r3b,
  .cap-tile--r3c{
    grid-column: 1 / -1 !important;
  }

  .cap-tile{
    width: 100%;
    justify-self: stretch;
    align-self: stretch;

    /* Products-like card */
    background: var(--banner-grey);
    border-radius: 22px;
    overflow: hidden;

    /* kill desktop effects */
    box-shadow: none;
  }


  /* =========================
     ORDER: IMAGE TOP, TEXT BOTTOM
  ========================= */

  /* Make sure media is first */
  .cap-tile-media{ order: 1; }
  .cap-tile-body{ order: 2; }

  /* Make all images same size */
  .cap-tile--r1a .cap-tile-media,
  .cap-tile--r1b .cap-tile-media,
  .cap-tile--center .cap-tile-media,
  .cap-tile--r3a .cap-tile-media,
  .cap-tile--r3b .cap-tile-media,
  .cap-tile--r3c .cap-tile-media{
    aspect-ratio: 16 / 10 !important;
    min-height: 0 !important;        /* overrides desktop min-heights */
    width: 100% !important;
  }

  .cap-tile-media{
    position: relative;
    overflow: hidden;

    /* keep image flush to card edges like your products style */
    border-radius: 0;
    background: #fff;
  }

  /* image layer fills consistently */
  .cap-tile-bg,
  .cap-tile-media img{
    transform: none !important;      /* disable hover zoom effects */
  }


  /* =========================
     TEXT AREA (below image)
  ========================= */
  .cap-tile-body{
    background: transparent !important;
    box-shadow: none !important;

    padding: 16px 16px 18px;
    display: block;
  }

  .cap-tile-body h3{
    font-size: 15px;
    margin: 0 0 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .cap-tile-body p{
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;

    /* Remove the clamp so nothing "disappears" */
    display: block;
    overflow: visible;
  }


  /* =========================
     CTA
  ========================= */
  .capabilities-cta{
    margin-top: 70px;
    margin-bottom: 40px;
  }

  .capabilities-btn{
    padding: 14px 34px;
    font-size: 13px;
  }


  /* =========================
     BOTTOM CERT LOGOS — 2 rows of 3
  ========================= */
  .capability-banner--bottom{
    padding: 22px 0 18px;
  }

  .capability-banner--bottom .capability-icons{
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;  /* 2 rows of 3 */
    gap: 14px;
    justify-items: center;
    align-items: center;
  }

  .capability-banner--bottom .capability-icons img{
    width: 120px;
    height: 120px;
    object-fit: contain;
  }
}
