/* ============================================================
   Section: Published Works (`published`) — brief/published.md
   Figma: desktop 3441:2110 (1440x460) · mobile 3441:1790 (375x726)
   Pattern A: .container on the section (standard --gutter), padding-block only.
   Mobile-first: base = mobile (<768); 768-1023 = pseudo-tablet (desktop-compressed
   split row, D-PUB-1 / split-row rule); 1024+ = desktop.
   ============================================================ */

/* ---------- section-local tokens — MOBILE (base) ---------- */
.published {
  --published-stack-gap: clamp(41px, calc(48px + (var(--max-vw) - 375px) * 0.015), 48px);
  --published-head-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 24px);
  --published-tile-gap: clamp(7px, calc(8px + (var(--max-vw) - 375px) * 0.015), 8px);
  --published-tile-pad: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 14px);
  --published-logo-w: clamp(119px, calc(140px + (var(--max-vw) - 375px) * 0.015), 140px);
  --published-logo-h: clamp(48px, calc(56px + (var(--max-vw) - 375px) * 0.015), 56px);

  padding-block: var(--section-py);
  color: var(--color-text);
}

/* ---------- layout — MOBILE: stack (3441:1791 vertical, gap 48) ---------- */
.published__inner {
  display: flex;
  flex-direction: column;
  gap: var(--published-stack-gap);
}

/* Text column — the doubled Figma wrapper (3441:1792 > 3441:1793) is one element */
.published__text {
  display: flex;
  flex-direction: column;
  gap: var(--published-head-gap);
  text-align: center;                 /* D-PUB-8: mobile CENTER */
}

.published__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: var(--lh-auto);        /* Figma Auto = 1.21 (D-PUB-10), never 100% */
  letter-spacing: 0;
}

.published__lead {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

/* Logo grid — 2 fluid tracks, minmax(0,1fr) MUST-APPLY (D-PUB-2) */
.published__logos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--published-tile-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Tile — white, pad 14, slot centred; wider slot may overflow the padding evenly (D-PUB-3) */
.published__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--published-tile-pad);
  background: var(--color-logo-tile-bg);
  overflow: visible;
}

/* Slot — fixed 140x56, never shrunk, clips its content (Figma clipsContent) */
.published__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--published-logo-w);
  /* may overflow the tile PADDING (Figma: slot x 11.75 in the 163.5 tile), never the tile
     itself: at <=335 the 140-ish slot outgrows the tile (320: tile 137.2, slot 139.2) */
  max-width: calc(100% + 2 * var(--published-tile-pad));
  height: var(--published-logo-h);
  overflow: hidden;
}

/* Logo — width only, natural aspect (preserveAspectRatio="none" → never force a height) */
.published__logo {
  display: block;
  flex: none;
  width: 100%;
  max-width: none;
  height: auto;
}

/* ---------- PSEUDO-TABLET 768-1023 — desktop-compressed split row ---------- */
@media (min-width: 768px) {
  .published {
    /* col-gap continuous with desktop D-min 46 @1024 (34.1 @768 → 45.5 @1023) */
    --published-col-gap: calc(64px * (var(--max-vw) / var(--vw-base)));
    --published-head-gap: clamp(24px, calc(24px + (var(--max-vw) - 768px) * 0.025), 24px);
    --published-tile-gap: clamp(8px, calc(8px + (var(--max-vw) - 768px) * 0.025), 8px);
    --published-tile-pad: clamp(14px, calc(14px + (var(--max-vw) - 768px) * 0.025), 14px);
    --published-logo-w: clamp(140px, calc(140px + (var(--max-vw) - 768px) * 0.025), 140px);
    --published-logo-h: clamp(56px, calc(56px + (var(--max-vw) - 768px) * 0.025), 56px);
  }

  .published__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--published-col-gap);
    align-items: center;               /* D-PUB-7: 3441:2111 counterAxisAlignItems CENTER */
  }

  .published__text {
    text-align: left;                  /* D-PUB-8: desktop LEFT */
  }
}

/* ---------- DESKTOP 1024+ (3441:2110: 568 / 64 / 568, tiles 280x84) ---------- */
@media (min-width: 1024px) {
  .published {
    --published-col-gap: clamp(46px, calc(64px * (var(--max-vw) / var(--vw-base))), 85px);
    --published-head-gap: clamp(17px, calc(24px * (var(--max-vw) / var(--vw-base))), 32px);
    --published-tile-gap: clamp(6px, calc(8px * (var(--max-vw) / var(--vw-base))), 11px);
    --published-tile-pad: clamp(10px, calc(14px * (var(--max-vw) / var(--vw-base))), 19px);
    --published-logo-w: clamp(100px, calc(140px * (var(--max-vw) / var(--vw-base))), 187px);
    --published-logo-h: clamp(40px, calc(56px * (var(--max-vw) / var(--vw-base))), 75px);
  }
}
