/* ─────────────────────────────────────────────────────────────
   CAREERS IMAGE TILES — prefix: cit-

   Structure only. Every editor-driven value arrives as a --cit-*
   custom property set by the scoped <style> block in module.html.
   Nothing here reads a module field, so this file declares real
   properties and owns the breakpoints outright.

   Layout: full-bleed section, 1440px inner, 48px gutter,
   3 → 2 → 1 columns, 14px card radius, a two-layer shadow, a hover
   lift and a 1.07 thumbnail zoom.

   The `cit-` prefix is deliberate: home-resources owns `hr-*`, and
   two modules sharing a prefix means whichever module.css loads
   second wins every shared selector.

   Nothing in this module is a link, so the card carries no
   `cursor: pointer`.

   Font families are brand-locked, never editable:
   Akzidenz-Grotesk for the section title and card titles,
   Brandon Grotesque for eyebrow labels and descriptions.
   ───────────────────────────────────────────────────────────── */

.cit-section {
  --cit-heading-font: 'akzidenz-grotesk', 'Akzidenz-Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --cit-body-font:    'brandon-grotesque', 'Brandon Grotesque', 'Helvetica Neue', Arial, sans-serif;

  /* Colour/size defaults, overridden per instance via scope_css. */
  --cit-bg:          #f7f7f7;
  --cit-max-w:       1440px;
  --cit-pt:          80px;
  --cit-pr:          48px;
  --cit-pb:          72px;
  --cit-pl:          48px;
  --cit-mt:          0;
  --cit-mb:          0;
  --cit-t-color:     #111827;
  --cit-t-accent:    #5a3aaa;
  --cit-t-grad:      linear-gradient(to bottom right, #211f2e 0%, #5a3aaa 50%, #8957cf 100%);
  --cit-t-gap:       48px;
  --cit-t-size:      42px;
  --cit-card-bg:     #ffffff;
  --cit-card-radius: 14px;
  --cit-card-gap:    28px;
  --cit-columns:     3;
  --cit-grid-gap:    52px;
  --cit-lb-color:    #3a2e7b;
  --cit-lb-size:     12px;
  --cit-icon:        24px;
  --cit-ct-color:    #111827;
  --cit-ct-size:     20px;
  --cit-cd-color:    #6b7280;
  --cit-cd-size:     15px;
}

/* ── Section: full-bleed breakout ── */
.cit-section {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  margin-top: var(--cit-mt);
  margin-bottom: var(--cit-mb);
  padding: var(--cit-pt) 0 var(--cit-pb);
  overflow: hidden;
  background-color: var(--cit-bg);
  font-family: var(--cit-body-font);
}

.cit-section,
.cit-section *,
.cit-section *::before,
.cit-section *::after {
  box-sizing: border-box;
}

.cit-inner {
  max-width: min(var(--cit-max-w), 100%);
  margin: 0 auto;
  padding-left: var(--cit-pl);
  padding-right: var(--cit-pr);
  text-align: center;
}

/* ── Rich text normalisation ──
   HubSpot wraps field output in <p>/<h*>. Inline contexts collapse those and
   inherit type, so a stray <h2> an editor applied inside a card title cannot
   resize the card. */
.cit-rt > * {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.cit-rt > * + *::before {
  content: ' ';
}

/* ── Section title ── */
.cit-title {
  font-family: var(--cit-heading-font);
/* 700, matching .ss-title in services-section - the two sections sit on the
     same page and the headings have to read as one family. Akzidenz-Grotesk
     ships 300/400/700/900, so anything heavier rounds up to Black. */
  font-weight: 700;
  font-size: var(--cit-t-size);
  color: var(--cit-t-color);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 var(--cit-t-gap);
  padding: 0;
  text-wrap: balance;
}

.cit-title__plain,
.cit-title__accent {
  display: inline;
}

/* Solid colour first, and it stays the computed `color` — only the paint is
   replaced. In forced-colors mode, in print, or anywhere background-clip: text
   is not honoured, the accent words must still be readable rather than
   vanishing into transparent fill, and a contrast checker reading `color` sees
   a real value instead of `transparent`. */
.cit-title__accent {
  color: var(--cit-t-accent);
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .cit-title__accent {
    background-image: var(--cit-t-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@media (forced-colors: active) {
  .cit-title__accent {
    background-image: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
}

/* ── Cards grid ── */
.cit-grid {
  list-style: none;
  margin: 0 0 var(--cit-grid-gap);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cit-columns), minmax(0, 1fr));
  gap: var(--cit-card-gap);
  text-align: left;
}

/* ── Individual card ── */
.cit-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--cit-card-bg);
  border-radius: var(--cit-card-radius);
  overflow: hidden;
  color: inherit;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cit-card:hover {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.06),
    0 16px 40px rgba(58, 46, 123, 0.12);
  transform: translateY(-3px);
}

/* ── Thumbnail ──
   aspect-ratio reserves the box before the image decodes, so the grid never
   reflows around it (CLS). */
.cit-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #e5e7eb;
  flex-shrink: 0;
}

.cit-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cit-card:hover .cit-card__thumb img {
  transform: scale(1.07);
}

/* ── Card body ── */
.cit-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 28px 28px;
}

/* ── Icon + eyebrow label row ── */
.cit-card__label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cit-card__icon {
  flex-shrink: 0;
  display: block;
  width: var(--cit-icon);
  height: var(--cit-icon);
}

.cit-card__label {
  font-family: var(--cit-body-font);
  font-weight: 600;
  font-size: var(--cit-lb-size);
  color: var(--cit-lb-color);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* ── Card title ── */
.cit-card__title {
  font-family: var(--cit-heading-font);
  font-weight: 700;
  font-size: var(--cit-ct-size);
  color: var(--cit-ct-color);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  padding: 0;
}

/* ── Card description ── */
.cit-card__desc {
  font-family: var(--cit-body-font);
  font-weight: 400;
  font-size: var(--cit-cd-size);
  color: var(--cit-cd-color);
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

/* ── Keyboard focus ──
   Nothing in this module is interactive today, but an editor can put a link
   inside a rich-text field, and the theme provides no global focus ring. */
.cit-section :where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--cit-t-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Clears the fixed header when Tab scrolls a link into view. */
.cit-section a {
  scroll-margin-top: 96px;
}

/* ─────────────────────────────────────────
   TABLET  641px – 1024px  →  2-column grid
───────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 1024px) {
  .cit-section {
    padding-top: min(var(--cit-pt), 64px);
    padding-bottom: min(var(--cit-pb), 56px);
    --cit-pl: 32px;
    --cit-pr: 32px;
  }

  .cit-title {
    margin-bottom: min(var(--cit-t-gap), 40px);
  }

  .cit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--cit-card-gap) * 0.72);
    margin-bottom: min(var(--cit-grid-gap), 40px);
  }

  .cit-card__body {
    padding: 20px 24px 24px;
  }
}

/* ─────────────────────────────────────────
   MOBILE  ≤ 640px  →  1-column grid
───────────────────────────────────────── */
@media (max-width: 640px) {
  .cit-section {
    padding-top: min(var(--cit-pt), 52px);
    padding-bottom: min(var(--cit-pb), 44px);
    --cit-pl: 16px;
    --cit-pr: 16px;
  }

  .cit-title {
    margin-bottom: min(var(--cit-t-gap), 32px);
  }

  .cit-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(var(--cit-card-gap) * 0.72);
    margin-bottom: min(var(--cit-grid-gap), 36px);
  }

  /* Was 18px 20px 22px, which crowded the text against the card edge once the
     type stopped being shrunk to ~14px. */
  .cit-card__body {
    padding: 20px 20px 24px;
  }
}

/* ─────────────────────────────────────────
   REDUCE MOTION
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cit-card,
  .cit-card__thumb img {
    transition: none;
  }

  .cit-card:hover {
    transform: none;
  }

  .cit-card:hover .cit-card__thumb img {
    transform: none;
  }
}
