/* =========================================================================
 * Publications (page 1781, /publications/), rulebook P-21.
 * RS reference: clone:src/app/journals/page.tsx ("Our journals",
 * RSC/shared/CardList.tsx layout "vertical", Card heading "journal").
 *
 * Shared parts do the rest: light hero + breadcrumb, "Three ways to explore"
 * as the section nav panel (components.css section 4a), the text card look on
 * .eam-tier-card (components.css section 5), buttons (forms.css).
 * This file only sets the card list geometry for this page.
 *
 * Structure (scripts/redesign/pages/01781-publications.mjs): the three card
 * titles are H2 (were H3 under the H1, D-19). Their size stays the RS card
 * title (24 / 18) from components.css.
 * ========================================================================= */

/* RS CardList "vertical": 3 per row with 16px gaps, so the cards are 428px
 * wide in the 1316 column at 1440 (RS card max width). Overrides the block's
 * own 28px gutter (Kadence inline CSS) and the 32px it computes to. */
body.eam-redesign.page-id-1781 .kb-row-layout-id1781_cards01-aa > .kt-row-column-wrap {
  column-gap: var(--rd-grid-gap);
  row-gap: var(--rd-space-s);
}

/* RS keeps 3 per row down to 821px (CardList.tsx: 2 per row from md down).
 * components.css switches card rows to 2 per row at <= 1080, and
 * eam-site-polish.css:820-831 to 1 per row at <= 1024: with exactly three
 * cards both leave one card alone on the last row. Keep 3 here. */
@media (max-width: 1080px) {
  body.eam-redesign.page-id-1781 .kb-row-layout-id1781_cards01-aa > .kt-row-column-wrap.kt-has-3-columns:has(> .wp-block-kadence-column.eam-tier-card) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* RS card body padding is 16px; the narrower cards need the room. */
  body.eam-redesign.page-id-1781 .kb-row-layout-id1781_cards01-aa .wp-block-kadence-column.eam-tier-card > .kt-inside-inner-col {
    padding: var(--rd-space-s);
  }
}

/* <= 820: one card per row. Three cards in 2 columns leave a hole, and
 * Kadence's equal rows (minmax(0, 1fr)) would stretch short cards to the
 * tallest; let each card take its own height. */
@media (max-width: 820px) {
  body.eam-redesign.page-id-1781 .kb-row-layout-id1781_cards01-aa > .kt-row-column-wrap.kt-has-3-columns:has(> .wp-block-kadence-column.eam-tier-card) {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }
}
