/*
 * EAM redesign: MAST (page 822, /activities/mast/). Rulebook P-16 (R-45, R-46, C-21, X-23).
 *
 * Owner: page track "mast". Loaded by includes/redesign.php on this page only, after the
 * shared files, while the redesign switch is on. Layout only; the board's blocks and text
 * (Sonja's wording of 2026-09-22) are not changed. No patch module: no structure change needed.
 *
 * RS model: clone:src/app/science-events-and-lectures/public/page.tsx (light hero with the
 * featured event card in the aside, RSC/shared/HeroAside.tsx HeroCard + EventMeta) and the
 * summer-science-exhibition page body (RSC/shared/BlogArticle.tsx BlogSection: rich text in
 * columns 1-7, aside in columns 9-12, aside under the text at <= 820px).
 *
 * Markup (live export local/live-pulls/00822-mast/content.wp.html, old unprefixed uniqueIDs):
 *   _mast_banner        hero row: auto breadcrumb, H1 "MAST", H2 subtitle (block-centred)
 *   822_upc01-aa        "MAST logo and next activity": logo column 822_upc02-bb + webinar
 *                       column 822_upc03-cc (H2, meta paragraph, text, buttons 822_upc04-dd)
 *   _mast_intro         one column: Purpose, Our goals (.eam-mast-goals), About MAST,
 *                       Contact & Join MAST, team photo (img.wp-image-1855) with caption
 *   _mast_cta           closing band with the "Member Login" button
 *
 * Older rules met here (they keep loading): eam-site-polish.css:347-371 (full-width banner and
 * CTA rows, left-aligned hero text), :395-400 (goals in two columns, centred caption), :701-779
 * (card buttons, row padding, 72ch text, subtitle size, logo width, team photo crop), the Kadence
 * per-block CSS (0,2,0) to (0,3,0) and base.css section rhythm (0,2,1).
 */

/* =========================================================================
 * 1. Hero: the RS light band (tint, ink text, breadcrumb above the H1).
 *    The block is indigo with centred white text; B-02 and the P-16 note
 *    "left-align (RS)" make it the light band like every other hero.
 * ========================================================================= */

body.eam-redesign.page-id-822 {
  --mast-card-w: 428px;   /* RS HeroCard: the hero aside, columns 9-12 at 1440 */
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_banner {
  background-color: var(--rd-tint);
  background-image: none;
  color: var(--rd-color-text);
  /* The breadcrumb PHP marks it on-dark (indigo block background): ink on the tint. */
  --rd-breadcrumb-color: var(--rd-color-text);
  --rd-hero-fg: var(--rd-color-text);
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_banner > .kt-row-column-wrap {
  padding-top: calc(var(--rd-space-l) * 2);
  padding-bottom: calc(var(--rd-space-l) * 2);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_banner .kadence-column_mast_banner_col > .kt-inside-inner-col {
  align-items: flex-start;
  padding: 0;
  background: none;
}

/* H1 48/40 semibold, left (RS hero title). */
body.eam-redesign.page-id-822 .kb-row-layout-id_mast_banner .wp-block-kadence-advancedheading.kt-adv-heading_mast_heading[data-kb-block] {
  max-width: none;
  margin: 0 0 13px;
  font-family: var(--rd-font);
  font-size: var(--rd-fs-h1);
  font-weight: var(--rd-fw-semibold);
  line-height: var(--rd-lh-h1);
  letter-spacing: var(--rd-ls-heading);
  text-align: left;
  color: var(--rd-color-text);
  animation: rd-fade-up var(--rd-dur-enter) var(--rd-ease-out-cubic) both;
}

/* The subtitle H2 is the hero intro: RS lead 24/1.2 regular. It stays an H2
 * in the markup (board block); only its look changes. */
body.eam-redesign.page-id-822 .kb-row-layout-id_mast_banner .wp-block-kadence-advancedheading.kt-adv-heading_mast_subheading[data-kb-block] {
  max-width: 34em;
  margin: 0;
  font-family: var(--rd-font);
  font-size: var(--rd-fs-lead);
  font-weight: var(--rd-fw-regular);
  line-height: var(--rd-lh-lead);
  letter-spacing: var(--rd-ls-body);
  text-align: left;
  color: var(--rd-color-text);
  opacity: 1;
  animation: rd-fade-up var(--rd-dur-enter) var(--rd-ease-out-cubic) var(--rd-stagger) both;
}

/* =========================================================================
 * 2. Webinar card in the hero aside (RS What's on: featured event card at
 *    the right of the light hero). Only while the "MAST logo and next
 *    activity" row directly follows the hero; if the board moves or removes
 *    it, the page falls back to plain stacked rows.
 *    Desktop: hero row and card row share one grid cell, so the band grows
 *    with the card and the card never covers the text.
 * ========================================================================= */

body.eam-redesign.page-id-822 .entry-content:has(> .kb-row-layout-id_mast_banner + .kb-row-layout-id822_upc01-aa) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-id_mast_banner:has(+ .kb-row-layout-id822_upc01-aa) {
  display: grid;
  grid-row: 1;
  grid-column: 1;
  align-content: start;
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-id_mast_banner:has(+ .kb-row-layout-id822_upc01-aa) > .kt-row-column-wrap {
  width: 100%;
}

/* Hero text keeps clear of the card: columns 1-7 at most. */
body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-id_mast_banner:has(+ .kb-row-layout-id822_upc01-aa) .kadence-column_mast_banner_col {
  max-width: min(calc((100% - 11 * var(--rd-grid-gap)) / 12 * 7 + 6 * var(--rd-grid-gap)), calc(100% - var(--mast-card-w) - var(--rd-space-xl)));
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_banner + .kb-row-layout-wrap.kb-row-layout-id822_upc01-aa {
  position: relative;
  z-index: var(--rd-z-raised);
  grid-row: 1;
  grid-column: 1;
  justify-self: end;
  align-self: end;
  width: var(--mast-card-w);
  margin: calc(var(--rd-space-l) * 2) 0 var(--rd-space-section);
  background: none;
}

/* The card: logo well on top, white text panel below (RS HeroCard order). */
body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id822_upc01-aa > .kt-row-column-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--rd-color-surface);
  box-shadow: var(--rd-shadow-card);
  animation: rd-fade-up var(--rd-dur-enter) var(--rd-ease-out-cubic) calc(var(--rd-stagger) * 2) both;
}

body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa > .kt-row-column-wrap > .wp-block-kadence-column {
  width: 100%;
  min-width: 0;
}

/* Logo well: RS 216px image well, here a white well with a hairline under it. */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc02-bb > .kt-inside-inner-col {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 184px;
  padding: var(--rd-space-base);
  border-bottom: var(--rd-border-width) solid var(--rd-border-light);
}

body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc02-bb figure {
  margin: 0;
}

/* The PNG is 167x158: shown at 136px wide instead of upscaled to 200px.
 * !important undoes eam-site-polish.css:745-747 (width: 200px !important). */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc02-bb img {
  display: block;
  width: 136px !important;
  height: auto;
}

/* Text panel: the block's #eef0f8 background and 14px radius give way to
 * the white card (RS card body: 24px padding). */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .wp-block-kadence-column.kadence-column822_upc03-cc > .kt-inside-inner-col {
  padding: var(--rd-space-base);
  border: 0;
  border-radius: var(--rd-radius);
  background: none;
}

/* Card title: RS card title 24/31.2 semibold (18 at <= 820). */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc h2.wp-block-heading {
  margin: 0 0 11px;
  font-size: var(--rd-fs-h4);
  font-weight: var(--rd-fw-semibold);
  line-height: var(--rd-lh-h4);
  color: var(--rd-color-text);
}

/* Event meta (RS EventMeta): the webinar name bold, then date, time and place. */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc h2.wp-block-heading + p {
  margin: 0 0 var(--rd-space-s);
  font-size: var(--rd-fs-body);
  line-height: var(--rd-lh-body);
  color: var(--rd-color-text-70);
}

body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc h2.wp-block-heading + p strong {
  font-size: var(--rd-fs-large);
  font-weight: var(--rd-fw-bold);
  color: var(--rd-color-text);
}

body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc p {
  max-width: none;
  margin: 0 0 var(--rd-space-base);
}

/* Buttons (look: forms.css) sit on the card's bottom line, left. */
body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .wp-block-kadence-advancedbtn.kb-btns822_upc04-dd {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--rd-space-xs);
  margin: 0;
}

/* =========================================================================
 * 3. Body: RS BlogSection. Text in columns 1-7, the team photo as the aside
 *    in columns 9-12 (sticky under the header), aside under the text at
 *    <= 820px (normal flow, where the photo follows "Contact & Join MAST").
 * ========================================================================= */

/* The row runs full width with its text on the content grid, like the hero
 * and closing band (eam-site-polish.css:355-367), so the text shares their
 * left edge at every width (Kadence's own container padding steps at 767
 * and 480px do not match the gutter). */
body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_intro {
  max-width: none;
  margin-right: calc(50% - var(--global-vw, 100vw) / 2);
  margin-left: calc(50% - var(--global-vw, 100vw) / 2);
}

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_intro > .kt-row-column-wrap {
  box-sizing: border-box;
  max-width: var(--rd-container);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--rd-gutter);
  padding-left: var(--rd-gutter);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--rd-grid-gap);
  row-gap: 0;
  align-items: start;
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > * {
  grid-column: 1 / 8;
  min-width: 0;
  max-width: none;
}

/* The team photo (MAST_members.jpg, block image 1855) as the aside. It spans
 * the text's rows so it can stick while the text scrolls. */
body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > .wp-block-image:has(img.wp-image-1855) {
  position: sticky;
  top: calc(var(--rd-header-offset, var(--rd-header-h)) + var(--rd-space-base));
  grid-column: 9 / 13;
  grid-row: 1 / span 40;
  align-self: start;
  margin: 0;
  transition: top var(--rd-dur-base) var(--rd-ease-out-quad);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .wp-block-image figure:has(> img.wp-image-1855) {
  max-width: none;
  margin: 0;
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .wp-block-image figure:has(> img.wp-image-1855) > figcaption {
  max-width: none;
  margin: var(--rd-space-s) 0 0;
  font-size: var(--rd-fs-small);
  line-height: 1.5;
  text-align: left;
  color: var(--rd-color-text-70);
}

/* Section heads inside the one column: RS 48px between sections. The first
 * H2 opens the row (row padding already gives the space). */
body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > h2 {
  margin-top: var(--rd-space-section);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > h2:first-child {
  margin-top: 0;
}

/* "Our goals": two columns inside the text measure on wide screens. */
body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .eam-mast-goals {
  columns: 2;
  column-gap: var(--rd-space-m);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .eam-mast-goals li {
  break-inside: avoid;
}

/* =========================================================================
 * 4. Closing band: tint, the button on the content's left edge (RS CTA
 *    bands and the other block pages' _cta01 rows are left-aligned).
 * ========================================================================= */

body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_cta > .kt-row-column-wrap {
  padding-top: var(--rd-space-section);
  padding-bottom: var(--rd-space-section);
}

body.eam-redesign.page-id-822 .kb-row-layout-id_mast_cta .wp-block-kadence-advancedbtn.kb-btns_mast_btns {
  justify-content: flex-start;
}

/* =========================================================================
 * 5. Tablet and phone
 * ========================================================================= */

@media (max-width: 1080px) {
  body.eam-redesign.page-id-822 {
    --mast-card-w: 384px;  /* RS HeroCard min width */
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > * {
    grid-column: 1 / 9;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > .wp-block-image:has(img.wp-image-1855) {
    grid-column: 9 / 13;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .eam-mast-goals {
    columns: 1;
  }
}

@media (max-width: 820px) {
  /* Hero: one column, the card under the text inside the band (RS max-md). */
  body.eam-redesign.page-id-822 .entry-content:has(> .kb-row-layout-id_mast_banner + .kb-row-layout-id822_upc01-aa) {
    display: block;
  }

  body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_banner > .kt-row-column-wrap {
    padding-top: calc(var(--rd-space-l) + var(--rd-space-s));
    padding-bottom: var(--rd-space-m);
  }

  body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-id_mast_banner:has(+ .kb-row-layout-id822_upc01-aa) .kadence-column_mast_banner_col {
    max-width: none;
  }

  /* The card row continues the band: full-bleed tint, card on the gutters. */
  body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_banner + .kb-row-layout-wrap.kb-row-layout-id822_upc01-aa {
    width: auto;
    margin: 0 calc(50% - var(--global-vw, 100vw) / 2);
    padding: 0 var(--rd-gutter) var(--rd-space-section);
    background-color: var(--rd-tint);
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc h2.wp-block-heading {
    font-size: var(--rd-fs-h4);
    line-height: var(--rd-lh-h4);
  }

  /* Body: aside under the text, full width. */
  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col {
    display: flex;
    flex-direction: column;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > .wp-block-image:has(img.wp-image-1855) {
    position: static;
    margin-top: var(--rd-space-base);
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .wp-block-image figure:has(> img.wp-image-1855) {
    max-width: 544px;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .eam-mast-goals {
    columns: 2;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc02-bb > .kt-inside-inner-col {
    min-height: 152px;
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id822_upc01-aa .kadence-column822_upc03-cc h2.wp-block-heading + p strong {
    font-size: var(--rd-fs-body);
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > h2 {
    margin-top: var(--rd-space-l);
  }

  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .kadence-column_mast_intro_col > .kt-inside-inner-col > h2:first-child {
    margin-top: 0;
  }

  body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id_mast_cta > .kt-row-column-wrap {
    padding-top: var(--rd-space-l);
    padding-bottom: var(--rd-space-l);
  }
}

@media (max-width: 480px) {
  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_intro .eam-mast-goals {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.eam-redesign.page-id-822 .kb-row-layout-id_mast_banner .wp-block-kadence-advancedheading[data-kb-block],
  body.eam-redesign.page-id-822 .entry-content > .kb-row-layout-wrap.kb-row-layout-id822_upc01-aa > .kt-row-column-wrap {
    animation: none;
  }
}
