/* ==========================================================================
   AI @ CSU System - Design System Layer
   ai.csusystem.edu
   --------------------------------------------------------------------------
   It adds a namespaced layer on top of the existing theme. It does not
   modify the theme, and every class is prefixed .aicsu- so nothing here
   can collide with theme or Elementor styles.

   All colors come from the CSU System Brand Guidelines (04/2020).
   That guide publishes no accessibility chart, so every pairing used here
   was measured against WCAG 2.1 and the ratio is noted inline.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */

:root {

  /* --- Primary palette ---
     Brand hierarchy is Pueblo Blue 60%, CSU Gold 20%, Global Red 20%. */
  --aicsu-blue:         #1F2759;   /* Pueblo Blue */
  --aicsu-gold:         #C7C271;   /* CSU Gold    */
  --aicsu-red:          #AA1E40;   /* Global Red  */
  --aicsu-white:        #FFFFFF;

  /* --- Secondary palette (tints) ---
     Backgrounds only. None of these carry text on white. */
  --aicsu-rose:         #C7A2A5;
  --aicsu-pewter:       #99AFB6;
  --aicsu-light-gold:   #CDC79B;
  --aicsu-blush:        #E5DCDE;
  --aicsu-sky:          #CAD8DC;
  --aicsu-sand:         #DDDBC7;

  /* --- Tertiary palette ---
     Accents, used sparingly. Poppy and Ocean are below 4.5:1 on white,
     so they are keylines and graphics only, never body text. */
  --aicsu-poppy:        #F15647;
  --aicsu-ocean:        #37A0A5;
  --aicsu-slate:        #59595B;

  /* --- Neutrals --- */
  --aicsu-black:        #000000;

  /* Functional neutrals. Not brand colors, used only for hairlines and
     table banding where no brand color applies. */
  --aicsu-rule:         #DCDCDC;
  --aicsu-band:         #F7F7F7;
  --aicsu-surface:      var(--aicsu-white);   /* section fill; tints override */

  /* --- Semantic roles ---
     Ratios are against white unless stated. */
  --aicsu-ink:          var(--aicsu-black);   /* body text,  21.00  AAA */
  --aicsu-ink-muted:    var(--aicsu-slate);   /* meta text,   6.99  AA  */
  --aicsu-heading:      var(--aicsu-blue);    /* headings,   14.07  AAA */
  --aicsu-link:         var(--aicsu-red);     /* links,       7.07  AAA */
  --aicsu-accent:       var(--aicsu-blue);    /* per-territory keyline  */
  --aicsu-focus:        var(--aicsu-red);     /* focus ring,  7.07      */

  /* --- Type scale ---
     Deliberately steep at the top and shallow at the bottom. The old page
     failed because card headings were nearly the size of the page title.
     The brand guide caps a single design at four type sizes and three
     weights; a page uses h1, h2, h3 and body, plus the eyebrow only where
     it replaces a heading. */
  --aicsu-size-h1:      clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);
  --aicsu-size-h2:      clamp(1.625rem, 1.35rem + 1.2vw, 2.25rem);
  --aicsu-size-h3:      clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --aicsu-size-lede:    clamp(1.0625rem, 1rem + 0.4vw, 1.3125rem);
  --aicsu-size-body:    1.0625rem;
  --aicsu-size-small:   0.875rem;
  --aicsu-size-eyebrow: 0.8125rem;

  /* --- Spacing --- */
  --aicsu-space-1: 0.5rem;
  --aicsu-space-2: 1rem;
  --aicsu-space-3: 1.5rem;
  --aicsu-space-4: 2rem;
  --aicsu-space-5: 3rem;
  --aicsu-space-6: 4rem;

  --aicsu-section-y: clamp(3rem, 6vw, 5.5rem);
  --aicsu-max-width: 1180px;
  --aicsu-gutter:    clamp(1.25rem, 4vw, 2.5rem);

  --aicsu-radius: 3px;
}


/* --------------------------------------------------------------------------
   2. SECTIONS
   Vertical rhythm and background. Replaces the <hr> dividers entirely.
   Padding is set once here. Modifiers change color only, never spacing,
   so nothing cancels out.
   -------------------------------------------------------------------------- */

.aicsu-section {
  /* Theme's content wrapper applies its own margin + max-width and ignores
     Gutenberg's "Full width" alignment, so every section is boxed in
     without this. Escapes that wrapper regardless of how deep it is nested. */
  /* !important needed: core .wp-block-group.alignfull (two classes) beats
     our single .aicsu-section class on these three properties otherwise. */
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: 50% !important;
  transform: translateX(-50%);
  padding-top:    var(--aicsu-section-y);
  padding-bottom: var(--aicsu-section-y);
  padding-left:   var(--aicsu-gutter);
  padding-right:  var(--aicsu-gutter);
  color: var(--aicsu-ink);
}

.aicsu-inner {
  max-width: var(--aicsu-max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Theme color channel.

   The theme paints text through a custom property, not through inheritance:

     :where(body) :where(*)                   { color: var(--color); }
     body main :is(p, ol, ul, li, figcaption) { --color: var(--color-black); }

   The first rule has zero specificity but still applies to every element, so
   setting `color` on a section never reaches its descendants; they each repaint
   themselves from --color. The second rule then re-pins --color to #3A3A3A on
   those five tags at (0,1,2), which beats a single section class.

   So sections set --color, not just color, and the reset below neutralizes the
   second rule at (0,2,1) by handing those tags back to normal inheritance.
   Everything nested inside a section then takes its color from the nearest
   ancestor that declares one, which is what the component rules rely on. */

.aicsu-section.aicsu-section { --color: var(--aicsu-ink); }

.aicsu-section.aicsu-section :is(p, ol, ul, li, figcaption) { --color: inherit; }

/* Measured pairings only.

   Pueblo Blue is the dominant color in the brand hierarchy, so it is the
   only full-strength section background. The three tints carry the rest. */

.aicsu-section--blue,
.aicsu-section.aicsu-section--blue {
  background-color: var(--aicsu-blue);
  --aicsu-surface: var(--aicsu-blue);
  color: var(--aicsu-white);                 /* 14.07 AAA */
  --color: var(--aicsu-white);
}
.aicsu-section--blue .aicsu-eyebrow { color: var(--aicsu-gold); }  /* 7.63 AAA */
/* Doubled class selector to out-specificity .aicsu-section h1/h2/h3 below,
   which shares the same (0,1,1) weight and would otherwise win on source
   order alone, since a blue-on-blue h1 goes invisible. */
.aicsu-section.aicsu-section--blue h1,
.aicsu-section.aicsu-section--blue h2,
.aicsu-section.aicsu-section--blue h3 { color: var(--aicsu-white); }

/* Tints. All three take Pueblo Blue text and headings. */

.aicsu-section--sand,
.aicsu-section.aicsu-section--sand {
  background-color: var(--aicsu-sand);
  --aicsu-surface: var(--aicsu-sand);
  color: var(--aicsu-blue);                  /* 10.07 AAA */
  --color: var(--aicsu-blue);
}

.aicsu-section--sky,
.aicsu-section.aicsu-section--sky {
  background-color: var(--aicsu-sky);
  --aicsu-surface: var(--aicsu-sky);
  color: var(--aicsu-blue);                  /*  9.62 AAA */
  --color: var(--aicsu-blue);
}

.aicsu-section--blush,
.aicsu-section.aicsu-section--blush {
  background-color: var(--aicsu-blush);
  --aicsu-surface: var(--aicsu-blush);
  color: var(--aicsu-blue);                  /* 10.47 AAA */
  --color: var(--aicsu-blue);
}

.aicsu-section.aicsu-section--sand h1,
.aicsu-section.aicsu-section--sand h2,
.aicsu-section.aicsu-section--sand h3,
.aicsu-section.aicsu-section--sky h1,
.aicsu-section.aicsu-section--sky h2,
.aicsu-section.aicsu-section--sky h3,
.aicsu-section.aicsu-section--blush h1,
.aicsu-section.aicsu-section--blush h2,
.aicsu-section.aicsu-section--blush h3,
.aicsu-section--sand .aicsu-eyebrow,
.aicsu-section--sky .aicsu-eyebrow,
.aicsu-section--blush .aicsu-eyebrow { color: var(--aicsu-blue); }

/* Tighter variant for short utility strips. */
.aicsu-section--tight {
  padding-top:    calc(var(--aicsu-section-y) * 0.5);
  padding-bottom: calc(var(--aicsu-section-y) * 0.5);
}


/* --------------------------------------------------------------------------
   3. TYPE
   -------------------------------------------------------------------------- */

.aicsu-section h1,
.aicsu-section h2,
.aicsu-section h3 {
  font-family: inherit;              /* the theme owns the brand typeface */
  line-height: 1.12;
  text-wrap: balance;
  margin-top: 0;
}

.aicsu-section h1 {
  font-size: var(--aicsu-size-h1);
  color: var(--aicsu-heading);
  letter-spacing: -0.015em;
  margin-bottom: var(--aicsu-space-3);
}

.aicsu-section h2 {
  font-size: var(--aicsu-size-h2);
  color: var(--aicsu-heading);
  letter-spacing: -0.01em;
  margin-bottom: var(--aicsu-space-4);
}

.aicsu-section h3 {
  font-size: var(--aicsu-size-h3);
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: var(--aicsu-space-2);
}

.aicsu-section p {
  font-size: var(--aicsu-size-body);
  line-height: 1.65;
  max-width: 68ch;
}

/* Prose stacks. Policy pages run heading, copy, list, table, heading again
   inside one section, and the theme zeroes block margins, so those blocks
   meet flush with no rhythm at all. Classed paragraphs are excluded because
   the eyebrow and lede set their own bottom spacing. */
.aicsu-section p:not([class]) { margin-bottom: var(--aicsu-space-3); }

.aicsu-lede { margin-bottom: var(--aicsu-space-4); }

/* A heading that follows content opens a new topic, so it needs air above it.
   Section-opening headings are unaffected: they have no preceding sibling. The
   eyebrow is excluded because it belongs to the heading below it; spacing it
   away breaks the pair. */
.aicsu-section :is(p:not(.aicsu-eyebrow), ul, ol, figure, .aicsu-callout, .wp-block-buttons, .wp-block-columns) + h2 {
  margin-top: var(--aicsu-space-6);
}

.aicsu-section :is(p:not(.aicsu-eyebrow), ul, ol, figure, .aicsu-callout, .wp-block-buttons, .wp-block-columns) + h3 {
  margin-top: var(--aicsu-space-4);
}

/* Small label that sits above a heading. Carries hierarchy without size,
   which is what lets card headings stay small. */
.aicsu-eyebrow {
  display: block;
  font-size: var(--aicsu-size-eyebrow);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--aicsu-red);                   /* 7.07 AAA on white */
  margin-bottom: var(--aicsu-space-2);
}

.aicsu-lede {
  font-size: var(--aicsu-size-lede) !important;
  line-height: 1.55;
  max-width: 60ch;
}

.aicsu-section--blue .aicsu-lede { color: rgba(255, 255, 255, 0.92); }

.aicsu-meta {
  font-size: var(--aicsu-size-small);
  color: var(--aicsu-ink-muted);
}

/* Prose lists. Content pages are list-heavy and the theme leaves plain
   ul/ol at full section width, so lines run to 130 characters while the
   paragraphs beside them stop at 68ch. Matches paragraph measure, leading
   and rhythm. The two list components opt out; they own their own layout. */
.aicsu-section :is(ul, ol):not(.aicsu-linklist):not(.aicsu-steps) {
  max-width: 68ch;
  padding-left: 1.5rem;
  margin: 0 0 var(--aicsu-space-3);
}

.aicsu-section :is(ul, ol):not(.aicsu-linklist):not(.aicsu-steps) li {
  font-size: var(--aicsu-size-body);
  line-height: 1.65;
  margin-bottom: var(--aicsu-space-1);
  padding-left: 0.25rem;
}

/* Marker carries a brand tint so a long list still reads as structured.
   Global Red clears 3:1 on white (7.07), Sand (5.06), Sky (4.84) and
   Blush (5.26). It fails on Pueblo Blue (1.99), so blue sections use
   CSU Gold (7.63). */
.aicsu-section :is(ul, ol):not(.aicsu-linklist):not(.aicsu-steps) li::marker {
  color: var(--aicsu-red);
}

.aicsu-section--blue :is(ul, ol):not(.aicsu-linklist):not(.aicsu-steps) li::marker {
  color: var(--aicsu-gold);
}

/* A bold lead-in at the start of a list item is a term, so it takes the
   heading color rather than sitting at body weight in body color. */
.aicsu-section :is(ul, ol) li > strong:first-child { color: var(--aicsu-heading); }
.aicsu-section--blue :is(ul, ol) li > strong:first-child { color: var(--aicsu-gold); }


/* --------------------------------------------------------------------------
   4. CARDS
   Applied to a core Column block inside a Columns block.
   Solves the two layout faults on the current homepage: unequal heights
   and CTAs that fall out of alignment when a heading wraps.
   -------------------------------------------------------------------------- */

.aicsu-cards {
  gap: var(--aicsu-space-3);
  align-items: stretch;
}

.aicsu-card {
  /* Theme's own grid class (s-grid) sets flex: 0 1 auto on columns, which
     shrink-to-fit each card's content instead of splitting evenly, so
     widths vary with how much copy each card holds. Force equal width. */
  flex: 1 1 0 !important;
  min-width: 0;
  --aicsu-accent: var(--aicsu-blue);
  display: flex;
  flex-direction: column;
  background-color: var(--aicsu-white);
  border: 1px solid var(--aicsu-rule);
  border-top: 4px solid var(--aicsu-accent);
  border-radius: var(--aicsu-radius);
  padding: var(--aicsu-space-3);
  color: var(--aicsu-ink);
  /* Card face is always white, so it restates the color channel rather than
     inheriting the section's. Otherwise white text from a blue section would
     carry into the card. */
  --color: var(--aicsu-ink);
}

/* Chained through .aicsu-section to reach (0,3,1). The section heading rules
   in part 2 are also (0,3,1) and would otherwise win on source order, which
   on a blue section paints a white heading onto the card's white face. */
.aicsu-section .aicsu-card h3 { color: var(--aicsu-blue); }

.aicsu-card p {
  font-size: var(--aicsu-size-body);
  color: var(--aicsu-ink-muted);
  margin-bottom: var(--aicsu-space-3);
}

/* A card whose last element is copy rather than a CTA would otherwise carry
   the paragraph's bottom margin on top of the card's padding. */
.aicsu-card > p:last-child { margin-bottom: 0; }

/* A quiet accent tile makes the card's subject immediately scannable. It
   inherits the existing territory accent, keeping this visual cue aligned
   with the keyline rather than adding a new color system. */
.aicsu-card__icon {
  align-items: center;
  background-color: color-mix(in srgb, var(--aicsu-accent) 12%, var(--aicsu-white));
  border: 1px solid color-mix(in srgb, var(--aicsu-accent) 22%, var(--aicsu-white));
  border-radius: var(--aicsu-radius);
  color: var(--aicsu-accent);
  display: inline-flex;
  font-size: 1.25rem;
  height: 2.75rem;
  justify-content: center;
  margin: 0 0 var(--aicsu-space-2);
  width: 2.75rem;
}

/* Theme icon rules otherwise repaint Font Awesome glyphs black. */
.aicsu-card__icon .fa-solid,
.aicsu-card__icon .fa-solid::before {
  color: currentColor !important;
  line-height: 1;
}

/* Pushes the CTA to the bottom edge so every card's button lines up,
   however long the heading or body copy runs. */
.aicsu-card__cta {
  margin-top: auto;
  margin-bottom: 0;
}

/* Territory keylines. The accent tells the reader which part of the site a
   card leads to. It is a wayfinding signal, not decoration, so it is used
   in exactly one place per card and nowhere else.

   Five accents, not seven. CSU Gold (1.84 on white) and Pewter (2.29) are
   too faint to read as a signal, so Tools/Governance and Research/Support
   share an accent. Cards that share an accent never sit in the same row. */
.aicsu-card--tools      { --aicsu-accent: var(--aicsu-blue);  }
.aicsu-card--teaching   { --aicsu-accent: var(--aicsu-ocean); }
.aicsu-card--research   { --aicsu-accent: var(--aicsu-slate); }
.aicsu-card--training   { --aicsu-accent: var(--aicsu-poppy); }
.aicsu-card--support    { --aicsu-accent: var(--aicsu-slate); }
.aicsu-card--news       { --aicsu-accent: var(--aicsu-red);   }
.aicsu-card--governance { --aicsu-accent: var(--aicsu-blue);  }

/* Fact card. Same geometry as a wayfinding card, no accent keyline, for a
   grid that groups information instead of leading somewhere: governance
   roles, responsibilities, definitions. Without this variant those grids
   would spend accents that mean "this card is a link to that section",
   which is the one job the keyline has. */
.aicsu-card--plain { border-top: 1px solid var(--aicsu-rule); }

/* On a tinted section the card's other three borders go transparent so the
   white face floats, and the keyline rule below repaints border-top with the
   accent at the same (0,2,0) weight as this rule. Later source order would
   win there, putting a lone accent hairline on a card that is meant to carry
   none, so the plain card's exclusion lives on that rule instead. */
.aicsu-section--sand .aicsu-card--plain,
.aicsu-section--sky .aicsu-card--plain,
.aicsu-section--blush .aicsu-card--plain { border-top-color: transparent; }

/* Two card rows are two separate Columns blocks. The theme zeroes block
   margins, so consecutive rows meet with no gap and the second row's accent
   keyline lands flush against the first row's bottom border, which reads as
   one 6-cell table rather than two rows of cards. Matches the in-row gap so
   horizontal and vertical rhythm agree. */
.aicsu-cards + .aicsu-cards { margin-top: var(--aicsu-space-3); }

/* Same fault where a card row is followed by anything else: a callout or a
   paragraph lands flush against the row's bottom border and reads as part of
   the last card. Headings are excluded because the heading rules in part 3
   give them a larger opening gap. */
.aicsu-cards + :not(.aicsu-cards, h2, h3) { margin-top: var(--aicsu-space-4); }

/* Cards sitting on a tinted section keep a white face so they lift off it. */
.aicsu-section--sand .aicsu-card,
.aicsu-section--sky .aicsu-card,
.aicsu-section--blush .aicsu-card { border-color: transparent; }

.aicsu-section--sand .aicsu-card:not(.aicsu-card--plain),
.aicsu-section--sky .aicsu-card:not(.aicsu-card--plain),
.aicsu-section--blush .aicsu-card:not(.aicsu-card--plain) { border-top-color: var(--aicsu-accent); }


/* --------------------------------------------------------------------------
   5. BUTTONS
   Class goes on the core Button block wrapper (.wp-block-button), so the
   selectors chain wrapper + link to clear theme specificity.
   -------------------------------------------------------------------------- */

.wp-block-button.aicsu-btn--primary .wp-block-button__link,
.wp-block-button.aicsu-btn--primary .wp-element-button {
  background-color: var(--aicsu-blue);
  color: var(--aicsu-white);                 /* 14.07 AAA */
  border: 2px solid var(--aicsu-blue);
  border-radius: var(--aicsu-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: var(--aicsu-size-body);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wp-block-button.aicsu-btn--primary .wp-block-button__link:hover,
.wp-block-button.aicsu-btn--primary .wp-element-button:hover {
  background-color: var(--aicsu-red);
  border-color: var(--aicsu-red);
  color: var(--aicsu-white);                 /* 7.07 AAA */
}

.wp-block-button.aicsu-btn--secondary .wp-block-button__link,
.wp-block-button.aicsu-btn--secondary .wp-element-button {
  background-color: transparent;
  color: var(--aicsu-blue);                  /* 14.07 AAA on white */
  border: 2px solid var(--aicsu-blue);
  border-radius: var(--aicsu-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: var(--aicsu-size-body);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-button.aicsu-btn--secondary .wp-block-button__link:hover,
.wp-block-button.aicsu-btn--secondary .wp-element-button:hover {
  background-color: var(--aicsu-blue);
  color: var(--aicsu-white);
}

/* Inverted pair for use on the blue hero. */
.aicsu-section--blue .wp-block-button.aicsu-btn--primary .wp-block-button__link,
.aicsu-section--blue .wp-block-button.aicsu-btn--primary .wp-element-button {
  background-color: var(--aicsu-white);
  color: var(--aicsu-blue);                  /* 14.07 AAA */
  border-color: var(--aicsu-white);
}

.aicsu-section--blue .wp-block-button.aicsu-btn--primary .wp-block-button__link:hover,
.aicsu-section--blue .wp-block-button.aicsu-btn--primary .wp-element-button:hover {
  background-color: var(--aicsu-gold);
  border-color: var(--aicsu-gold);
  color: var(--aicsu-black);                 /* 11.38 AAA */
}

.aicsu-section--blue .wp-block-button.aicsu-btn--secondary .wp-block-button__link,
.aicsu-section--blue .wp-block-button.aicsu-btn--secondary .wp-element-button {
  background-color: transparent;
  color: var(--aicsu-white);
  border-color: var(--aicsu-white);
}

.aicsu-section--blue .wp-block-button.aicsu-btn--secondary .wp-block-button__link:hover,
.aicsu-section--blue .wp-block-button.aicsu-btn--secondary .wp-element-button:hover {
  background-color: var(--aicsu-white);
  color: var(--aicsu-blue);
}

/* The theme zeroes margins on a Buttons block, so a section-level CTA sits
   flush against whatever precedes it (a callout, a link list, a paragraph).
   Card CTAs are excluded: .aicsu-card__cta uses margin-top: auto to pin
   itself to the card's bottom edge, and a fixed margin here would cancel
   that and unalign every button in the row. */
.aicsu-inner .wp-block-buttons:not(.aicsu-card__cta) {
  margin-top: var(--aicsu-space-4);
}

/* Smaller CTA for inside cards. */
.aicsu-card .wp-block-button .wp-block-button__link,
.aicsu-card .wp-block-button .wp-element-button {
  padding: 0.5rem 1rem;
  font-size: var(--aicsu-size-small);
}


/* --------------------------------------------------------------------------
   6. CALLOUT
   -------------------------------------------------------------------------- */

.aicsu-callout {
  background-color: var(--aicsu-white);
  border: 1px solid var(--aicsu-rule);
  border-left: 5px solid var(--aicsu-blue);
  border-radius: var(--aicsu-radius);
  padding: var(--aicsu-space-3);
  color: var(--aicsu-ink);
  --color: var(--aicsu-ink);        /* white face, same reason as the card */
}

/* A callout always follows something: a paragraph, a list, a card row. The
   theme zeroes block margins, so without this it lands flush against that
   block and reads as part of it rather than as an aside about it. Adjacent
   margins collapse, so a paragraph's own bottom margin does not stack. */
.aicsu-inner * + .aicsu-callout { margin-top: var(--aicsu-space-4); }

/* Same (0,3,1) chain as the card heading, for the same reason. */
.aicsu-section .aicsu-callout h3 { color: var(--aicsu-blue); }
.aicsu-callout p:last-child { margin-bottom: 0; }

.aicsu-callout--action  { border-left-color: var(--aicsu-ocean); }
.aicsu-callout--caution {
  background-color: var(--aicsu-gold);
  border-color: var(--aicsu-gold);
  border-left-color: var(--aicsu-black);
  color: var(--aicsu-black);                 /* 11.38 AAA */
  --color: var(--aicsu-black);
}
.aicsu-section .aicsu-callout--caution h3 { color: var(--aicsu-black); }


/* --------------------------------------------------------------------------
   7. COMPARISON TABLE
   For /tools/comparison/. Add .aicsu-table to a core Table block.
   -------------------------------------------------------------------------- */

/* Theme zeroes block margins, so a table meets the next paragraph flush. */
.aicsu-section .aicsu-table { margin-bottom: var(--aicsu-space-3); }

.aicsu-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--aicsu-size-small);
}

.aicsu-table thead th {
  background-color: var(--aicsu-blue);
  color: var(--aicsu-white);                 /* 14.07 AAA */
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: none;
  position: sticky;
  top: 0;
}

.aicsu-table tbody th,
.aicsu-table tbody td {
  padding: 0.75rem 1rem;
  border: none;
  border-bottom: 1px solid var(--aicsu-rule);
  vertical-align: top;
}

.aicsu-table tbody th {
  font-weight: 700;
  color: var(--aicsu-blue);
  text-align: left;
}

.aicsu-table tbody tr:nth-child(even) { background-color: var(--aicsu-band); }

.aicsu-table figcaption {
  font-size: var(--aicsu-size-small);
  color: var(--aicsu-ink-muted);
  margin-top: var(--aicsu-space-2);
}

/* Horizontal scroll on small screens instead of a squashed table.
   WCAG 1.4.10 exempts two-dimensional data tables from reflow. The row
   header column stays pinned so a row keeps its label while scrolling, and
   its edge shadow shows that more columns sit off screen. Pinned cells need
   an opaque fill, so they take the section surface (--aicsu-surface) or the
   band color on even rows. */
@media (max-width: 780px) {
  .aicsu-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .aicsu-table table { min-width: 640px; }

  .aicsu-table thead th:first-child,
  .aicsu-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 7.5rem;
    box-shadow: 6px 0 8px -3px rgba(0, 0, 0, 0.35);
  }
  .aicsu-table thead th:first-child { background-color: var(--aicsu-blue); }
  .aicsu-table tbody th { background-color: var(--aicsu-surface); }
  .aicsu-table tbody tr:nth-child(even) th { background-color: var(--aicsu-band); }

  /* Keep the caption in view instead of scrolling away with the table. */
  .aicsu-table figcaption { position: sticky; left: 0; }
}

/* The scroll region takes focus so keyboard users can scroll it. */
.aicsu-table:focus-visible {
  outline: 3px solid var(--aicsu-focus);
  outline-offset: 2px;
}


/* --------------------------------------------------------------------------
   8. STEPS
   Add .aicsu-steps to a core List block (ordered). Numbers are used only
   where order genuinely matters, such as the tool approval process.
   -------------------------------------------------------------------------- */

.aicsu-steps { list-style: none; padding-left: 0; counter-reset: aicsu-step; }

.aicsu-steps li {
  counter-increment: aicsu-step;
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: var(--aicsu-space-3);
  line-height: 1.6;
}

.aicsu-steps li::before {
  content: counter(aicsu-step);
  position: absolute;
  left: 0;
  top: -0.1em;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: var(--aicsu-blue);
  color: var(--aicsu-white);
  font-weight: 700;
  font-size: var(--aicsu-size-small);
  display: flex;
  align-items: center;
  justify-content: center;
}


/* --------------------------------------------------------------------------
   9. LINK LIST
   Add .aicsu-linklist to a core List block for resource indexes.
   -------------------------------------------------------------------------- */

.aicsu-linklist { list-style: none; padding-left: 0; margin: 0; }

.aicsu-linklist li { border-bottom: 1px solid var(--aicsu-rule); }

.aicsu-linklist li a {
  display: block;
  padding: 0.875rem 0;
  color: var(--aicsu-link);
  font-weight: 600;
  text-decoration: none;
}

.aicsu-linklist li a:hover {
  color: var(--aicsu-blue);
  text-decoration: underline;
}

/* The list itself carries no margin so its first row aligns with the heading
   above it. Whatever follows it needs the gap instead. */
.aicsu-linklist + * { margin-top: var(--aicsu-space-4); }


/* --------------------------------------------------------------------------
   10. QUALITY FLOOR
   -------------------------------------------------------------------------- */

/* Visible keyboard focus everywhere in the layer. Global Red clears 3:1
   against white (7.07), Sand (5.06), Sky (4.84) and Blush (5.26). It fails
   against Pueblo Blue (1.99), so blue sections switch the ring to CSU Gold
   (7.63). */
.aicsu-section a:focus-visible,
.aicsu-section button:focus-visible,
.aicsu-section .wp-block-button__link:focus-visible,
.aicsu-section .wp-element-button:focus-visible {
  outline: 3px solid var(--aicsu-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.aicsu-section--blue { --aicsu-focus: var(--aicsu-gold); }

.aicsu-section a { color: var(--aicsu-link); }
.aicsu-section--blue a { color: var(--aicsu-gold); }            /* 7.63 AAA */
.aicsu-section--sand a,
.aicsu-section--sky a,
.aicsu-section--blush a { color: var(--aicsu-red); }            /* 5.06 / 4.84 / 5.26 AA */

@media (prefers-reduced-motion: reduce) {
  .aicsu-section *,
  .aicsu-section *::before,
  .aicsu-section *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Core Columns stack below 782px by default, but the theme's s-grid class
   forces the row to nowrap, so three cards squeeze side by side. Restate the
   stack here. The card's flex-basis 0 would collapse its height in a column,
   so it resets to auto. */
@media (max-width: 781px) {
  .aicsu-cards {
    flex-direction: column;
    flex-wrap: wrap;
    gap: var(--aicsu-space-2);
  }
  .aicsu-card {
    flex: 0 0 auto !important;
  }
}


/* --------------------------------------------------------------------------
   11. HEADER SEAM
   Theme header carries its own background with no bottom edge. When the
   first section on a page is also .aicsu-section--blue (the homepage hero),
   the two blocks merge into one shape with no boundary. A seam keeps them
   visually separate regardless of what color the first section uses.
   -------------------------------------------------------------------------- */

#mainheader.site-header {
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* The footer has the same fault at the other end, and no seam fixes it: the
   theme footer is painted Pueblo Blue (#1F2759), the exact value of
   .aicsu-section--blue. A blue section placed last runs into the footer as
   one unbroken navy field, and any hairline drawn between two identical
   navies reads as a rendering artifact rather than an edge.

   So the footer is the page's closing blue block. A page ends on white or a
   tint; it does not end on .aicsu-section--blue. Enforcing that in CSS would
   mean overriding an author's chosen modifier, which is worse than the
   problem, so it stays a layout rule. */


/* --------------------------------------------------------------------------
   12. THEME TITLE BAND
   The theme prints a page-title banner above page content, which duplicates
   the H1 in the hero.

   The theme emits no page-id-* body class, so the homepage is targeted by
   WordPress's own .home class. The band itself is main > .page-header, and
   .page-header appears exactly once per page, so main scopes it away from
   any same-named element the header or footer might use.

   Homepage only. Interior pages have no hero and rely on this band for
   orientation, so it is not hidden sitewide.
   -------------------------------------------------------------------------- */

.home main .page-header { display: none; }
