/*
 * EAM redesign: Networking & Collaborations (page 1784, /activities/networking-collaborations/).
 * Rulebook P-24 (R-08, R-09, R-44, R-45, X-02, X-23, C-05).
 *
 * RS: clone:src/app/journals/page.tsx: light hero, a section H2 over its list, then the
 * FeaturedContent "medium" pair (RSC/journals-46dc41f5/FeaturedContent.tsx: two equal panels,
 * 487px tall, text block max 540px, 40/28 title, lead text, primary button), then a closing
 * ListingHeader-style CTA. EAM has logos, not photos, so each panel is a tint panel with a white
 * logo well on top (the MAST hero card pattern, pages/mast.css section 2) instead of a photo.
 *
 * Page layout only. Everything else comes from the shared files:
 *   1784_hero01-aa     light tint hero, breadcrumb Home / Activities / Networking & Collaborations,
 *                      eyebrow, H1, lead, "Our networks" fact list -> indigo hero card (components.css)
 *   1784_intro01-aa    "Networks & partnerships" H2 + intro text: BlogSection, 48px under the hero
 *   1784_grid01-aa     MAST + ECPS: the featured pair (section 3 below). Logos, the H2 text and the
 *                      em dash fixes come from scripts/redesign/pages/01784-networking-collaborations.mjs
 *   1784_cta01-aa      "Want to get involved?": shared closing CTA band (components.css `_cta01-`)
 *
 * The three rows after the hero carry an explicit white background (.kt-row-has-bg), so base.css
 * cannot collapse their paddings (48 + 48 = 96px). Section 1 sets the gaps by uniqueID; an editor who
 * adds the class rd-keep-spacing to a row gets the original spacing back.
 */

/* RS FeaturedContent "medium" sizes (FeaturedContent.tsx: min-h 487px, text max-w 540px) and the
 * logo well (logo 160px wide as saved in the block, 136px tall at most on phones). */
body.eam-redesign.page-id-1784 {
  --nc-panel-min-h: 487px;
  --nc-text-max: 540px;
  --nc-well-h: 224px;
  --nc-well-h-sm: 184px;
  --nc-logo-max-h: 160px;
  --nc-logo-max-h-sm: 136px;
}

/* 1. Rhythm ------------------------------------------------------------------------------- */

/* Intro: 48px under the hero (row padding-top stays); the pair follows the intro text closely. */
body.eam-redesign .kb-row-layout-id1784_intro01-aa:not(.rd-keep-spacing) > .kt-row-column-wrap {
  padding-bottom: 0;
}

/* The pair belongs to the "Networks & partnerships" section: 40px under the intro text (24px <= 820). */
body.eam-redesign .kb-row-layout-id1784_grid01-aa:not(.rd-keep-spacing) > .kt-row-column-wrap {
  padding-top: var(--rd-space-l);
}

/* Pair -> CTA band: one section space (the pair row keeps its 48px bottom padding). */
body.eam-redesign .kb-row-layout-id1784_cta01-aa:not(.rd-keep-spacing) > .kt-row-column-wrap {
  padding-top: 0;
}

/* 2. Intro text: RS ink instead of Kadence palette4 (#2b2b2b, not remapped on purpose, DESIGN-SYSTEM 9;
 * .has-theme-palette-4-color is !important, so the preset is repointed on this page's content, as on
 * workshops.css and summer-schools.css), 18px on the article measure. */
body.eam-redesign.page-id-1784 .entry-content {
  --wp--preset--color--theme-palette-4: var(--rd-color-text);
}

body.eam-redesign .wp-block-kadence-advancedheading.kt-adv-heading1784_intro04-dd[data-kb-block] {
  max-width: var(--rd-measure);
  font-size: var(--rd-fs-body); /* 16px like the intros on Workshops, ECPS, Grants (design-b#9) */
  line-height: var(--rd-lh-body);
}

/* 3. MAST + ECPS: the featured pair --------------------------------------------------------- */

/* Two equal panels, 16px apart (RS grid gap), equal height. Overrides the block's 28px gutter. */
body.eam-redesign .kb-row-layout-id1784_grid01-aa > .kt-row-column-wrap {
  column-gap: var(--rd-grid-gap);
  row-gap: var(--rd-grid-gap);
}

/* The panel: tint fill with the shared hairline frame, no card shadow (the shared .eam-tier-card
 * look is a white card with a shadow), no hover lift or hover shadow (the panel is not a link;
 * its button is). */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .wp-block-kadence-column.eam-tier-card:is(.kadence-column1784_card1a-aa, .kadence-column1784_card2a-aa) {
  transform: none;
}

body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .wp-block-kadence-column.eam-tier-card:is(.kadence-column1784_card1a-aa, .kadence-column1784_card2a-aa) > .kt-inside-inner-col {
  min-height: var(--nc-panel-min-h);
  padding: 0 0 var(--rd-space-xl);
  border: var(--rd-border-width) solid var(--rd-border-light);
  background: var(--rd-tint);
  box-shadow: none;
}

/* Logo well: white band across the top of the panel, logo centred (RS: the panel's image;
 * the MAST hero card uses the same white well over a hairline, pages/mast.css section 2). */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > figure.wp-block-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--nc-well-h);
  margin: 0 0 var(--rd-space-l);
  padding: var(--rd-space-m);
  border-bottom: var(--rd-border-width) solid var(--rd-border-light);
  background: var(--rd-color-surface);
}

body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > figure.wp-block-image img {
  max-height: var(--nc-logo-max-h);
  object-fit: contain;
}

/* Text block: RS panel text column, 60px side padding, max 540px wide. */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > :not(figure) {
  max-width: calc(var(--nc-text-max) + 2 * var(--rd-space-xl));
  padding-inline: var(--rd-space-xl);
}

/* Title: the card title size used on the sibling pages (Grants, Publications):
 * h4 scale, 24 / 18 (design-b#9; was the h3 scale, 32 / 24). */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card .wp-block-kadence-advancedheading:is(h3)[data-kb-block] {
  margin: var(--rd-space-2xs) 0 var(--rd-space-xs);
  font-size: var(--rd-fs-h4);
  line-height: var(--rd-lh-h4);
}

/* Text: body size like the sibling cards (16/24), ink. */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card p.wp-block-kadence-advancedheading[data-kb-block] {
  margin: 0;
  font-size: var(--rd-fs-body);
  line-height: var(--rd-lh-body);
}

/* Button pinned to the panel bottom (equal heights; components.css pins it, this sets the gap). */
body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > .wp-block-kadence-advancedbtn {
  padding-top: var(--rd-space-m);
}

@media (max-width: 1080px) {
  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > :not(figure) {
    padding-inline: var(--rd-space-m);
  }

  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .wp-block-kadence-column.eam-tier-card:is(.kadence-column1784_card1a-aa, .kadence-column1784_card2a-aa) > .kt-inside-inner-col {
    min-height: 0;
    padding-bottom: var(--rd-space-m);
  }
}

@media (max-width: 820px) {
  body.eam-redesign .kb-row-layout-id1784_grid01-aa:not(.rd-keep-spacing) > .kt-row-column-wrap {
    padding-top: var(--rd-space-base);
  }

  /* RS stacks the medium pair at <= 820px (FeaturedContent.tsx max-md:block); Kadence would keep
   * two 296px columns down to 767px. Each panel takes its own height once stacked. */
  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa > .kt-row-column-wrap.kt-has-2-columns {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > figure.wp-block-image {
    height: var(--nc-well-h-sm);
    margin-bottom: var(--rd-space-base);
    padding: var(--rd-space-base);
  }

  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > figure.wp-block-image img {
    max-height: var(--nc-logo-max-h-sm);
  }
}

@media (max-width: 480px) {
  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .eam-tier-card > .kt-inside-inner-col > :not(figure) {
    padding-inline: var(--rd-space-base);
  }

  body.eam-redesign.page-id-1784 .kb-row-layout-id1784_grid01-aa .wp-block-kadence-column.eam-tier-card:is(.kadence-column1784_card1a-aa, .kadence-column1784_card2a-aa) > .kt-inside-inner-col {
    padding-bottom: var(--rd-space-base);
  }
}
