/*
 * EAM redesign: ECPS (page 1785, /activities/ecps/). Rulebook P-25 (R-44, C-18).
 *
 * Owner: page track "ecps". Loaded by includes/redesign.php on this page only, after the
 * shared files, while the redesign switch is on. Layout only; the wording on live is not
 * changed. One structure change in scripts/redesign/pages/01785-ecps.mjs: the ECPS logo
 * image block moved from the top of the Intro row into the hero card (logo in the hero aside).
 *
 * RS model: clone:src/app/about-us/who-we-are/mission-priorities/page.tsx (light hero with
 * breadcrumb, H1 and lead; RSC/shared/BlogArticle.tsx BlogSection: text in columns 1-7) and
 * RSC/shared/HeroAside.tsx HeroCard (image well on top, primary text block below), the same
 * card shape as the MAST page (pages/mast.css section 2).
 *
 * Markup (live export local/live-pulls/01785-ecps/content.wp.html):
 *   1785_hero01-aa     hero: auto breadcrumb, eyebrow, H1 "ECPS", lede; card column
 *                      1785_herocol2-ff = logo (after the patch) + "About the partnership" list
 *   1785_intro01-aa    one column 1785_intro02-bb: "What is ECPS?" + 2 paragraphs,
 *                      "EAM's role" + 1 paragraph
 *   1785_back01-aa     one paragraph linking back to Networking & Collaborations
 *   1785_cta01-aa      closing "Learn more" band (shared CTA band, components.css)
 *
 * Shared rules met here: components.css section 4 (hero band, indigo hero card with 24px
 * padding), base.css section rhythm (0,2,1) and photo radius; Kadence per-block margins
 * (0,3,0) on the advanced headings. Old rules that keep loading: eam-site-polish.css:678-700
 * (CTA button look, overridden by forms.css).
 */

/* =========================================================================
 * 1. Hero card: RS HeroCard. The logo sits in a white well across the top
 *    of the indigo card (bleeds over the card's 24px padding); the
 *    "About the partnership" list stays in the indigo text block below.
 *    Only applies while the logo is the card's first block.
 * ========================================================================= */

body.eam-redesign.page-id-1785 .kadence-column1785_herocol2-ff > .kt-inside-inner-col > figure.wp-block-image:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 184px;            /* same well as the MAST hero card (pages/mast.css) */
  margin: calc(var(--rd-space-base) * -1) calc(var(--rd-space-base) * -1) var(--rd-space-base);
  padding: var(--rd-space-xs);
  background: var(--rd-color-surface);
}

body.eam-redesign.page-id-1785 .kadence-column1785_herocol2-ff > .kt-inside-inner-col > figure.wp-block-image:first-child > a {
  display: block;
  line-height: 0;
}

/* The block keeps its own 160px width (inline style from the editor). */
body.eam-redesign.page-id-1785 .kadence-column1785_herocol2-ff > .kt-inside-inner-col > figure.wp-block-image:first-child img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* The list keeps Kadence's 24px bottom margin on top of the card's 24px
 * padding; the RS card ends 24px under its last line. */
body.eam-redesign.page-id-1785 .kadence-column1785_herocol2-ff > .kt-inside-inner-col > .wp-block-kadence-iconlist:last-child {
  margin-bottom: 0;
}

body.eam-redesign.page-id-1785 .wp-block-kadence-column.kadence-column1785_herocol2-ff .kt-svg-icon-list > li.kt-svg-icon-list-item-wrap:last-child {
  margin-bottom: 0;
}

/* =========================================================================
 * 2. Body: RS BlogSection. Text in columns 1-7 (1-9 below desktop), RS
 *    paragraph rhythm (16px), 48px before the next heading.
 * ========================================================================= */

body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa .wp-block-kadence-column.kadence-column1785_intro02-bb,
body.eam-redesign.page-id-1785 .kb-row-layout-id1785_back01-aa .wp-block-kadence-column.kadence-column1785_back02-bb {
  width: 100%;
  max-width: calc((100% - 11 * var(--rd-grid-gap)) / 12 * 7 + 6 * var(--rd-grid-gap));
}

/* Paragraphs: the blocks carry Kadence "md" (32px) bottom margins and an
 * 820px max width; the column now sets the measure. */
body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa p.wp-block-kadence-advancedheading[data-kb-block] {
  max-width: none;
  margin: 0 0 var(--rd-space-s);
}

body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa p.wp-block-kadence-advancedheading[data-kb-block]:last-child {
  margin-bottom: 0;
}

body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa h2.wp-block-kadence-advancedheading[data-kb-block] {
  margin: 0 0 var(--rd-space-s);
}

/* The paragraph's 16px bottom margin collapses into this one, so the gap
 * is this value alone: 48px (40px at 820 and below), as on MAST. */
body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa p + h2.wp-block-kadence-advancedheading[data-kb-block] {
  margin-top: calc(var(--rd-space-m) + var(--rd-space-s));
}

/* =========================================================================
 * 3. Back link: the closing line of the article (hairline above), not a
 *    section of its own. Both rows have an explicit white background, so
 *    base.css would keep 96px between them (DESIGN-SYSTEM.md 10a).
 * ========================================================================= */

body.eam-redesign.page-id-1785 .entry-content > .kb-row-layout-wrap.kb-row-layout-id1785_back01-aa > .kt-row-column-wrap {
  padding-top: 0;
  padding-bottom: 0;
}

body.eam-redesign.page-id-1785 .kb-row-layout-id1785_back01-aa .wp-block-kadence-column.kadence-column1785_back02-bb > .kt-inside-inner-col {
  padding-top: var(--rd-space-base);
  border-top: var(--rd-border-width) solid var(--rd-border-light);
}

body.eam-redesign.page-id-1785 .kb-row-layout-id1785_back01-aa .kadence-column1785_back02-bb p {
  margin: 0;
  color: var(--rd-color-text-70);
}

/* =========================================================================
 * 4. Tablet and phone
 * ========================================================================= */

@media (max-width: 1080px) {
  body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa .wp-block-kadence-column.kadence-column1785_intro02-bb,
  body.eam-redesign.page-id-1785 .kb-row-layout-id1785_back01-aa .wp-block-kadence-column.kadence-column1785_back02-bb {
    max-width: calc((100% - 11 * var(--rd-grid-gap)) / 12 * 9 + 8 * var(--rd-grid-gap));
  }
}

@media (max-width: 820px) {
  body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa .wp-block-kadence-column.kadence-column1785_intro02-bb,
  body.eam-redesign.page-id-1785 .kb-row-layout-id1785_back01-aa .wp-block-kadence-column.kadence-column1785_back02-bb {
    max-width: none;
  }

  body.eam-redesign.page-id-1785 .kb-row-layout-id1785_intro01-aa p + h2.wp-block-kadence-advancedheading[data-kb-block] {
    margin-top: var(--rd-space-l);
  }
}
