/* ==========================================================================
   Page hero — the tall, dark, image-backed header.

   Was assets/css/pages/page-expertise-single.css until 2026-10-09. The
   Expertise post type it was first built for is gone; the file stayed because
   .case-hero-x BUILDS ON .expertise-hero, so every case and every Always On
   page draws its hero from here. Renamed for what it does rather than the page
   type it happened to be written for — the old name read like dead weight.

   The .expertise-* class names are kept on purpose: renaming them too would
   touch markup, case-content.css and page-ifk.css for no behavioural gain.

   Reuses tokens, .container, .glass-card, .btn, .case-card / .large-link.
   ========================================================================== */

/* ── Hero ────────────────────────────────────────────────────────────────── */
.expertise-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  max-height: 1024px;
  overflow: hidden;
  background-color: var(--bg-dark);
}

/* Dark gradient at the bottom so the white text stays readable over the image */
.expertise-hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.expertise-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-top: calc(var(--header-h) + 40px);
  /* 32 on desktop AND tablet (Kajsa 2026-10-12). It was
     var(--margin-primary), which resolves to 60 at both of those widths and
     16 on phone - so the two that shared a value still share one, and the
     phone keeps its own 16 in the block further down. Deliberately not a
     token: no step in the scale is 32, and inventing one for a single edge
     would be worse than naming the number here. */
  padding-bottom: 32px;
}

.expertise-hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Glass pill — e.g. "Industrial" (liquid-glass via .glass-card + --fx-filter) */
.expertise-hero__pill {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--radius-btn);   /* match the button next to it */
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  font-size: var(--body-lg);
  line-height: 34px;
  font-weight: 500;
  white-space: nowrap;
}

.expertise-hero__title {
  margin: 0;
  max-width: 1000px;
  font-size: var(--title-xl);
  line-height: var(--title-xl-lh);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-light);
}

/* ── Content sections wrapper ────────────────────────────────────────────── */
.expertise-sections {
  display: flex;
  flex-direction: column;
}

/* ── Text-grid: heading top-left, body bottom-right ──────────────────────── */
.expertise-text {
  padding-block: var(--space-100);
}
/* The shell's own .container carries --margin-primary as padding-BOTTOM (60px
   desktop / 16 mobile), and that stacked on top of .expertise-text's padding,
   so the gap under the body ran 160 where Figma asks for 100. The section owns
   the vertical rhythm here; the container is only the horizontal gutter. Same
   trap as .ifk-media > .container and .case-media > .container, both already
   zeroed for exactly this reason. */
.expertise-text > .container { padding-bottom: 0; }
/* The shell hosts the shared text widget (.text-grid, components/text-widget.css)
   and owns the vertical padding, so the widget's trailing space is zeroed.
   Everything here is a variable flip — the widget keeps its internals. */
.expertise-text .text-grid {
  --tw-row-gap: var(--space-100);     /* wider heading -> body gap in these sections */
  --tw-pad-bottom: 0;
  --tw-para-gap: 1em;      /* follows the body size: 24/24/20 (lg), 20/20/18 (md) */
}

/* ── Image grid (asymmetric: tall left, two small right) ─────────────────── */
.expertise-grid__inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 390px;
  gap: 20px;
}
.expertise-grid__item {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-image);
  background-color: #c4c4c4;
}
.expertise-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.expertise-grid__item--tall { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.expertise-grid__item--tr   { grid-column: 4;          grid-row: 1; }
.expertise-grid__item--br   { grid-column: 3;          grid-row: 2; }

/* ── Full-width video / media ────────────────────────────────────────────── */
.expertise-video__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-image);
  aspect-ratio: 1340 / 754;
  background-color: #c4c4c4;
}
.expertise-video__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Selected work ───────────────────────────────────────────────────────── */
.expertise-work {
  background-color: var(--bg-white);
  padding-block: var(--space-100) var(--space-60);
  margin-top: var(--space-100);
}
.expertise-work__head {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: var(--space-60);
}
.expertise-work__heading {
  grid-column: 1 / span 2;
  margin: 0;
  font-size: var(--title-md);
  line-height: var(--title-md-lh);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-title);
}
.expertise-work__intro {
  grid-column: 3 / span 2;
  margin: 0;
  align-self: center;
  font-size: var(--body-lg);
  line-height: var(--body-lg-lh);
  letter-spacing: -0.01em;
  color: var(--text-title);
}
.expertise-work__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ── Tablet ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .expertise-text { padding-block: 72px; }
  /* Body widening for this band: see the (min-width: 768px) block below. */
  .expertise-grid__inner { grid-auto-rows: 300px; }
  .expertise-grid__item--tall { grid-row: 1 / span 2; }
  .expertise-work__heading,
  .expertise-work__intro { grid-column: 1 / span 4; }
}

/* Tablet only — the body widens to columns 2–4 (the desktop right-half gets
   too narrow below 1024px). min-width keeps it out of the widget's mobile
   full-width rule. */
@media (min-width: 768px) and (max-width: 1024px) {
  .expertise-text .text-grid { --tw-body-col: 2 / -1; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Figma's 375:574 phone hero (tokens.css), not the whole screen. Also has to
     beat the base rule's min-height: 100vh, and the base max-height: 1024px is
     switched off so the ratio is what decides. Covers the case heroes too
     (.case-hero-x extends .expertise-hero). */
  .expertise-hero { min-height: var(--hero-h); max-height: none; }

  .expertise-hero__inner {
    gap: 16px;
    /* The 16 that var(--margin-primary) used to resolve to here, written out
       now that the base rule names 32 instead. Phone is unchanged. */
    padding-bottom: 16px;
  }

  /* .expertise-hero__title { font-size: var(--title-xl); line-height: var(--title-xl-lh); } */
  /* .expertise-hero__pill { font-size: var(--body-md); } */
      .case-hero-x__tag{
        font-weight: 400;
      }

  .expertise-text { padding-block: 40px; }
  /* Full width comes from the widget itself; this context only tightens the
     heading -> body gap to the Figma mobile spec (40px). */
  .expertise-text .text-grid { --tw-row-gap: 40px; }

  .expertise-grid__inner {
    display: flex;
    flex-direction: column;
    grid-auto-rows: auto;
  }
  .expertise-grid__item { height: auto; aspect-ratio: 4 / 3; }
  .expertise-grid__item--tall { aspect-ratio: 3 / 4; }

  .expertise-work { padding-block: 56px 40px; margin-top: 56px; }
  .expertise-work__head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
  .expertise-work__grid { grid-template-columns: 1fr; }
}
