/* =========================================================
   UPSA UNIVERSITY
   Inspired by common Canadian university site patterns.
   All content is placeholder; not affiliated with any
   real institution.
   ========================================================= */

/* ---------------------------------------------------------
   1. DESIGN TOKENS
   Centralising brand values as CSS Custom Properties means
   every component reads from one source of truth — change
   a value here and it cascades through the whole site.
   --------------------------------------------------------- */
:root {
  /* Brand tokens — UPSA (from upsa.edu.gh). Token names are kept from the
     Atlas codebase: "teal"/header = UPSA navy (structure & text), "red" /
     accent = UPSA royal (action & emphasis), accent-soft = UPSA gold — never
     text on a light surface (1.76:1 on white — decoration only). Grey is for quiet
     surfaces. Paper / muted / divider are the guide's website extension
     tokens. Theme Options → Colors writes these same variables. */
  --color-header-bg: #29344B;    /* UPSA navy — structure, dark sections, header bar, footer */
  --color-text: #29344B;         /* UPSA navy — text (12.45:1 on white) */
  --color-red: #00004E;          /* UPSA royal — primary actions (18.9:1 with white) */
  --color-red-dark: #000033;     /* Crimson hover */
  --color-red-tint: #EBEBF5;     /* Hover fill for secondary / tertiary actions */
  --color-accent: #00004E;       /* Links & emphasis on light surfaces — crimson (gold may not be text on white) */
  --color-accent-dark: #000033;  /* Hover for the above */
  --color-accent-soft: #FFB606;  /* UPSA gold — rules, icons, gold text on teal only */
  --color-grey: #D9D9D9;         /* UPSA grey — quiet surfaces */
  --color-bg-accent: #F9FAFC;    /* Paper — alternate section surface */
  --color-paper: #F9FAFC;
  --color-text-muted: #5A6478;   /* Muted — secondary text (5.95:1 on white) */
  --color-border: #D3D7E0;       /* Divider */
  --color-field-border: #5A6478; /* Form-field outline (muted) */
  --color-disabled-bg: #E6E8EE;  /* Neutral fill for disabled controls */
  --color-disabled-text: #7A8294;
  --color-white: #FFFFFF;

  /* Type — Inter throughout (UPSA's web font); headings 600. Was: Source Serif 4 / Google Sans Flex
     for navigation, controls, body copy and metadata. Sentence case.
     The guide defines only these two families, so --font-mono (numerals,
     dates) now resolves to the body face. */
  --font-display: 'UPSA SC', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'UPSA SC', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: var(--font-display);
  --fw-display: 600;             /* UPSA headings are Inter semibold */
  --font-mono: var(--font-body);
  --font-widget-heading: var(--font-body); /* footer column titles etc. — guide eyebrow style */

  /* Type scale (desktop / mobile <768px) — size / line-height */
  --fs-display: 64px;  --lh-display: 72px;
  --fs-h1: 48px;       --lh-h1: 56px;
  --fs-h2: 36px;       --lh-h2: 42px;
  --fs-h3: 28px;       --lh-h3: 34px;
  --fs-lead: 20px;     --lh-lead: 30px;
  --fs-body: 16px;     --lh-body: 24px;
  --fs-ui: 14px;       --lh-ui: 20px;
  --fs-caption: 12px;  --lh-caption: 18px;
  --tracking-display: -0.01em;
  --tracking-eyebrow: 1.6px;

  /* Geometry — 4px base unit, 8px rhythm */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --section-gap: 96px;           /* 64–96px between sections */
  --card-pad: 24px;
  --control-h: 48px;

  /* Grid — desktop ≥1200: 64px margins, 24px gutters, max content 1312px;
     tablet 768–1199: 32 / 24; mobile <768: 24 / 16. */
  --wrap-max: 1440px;            /* 1312px content + 2 × 64px margins */
  --wrap-content: 1312px;
  --wrap-pad: 64px;
  --gutter: 24px;
  --radius-block: 0;
  --radius-sm: 4px;              /* controls */
  --radius-md: 8px;              /* cards */
  --radius-pill: 999px;          /* badges only */
  --header-h: 64px;
  --audience-h: 36px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 180ms;
}
@media (max-width: 1199px) {
  :root { --wrap-pad: 32px; --section-gap: 80px; }
}
@media (max-width: 767px) {
  :root {
    --fs-display: 40px; --lh-display: 46px;
    --fs-h1: 36px;      --lh-h1: 42px;
    --fs-h2: 28px;      --lh-h2: 34px;
    --fs-h3: 24px;      --lh-h3: 30px;
    --fs-lead: 18px;    --lh-lead: 28px;
    --wrap-pad: 24px; --gutter: 16px; --section-gap: 64px;
  }
}

/* Respect users who've asked for less motion at the OS level */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Scroll-reveal base state — deliberately placed here, early in the
   cascade (documented in full under §17 further down), rather than
   grouped with the rest of the reveal-animation code. Several cards
   later in this file (.quick-card:hover, .news-card:hover, etc.) set
   their own `transform` on hover at equal specificity to .reveal's;
   whichever rule comes LAST in the file wins a tie like that, so this
   only works correctly if .reveal is defined before those component
   rules — placing it after them would silently cancel every card's
   hover-lift effect once revealed. See script.js §2d for the JS side. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: var(--fw-display, 600); line-height: 1.2; margin: 0; }
p { margin: 0; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }

/* Visually-hidden utility for screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until focused, then jumps to the top */
.skip-link {
  position: absolute;
  top: -100px; /* fully off-screen, padding included */
  left: 1rem;
  background: var(--color-red);
  color: var(--color-white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Focus — the guide's 2px teal ring with a 2px surface gap, on every
   interactive element. On dark (teal / crimson) surfaces the ring turns
   white so it stays visible. Never moves the control. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-header-bg);
  outline-offset: 2px;
}
.is-dark-surface :focus-visible,
.site-footer :focus-visible,
.audience-bar :focus-visible,
.au-steps :focus-visible, .au-pillars :focus-visible, .au-paths :focus-visible,
.au-cta :focus-visible, .au-subnav :focus-visible, .au-hero :focus-visible {
  outline-color: var(--color-white);
}

.wrap {
  max-width: calc(var(--wrap-content) + 2 * var(--wrap-pad));
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent-soft); /* gold on dark surfaces */
  margin: 0 0 var(--space-3);
}
.eyebrow--dark { color: var(--color-red); }

/* ---------------------------------------------------------
   3. BUTTONS — guide §05 "Buttons & action hierarchy"
   One crimson primary action per decision area. Secondary actions
   outline; tertiary actions stay quiet. 48px control height · 16px
   horizontal inset · 4px radius · 16px / 600 label · icons 18–20px
   with an 8–10px gap. Hover changes colour only — never moves the
   control. Disabled = neutral fill, not interactive.
   Legacy class names are kept and mapped onto the three tiers:
     .btn--primary            primary
     .btn--secondary, .btn--outline-dark, .btn--dark   secondary
     .btn--tertiary           tertiary
     .btn--ghost              secondary on a dark (teal/crimson) surface
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--color-red); border-color: var(--color-red); color: var(--color-white); }
.btn--primary:hover { background: var(--color-red-dark); border-color: var(--color-red-dark); color: var(--color-white); }

.btn--secondary,
.btn--outline-dark,
.btn--dark { background: var(--color-white); border-color: var(--color-red); color: var(--color-red); }
.btn--secondary:hover,
.btn--outline-dark:hover,
.btn--dark:hover { background: var(--color-red-tint); border-color: var(--color-red); color: var(--color-red); }

.btn--tertiary { background: transparent; border-color: transparent; color: var(--color-red); }
.btn--tertiary:hover { background: var(--color-red-tint); color: var(--color-red); }

/* Secondary on a dark surface (hero, teal and crimson bands). */
.btn--ghost { background: transparent; border-color: var(--color-white); color: var(--color-white); }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: var(--color-white); color: var(--color-white); }

.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled {
  background: var(--color-disabled-bg); border-color: var(--color-disabled-bg); color: var(--color-disabled-text);
  cursor: not-allowed; pointer-events: none;
}

/* ---------------------------------------------------------
   3b. UPSA BUTTON (UPSA: Button widget)
   Per-instance colour/typography from Elementor's Style tab still
   wins; these are the brand defaults. Sizes stay within the guide's
   control contract (≥44px touch target, 48px standard).
   --------------------------------------------------------- */
.upsa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.upsa-button:hover { background: var(--color-red-dark); }
.upsa-button--sm { min-height: 44px; padding: 0 16px; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.upsa-button--md { min-height: var(--control-h); padding: 0 16px; font-size: var(--fs-body); line-height: var(--lh-body); }
.upsa-button--lg { min-height: var(--control-h); padding: 0 24px; font-size: var(--fs-body); line-height: var(--lh-body); }

/* ---------------------------------------------------------
   3d. FIELDS — guide §06
   Persistent labels; one line of guidance; validation next to the
   field. 48px controls, 4px radius, muted 1px outline, 2px teal ring
   on focus, crimson + icon + message for errors, neutral fill when
   disabled. Placeholder text is never a label.
   --------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"],
input[type="number"], input[type="password"], input[type="date"], select, textarea {
  min-height: var(--control-h);
  padding: 11px 16px;
  border: 1px solid var(--color-field-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
textarea { min-height: 128px; }
input::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: 1; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="search"]:focus-visible,
input[type="tel"]:focus-visible, input[type="url"]:focus-visible, input[type="number"]:focus-visible,
input[type="password"]:focus-visible, input[type="date"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-header-bg); outline-offset: 2px; border-color: var(--color-header-bg);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-red); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--color-disabled-bg); border-color: var(--color-disabled-bg); color: var(--color-disabled-text); cursor: not-allowed; }
label { font-family: var(--font-body); }
.field-help { display: block; margin-top: 8px; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }
.field-error { display: block; margin-top: 8px; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-red); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-red); }

/* Badges (guide §08) — 999px radius is reserved for these. */
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 12px; border-radius: var(--radius-pill); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 600; background: var(--color-paper); color: var(--color-text); }

/* ---------------------------------------------------------
   3c. UPSA INSTAGRAM (UPSA: Instagram widget)
   Two layouts sharing the same .upsa-instagram__item tile:
     --featured: a large post on the left (2 rows tall) with an
       optional caption overlay, plus up to 4 more posts in a 2x2
       grid to the right — matches the "1 large + 2x2" reference
       layout the widget was built from.
     --grid: a plain N-column grid (column count set per-instance via
       the --upsa-instagram-cols custom property, written inline by
       the widget's render() from its Columns setting).
   --------------------------------------------------------- */
.upsa-instagram { display: grid; gap: 8px; }

.upsa-instagram--featured {
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.upsa-instagram--featured .upsa-instagram__item--featured {
  grid-row: 1 / span 2;
}
.upsa-instagram__side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-row: 1 / span 2;
  gap: inherit;
}

.upsa-instagram--grid {
  grid-template-columns: repeat(var(--upsa-instagram-cols, 3), 1fr);
}

.upsa-instagram__item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
}
.upsa-instagram--featured .upsa-instagram__item--featured { aspect-ratio: auto; }
.upsa-instagram__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur) var(--ease);
}
.upsa-instagram__item:hover img { transform: scale(1.04); }

.upsa-instagram__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 20px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.75) 100%);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

@media (max-width: 767px) {
  .upsa-instagram--featured {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .upsa-instagram--featured .upsa-instagram__item--featured,
  .upsa-instagram__side {
    grid-row: auto;
  }
}
@media (max-width: 767px) {
  .upsa-instagram--grid { grid-template-columns: repeat(2, 1fr); }
}

/* Setup/error reminder — visible only to logged-in users who can
   manage_options (see class-upsa-instagram-widget.php); an ordinary
   visitor never sees this, and never sees a broken-looking widget in
   its place either — it just renders nothing. */
.upsa-instagram__admin-notice {
  padding: 16px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-accent);
  color: var(--color-text);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
}

/* ---------------------------------------------------------
   3d. UPSA REELS (UPSA: Reels widget)
   A row of portrait (9:16) video thumbnails — a scroll-snap carousel
   with Previous/Next arrows when there are more than fit. Clicking the Play
   button swaps the poster image for an inline embedded player right
   inside the same tile — the same "swap the poster for a player in
   place" pattern as the Feature Card widget's video (see
   initInlineVideoCards() in script.js and .welcome-card__media) —
   rather than navigating away to the video's own platform page. An
   optional two-line brand badge sits in the bottom-left corner.
   --------------------------------------------------------- */
.upsa-reels-carousel {
  position: relative;
  width: 100%;
  /* Its own stacking context, so the arrows (z-index: 2) and tiles can
     never paint on top of a neighbouring widget such as News & Features
     — later sections in the page always render above this block. */
  isolation: isolate;
}
/* A horizontal scroll-snap row rather than a wrapping grid: if there
   are more videos than columns, the extras sit off to the side and the
   Previous/Next buttons (or a swipe on touch screens) bring them in.
   Each item's width is worked out from the column count and the gap so
   exactly --upsa-reels-cols items fit in view. */
.upsa-reels {
  display: flex;
  align-items: flex-start;
  gap: var(--upsa-reels-gap, 12px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.upsa-reels::-webkit-scrollbar { display: none; }
/* Reserve the row's full height explicitly, from the container's own
   width, instead of relying on each tile's aspect-ratio to work out the
   height of a scrolling flex row. Mobile browsers can lay a section out
   before that aspect-ratio height has resolved, which lets the next
   widget (News & Features) slide up underneath the tiles; a height
   that is known up front can't. Falls back to the aspect-ratio route on
   browsers without container query units. */
@supports (width: 1cqw) {
  .upsa-reels-carousel { container-type: inline-size; }
  .upsa-reels {
    height: calc(
      (100cqw - (var(--upsa-reels-cols, 3) - 1) * var(--upsa-reels-gap, 12px))
      / var(--upsa-reels-cols, 3) * 16 / 9
    );
  }
  .upsa-reels__item { height: 100%; }
}
.upsa-reels__item {
  position: relative;
  flex: 0 0 calc((100% - (var(--upsa-reels-cols, 3) - 1) * var(--upsa-reels-gap, 12px)) / var(--upsa-reels-cols, 3));
  min-width: 0;
  scroll-snap-align: start;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  background: var(--color-header-bg);
}
.upsa-reels__media {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
}
/* Higher-specificity selector + absolute fill on purpose: Elementor's
   own reset (.elementor img { height: auto; max-width: 100% }) loads
   after this stylesheet and would otherwise win on height, leaving the
   16:9 YouTube thumbnail at its natural aspect ratio at the top of the
   tile instead of filling it. Cover then center-crops the 16:9 frame
   down to the vertical video in the middle. */
.upsa-reels .upsa-reels__item .upsa-reels__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transition: transform var(--dur) var(--ease);
}
.upsa-reels__item:hover .upsa-reels__media img { transform: scale(1.04); }
.upsa-reels__video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.upsa-reels__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.25);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.upsa-reels__play svg { margin-left: 3px; } /* optically center the play triangle within the circle */
.upsa-reels__badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--color-red);
  color: var(--color-white);
  line-height: 1.15;
  pointer-events: none;
}
.upsa-reels__badge-line { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); }
.upsa-reels__badge-line--lg { font-family: var(--font-body); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: 800; text-transform: none; letter-spacing: normal; }

/* Previous / Next — only shown once script.js has confirmed the row
   overflows (.is-scrollable), so they never appear when every video
   already fits on screen. */
.upsa-reels__nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-header-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}
.upsa-reels-carousel.is-scrollable .upsa-reels__nav { display: flex; }
.upsa-reels__nav--prev { left: 10px; }
.upsa-reels__nav--next { right: 10px; }
.upsa-reels__nav:hover:not(:disabled) { background: #fff; }
.upsa-reels__nav:focus-visible { outline: 3px solid var(--color-red); outline-offset: 2px; }
.upsa-reels__nav:disabled { opacity: 0.35; cursor: default; }

/* Phones: one video at a time. !important is deliberate — the column
   count is set inline on the element by the widget, and inline styles
   would otherwise beat this rule. */
@media (max-width: 767px) {
  .upsa-reels { --upsa-reels-cols: 1 !important; }
}

.btn--sm { min-height: 44px; padding: 0 16px; font-size: var(--fs-ui); line-height: var(--lh-ui); } /* compact control — still ≥44px touch target */
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------------------------------------------------------
   4. AUDIENCE BAR
   --------------------------------------------------------- */
.audience-bar {
  background: var(--color-header-bg);
  color: var(--color-white);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
}
.audience-bar__inner {
  height: var(--audience-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.audience-bar__list {
  display: flex;
  gap: 20px;
  /* Safety net for very narrow phones (~320–375px): at that width the
     4 left-hand items sit right at or past the available space, and
     unlike the right-hand list there's no breakpoint that hides any
     of these. Scrolling beats visibly overflowing/wrapping. */
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}
.audience-bar__list::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.audience-bar__list li { flex-shrink: 0; } /* prevents mid-word text wrap if it does need to scroll */
.audience-bar__list a { opacity: 0.75; transition: opacity var(--dur) var(--ease); }
.audience-bar__list a:hover { opacity: 1; }
.audience-bar__list--right { display: none; } /* revealed at larger widths */

/* ---------------------------------------------------------
   5. MAIN STICKY HEADER
   position: sticky keeps the bar pinned to the viewport top
   once scrolled to, but only within its own container —
   cheaper than fixed positioning + manual offset math.
   --------------------------------------------------------- */
.site-header {
  position: sticky; /* Theme Options → Header → Sticky Header = Off switches this to relative */
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.3s ease;
}
/* Added/removed by initHeaderAutoHide() in script.js — see the
   comment there for the full behavior writeup. */
.site-header.is-header-hidden {
  transform: translateY(-100%);
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.brand__crest { color: var(--color-accent); flex-shrink: 0; }
/* Real crest image (replaces the placeholder SVG monogram).
   !important + the .brand ancestor (for extra specificity) are
   deliberate here: once this logo is embedded via the [upsa_header]
   shortcode inside an Elementor widget, Elementor's own default image
   reset (something like `.elementor-widget-container img { height:
   auto; max-width:100%; }`) has higher specificity than a bare
   .brand__logo class alone and will win the cascade, causing the
   logo to render at its native pixel size (huge) instead of the
   intended 42px. This rule is a narrow, intentional override to keep
   this one component's sizing regardless of what CSS any third-party
   plugin/widget wrapper it happens to be nested inside contributes. */
.brand__logo,
.brand .brand__logo {
  height: var(--logo-height, 42px) !important;
  width: auto !important;
  max-width: none !important;
  flex-shrink: 0;
}
.brand--footer .brand__logo { height: var(--logo-height-footer, 46px) !important; }

/* Distinct mobile logo (Theme Options → Logo → Mobile Logo): only
   rendered in the markup at all when a custom one is actually
   configured (see upsa_has_custom_mobile_logo() in
   inc/theme-options.php), so these rules are inert — no extra image
   request — on sites that haven't set one. Breakpoint matches the
   hamburger nav's own switch-over (see §11 below), so the logo swaps
   at the same point the header itself goes into its mobile layout. */
@media (max-width: 1199px) {
  .brand__logo--desktop { display: none; }
}
@media (min-width: 1200px) {
  .brand__logo--mobile { display: none; }
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-body); font-weight: 800; font-size: var(--fs-body); line-height: var(--lh-body); }
.brand__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); letter-spacing: var(--tracking-eyebrow); color: var(--color-text-muted); text-transform: uppercase; }

/* Primary nav: flexbox row on desktop, off-canvas panel on mobile (see media query) */
.primary-nav__list {
  display: flex;
  gap: 24px;
}
.primary-nav__list > li { position: relative; }
/* Items that have BOTH their own link and a dropdown (see class-nav-walker.php)
   lay the link and the small toggle button out side by side. */
.has-dropdown { display: flex; align-items: center; }
.primary-nav__list > li > a,
.nav-dropdown-toggle {
  font-weight: 600;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  padding: 8px 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* Underline-on-hover using a pseudo-element rather than border,
   so it doesn't shift layout by changing box height. Scoped to
   TOP-LEVEL nav triggers only, so dropdown panel links below don't
   inherit this absolutely-positioned underline. */
.primary-nav__list > li > a::after,
.nav-dropdown-toggle::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.primary-nav__list > li > a:hover::after,
.primary-nav__list > li > a:focus-visible::after,
.nav-dropdown-toggle:hover::after,
.nav-dropdown-toggle:focus-visible::after { transform: scaleX(1); }

/* Chevron on dropdown triggers — rotates 180deg when the panel is open */
.nav-dropdown-toggle__chevron {
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}
.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-toggle__chevron {
  transform: rotate(180deg);
}

/* Icon-only toggle variant: sits next to .nav-top-link (see
   class-nav-walker.php) when a dropdown item ALSO has its own real
   destination. Compact hit target for just the chevron — the label's
   own underline-on-hover already covers the row's hover affordance,
   so skip the redundant underline under the chevron alone. */
.nav-dropdown-toggle--icon-only {
  padding: 8px 4px;
  gap: 0;
}
.nav-dropdown-toggle--icon-only::after { display: none; }

/* ---------------------------------------------------------
   5b. NAV DROPDOWN (SUBMENUS)
   Mobile-first: the panel is a static block that expands
   in-flow inside the off-canvas menu. From the 900px
   breakpoint up (see media query), it becomes an absolutely
   positioned floating panel anchored under its trigger.
   --------------------------------------------------------- */
.nav-dropdown {
  display: flex;
  flex-direction: column;
}
.nav-dropdown[hidden] { display: none; }
.nav-dropdown a {
  display: block;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-dropdown a:hover,
.nav-dropdown a:focus-visible {
  background: var(--color-bg-accent);
  color: var(--color-accent-dark);
}

/* Mega panel inner structure (see inc/class-nav-walker.php). Mobile-
   first: collapses to the exact same simple stacked accordion the
   theme already had — media image and repeated heading both hidden,
   since the trigger row above already shows the label and a photo
   would just add scroll length to an already-tall off-canvas menu.
   The ≥1200px media query below is what actually turns this into a
   full-width mega layout with the image restored. */
.nav-dropdown__inner { display: flex; flex-direction: column; }
/* .nav-dropdown__inner doubles as .wrap (for the desktop mega
   layout's centered, max-width padding — see the ≥1200px override
   below). Inside a flex-column container (.nav-dropdown, above),
   .wrap's `margin-inline: auto` stops this item from stretching to
   fill the row — auto cross-axis margins override flex's default
   stretch behavior, so the block shrinks to fit its content instead
   and centers itself, which is what was actually producing the
   indent (and why the underlines stopped short of the right edge
   too). All three of .wrap's properties are reset here for
   mobile/tablet; the desktop rule re-adds its own explicitly. */
.nav-dropdown__inner {
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
  width: 100%;
}
.nav-dropdown__media { display: none; }
.nav-dropdown__heading { display: none; }
.nav-dropdown__intro,
.nav-dropdown__desc,
.nav-dropdown__arrow { display: none; }
.nav-dropdown--mega .sub-menu { list-style: none; margin: 0; padding: 0; }

.site-header__actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--color-text);
  transition: background var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--color-bg-accent); }

.site-header__cta { display: none; } /* shown from tablet breakpoint up */

/* Hamburger — three CSS-drawn bars (rendered as .hamburger__bar spans
   in the markup, NOT a bare `.hamburger span` selector — the button
   also contains a visually-hidden .sr-only label span for screen
   readers, and a selector matching every span would style that one
   too), morphs to an X via transforms when open. */
.hamburger {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  gap: 4px;
}
.hamburger__bar {
  width: 22px; height: 2px;
  background: var(--color-text);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------------------------------------------------
   6. SEARCH MODAL
   --------------------------------------------------------- */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(18, 18, 18, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
/* [hidden] handles both display and interaction removal for free —
   no extra JS class needed to toggle visibility */
.search-modal[hidden] { display: none; }

.search-modal__panel {
  width: min(640px, 92vw);
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: modal-in 220ms var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-modal__form {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 12px;
}
.search-modal__icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.search-modal__form input {
  flex: 1;
  border: 0;
  font-size: var(--fs-body); line-height: var(--lh-body);
  font-family: var(--font-body);
  outline: none;
  color: var(--color-text);
}
.search-modal__form input::placeholder { color: var(--color-text-muted); }
.search-modal__hint {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
}
.search-modal__hint-label { flex-shrink: 0; }
.chip {
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  margin: 4px 4px 0 0;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.search-modal__hint .chip { margin: 0; }
.chip:hover { background: var(--color-bg-accent); border-color: var(--color-accent); }

/* ---------------------------------------------------------
   7. HERO CAROUSEL
   Slides stack absolutely inside .hero__slides; only the one
   carrying .is-active is visible, crossfaded via opacity. Each
   slide can independently be a <video> or an <img> — the JS
   layer (script.js §2c) doesn't care which, it just shows/hides
   whichever element is inside the active .hero__slide and,
   if it's a <video>, plays/pauses it to match.
   --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 78vh; min-height: 78svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--color-white);
}
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1100ms cubic-bezier(0.4, 0, 0.2, 1);
  /* No visibility toggle here (deliberately) — visibility isn't a
     smoothly-animatable property unless it's itself included in the
     transition list with matching timing, and getting that timing
     wrong (or, as before, omitting it and letting it snap instantly)
     is exactly what caused the outgoing slide to vanish the instant
     its class changed, before its opacity had actually finished
     fading — a visible "blink" mid-crossfade. Plain opacity + the
     z-index below is sufficient on its own: the .is-active slide
     always paints on top, so the fade genuinely crossfades rather
     than one slide instantly disappearing before the other fades in. */
  will-change: opacity;
}
.hero__slide.is-active { opacity: 1; z-index: 1; }
.hero__bg {
  /* Absolutely positioned here too, not just on .hero__slide — the 18
     other pages that only have a single static image use the older,
     simpler markup: <img class="hero__bg"> directly inside .hero, with
     no .hero__slide wrapper at all (only index.html's carousel has
     one). Without its own position:absolute, a bare .hero__bg has no
     sized parent to resolve height:100% against and collapses to
     nothing — which is exactly the bug this fixes. Redundant-but-
     harmless on index.html, where .hero__slide already provides it;
     load-bearing everywhere else. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* YouTube background slides (Elementor: UPSA Hero widget,
   slide_type "youtube") — object-fit doesn't apply to <iframe>, so
   .hero__bg here is just a clipping wrapper (position/inset inherited
   from the rule above) and the actual "cover" scaling happens on the
   iframe itself: sized oversized relative to its own aspect ratio and
   centered, the same trick used for any non-object-fit-able embed. */
.hero__bg--youtube-wrap { overflow: hidden; background: var(--color-header-bg); }
.hero__bg-yt-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Sits behind the iframe purely as a loading-state fallback; once
     the iframe paints (same stacking context, later in source order)
     it naturally covers this without needing an explicit z-index. */
}
.hero__bg--youtube {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-width: 177.78vh; /* 16:9, so short/wide viewports still fill vertically */
  min-height: 100vh;
  transform: translate(-50%, -50%);
  pointer-events: none; /* purely decorative background — clicks pass through to whatever's layered on top */
  border: 0;
}
/* Gradient overlay: darker at the bottom where text sits, so the
   image stays visible up top but text always meets contrast needs */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(18,18,18,0.25) 0%, rgba(18,18,18,0.55) 55%, rgba(18,18,18,0.88) 100%);
}
.hero__content {
  position: relative;
  z-index: 3;
  padding-block: 56px 64px;
  max-width: 760px;
}
.hero__headline {
  font-size: var(--fs-display); line-height: var(--lh-display);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero__sub {
  margin-top: 16px;
  font-size: var(--fs-body); line-height: var(--lh-body);
  max-width: 56ch;
  color: rgba(255,255,255,0.9);
}
.hero__actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Previous/Next controls — bare, sleek arrows (no circle/backdrop),
   grouped bottom-right where the old play/pause toggle used to sit.
   A drop-shadow on the icon keeps it legible against the photo/video
   behind it without needing a background chip. Manual navigation
   (script.js §2c) stops the automatic 9s rotation on use, which is
   what satisfies WCAG 2.2.2's requirement for a way to stop
   auto-advancing content, in place of a dedicated pause button. */
.hero__nav {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hero__nav-btn {
  display: grid;
  place-items: center;
  color: var(--color-white);
  opacity: 0.85;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.hero__nav-btn:hover { opacity: 1; }
.hero__nav-btn--prev:hover { }
.hero__nav-btn--next:hover { }

/* ---------------------------------------------------------
   8. QUICK LINKS GRID
   repeat(auto-fit, minmax(...)) lets the grid decide how many
   columns fit per row at the current width — no breakpoints
   needed for this component to reflow responsively.
   --------------------------------------------------------- */
.quick-links {
  background: var(--color-bg-accent);
  padding-block: 48px;
}
.quick-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.quick-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.quick-card:hover { border-color: var(--color-header-bg); }
.quick-card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-bg-accent);
  color: var(--color-accent);
}
.quick-card__title { font-family: var(--font-display); font-weight: var(--fw-display, 600); font-size: var(--fs-lead); line-height: var(--lh-lead); }
.quick-card__desc { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }

/* ---------------------------------------------------------
   8b. PULL QUOTE
   Set in --font-serif (Source Serif 4) rather than --font-display —
   the brand guide's own Print collateral examples ("The future is
   at UPSA") use the serif specifically for this kind of editorial
   headline moment, reserving Google Sans for everything else.
   --------------------------------------------------------- */
.pull-quote {
  border-left: 3px solid var(--color-accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-lead); line-height: var(--lh-lead);
  color: var(--color-text);
  max-width: 62ch;
}
.pull-quote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------
   8b2. MEDIA LIST (UPSA: Media List widget)
   A stacked list of photo + eyebrow + title + description rows —
   see elementor-widgets/class-media-list-widget.php for when to
   reach for this over the icon grid (.quick-card) or a full card
   grid (.program-card / .news-card): a curated, any-length list
   where each entry needs more room for body copy than a grid cell
   comfortably gives.
   --------------------------------------------------------- */
.media-list { display: flex; flex-direction: column; gap: 12px; }
.media-list__row {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
/* Alternating shading — odd rows get the theme's soft accent
   background above, even rows sit on plain white so a long list
   still reads as distinct rows without needing a border between
   every single one. */
.media-list__row:nth-child(even) { background: var(--color-white); border: 1px solid var(--color-border); }
a.media-list__row:hover,
a.media-list__row:focus-visible {
  background: var(--color-paper);
}
.media-list__media {
  flex: 0 0 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.media-list__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-list__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.media-list__eyebrow { margin: 0; }
.media-list__title { font-family: var(--font-display); font-weight: var(--fw-display, 600); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--color-text); }
.media-list__desc { font-size: var(--fs-ui); color: var(--color-text-muted); line-height: var(--lh-ui); }

/* ---------------------------------------------------------
   8b3. UPSA HEADING (UPSA Heading widget)
   A bare title + sub-title with no background — for dropping a
   heading into the middle of a page/section where UPSA: Page
   Title or UPSA: Hero (both built around a full banner) are too
   heavy. Font family/size/weight for both lines are plain Elementor
   typography controls on the widget itself (see
   elementor-widgets/class-heading-widget.php); these are just the
   fallback look before an editor sets one.
   --------------------------------------------------------- */
.upsa-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.upsa-heading__title {
  font-family: var(--font-display);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  color: var(--color-text);
  margin: 0;
}
.upsa-heading__subtitle {
  font-size: var(--fs-body);
  color: var(--color-text-muted);
  line-height: var(--lh-body);
  margin: 0;
}

/* ---------------------------------------------------------
   8b4. HERO ALT (UPSA Hero Alt widget)
   Full-bleed image/video with the title sitting bottom-left over
   the media (a gradient scrim behind it for legibility) and a solid
   caption bar underneath holding the sub-title + a single button.
   See elementor-widgets/class-hero-alt-widget.php for how this
   differs from UPSA_Widget_Hero (the homepage carousel).
   --------------------------------------------------------- */
.hero-alt {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: var(--color-white);
  min-height: 620px;
}
.hero-alt__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Gradient scrim behind the title only — not a full-height overlay —
   so the image itself stays clear everywhere the title text doesn't
   need contrast help. */
.hero-alt__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(2,10,12,0) 45%, rgba(2,10,12,0.85) 100%);
}
.hero-alt__title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 var(--wrap-pad) 28px;
  font-family: var(--font-serif);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  color: var(--color-white);
}
.hero-alt__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  background: var(--color-header-bg);
  padding: 20px var(--wrap-pad);
}
.hero-alt__subtitle {
  margin: 0;
  max-width: 640px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-white);
  opacity: 0.9;
}
.hero-alt__button { flex-shrink: 0; }
.hero-alt__video-toggle {
  position: absolute;
  z-index: 2;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: var(--color-white);
  cursor: pointer;
}
.hero-alt__video-toggle:hover,
.hero-alt__video-toggle:focus-visible {
  background: rgba(0,0,0,0.75);
}
/* Exactly one icon at a time — same pattern as the mega-menu video
   toggle (see .nav-dropdown__media-toggle), driven off aria-pressed
   rather than a `hidden` attribute JS has to keep in sync by hand. */
.hero-alt__video-toggle .icon-play { display: none; }
.hero-alt__video-toggle[aria-pressed="false"] .icon-pause { display: none; }
.hero-alt__video-toggle[aria-pressed="false"] .icon-play { display: block; }
@media (max-width: 767px) {
  .hero-alt__bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .media-list__row { flex-direction: column; align-items: flex-start; }
  .media-list__media { flex-basis: auto; width: 100%; }
}

/* ---------------------------------------------------------
   8b2. UPSA VIDEO (Elementor: UPSA Video)
   A standalone video block (self-hosted or YouTube) inside a fixed-
   aspect-ratio frame (default 16/9, set via Elementor's Layout →
   Aspect Ratio control — see class-upsa-video-widget.php), with a
   single custom Play/Pause button pinned to the bottom-right corner.
   No native <video>/YouTube chrome is shown at all — this button is
   the only control surface.

   .upsa-video__toggle intentionally mirrors .hero-alt__video-toggle
   above (same rounded button, same aria-pressed-driven icon swap) but
   is kept as its own separate rule set rather than shared, since this
   widget's Style tab lets an editor override size/position/colors
   per-instance — sharing the hero-alt selector would mean those
   per-instance Elementor overrides leak onto every hero-alt section
   on the same page, and vice versa.
   --------------------------------------------------------- */
.upsa-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Elementor's Aspect Ratio control overrides this per-instance */
  background: var(--color-header-bg);
  overflow: hidden;
}
.upsa-video__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}
.upsa-video__toggle {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: var(--color-white);
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.upsa-video__toggle:hover,
.upsa-video__toggle:focus-visible {
  background: rgba(0,0,0,0.75);
  transform: scale(1.05);
}
/* Exactly one icon at a time, same aria-pressed-driven swap as
   .hero-alt__video-toggle above: aria-pressed="true" = currently
   playing (shows the pause icon, since that's the *next* action). */
.upsa-video__toggle .icon-play { display: none; }
.upsa-video__toggle[aria-pressed="false"] .icon-pause { display: none; }
.upsa-video__toggle[aria-pressed="false"] .icon-play { display: block; }

/* ---------------------------------------------------------
   8c. LEGAL / POLICY PROSE
   Long-form content for Privacy, Terms, and Accessibility.
   The global reset strips list markers and default heading
   spacing site-wide (so cards and nav stay tight); this class
   restores readable defaults, scoped so it doesn't leak into
   any card or nav component elsewhere on the site.
   --------------------------------------------------------- */
.legal-content { max-width: 72ch; }
.legal-content .legal-updated {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  color: var(--color-accent);
  margin-bottom: 32px;
}
.legal-content h2 {
  font-size: var(--fs-lead); line-height: var(--lh-lead);
  margin-top: 40px;
  margin-bottom: 12px;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h3 {
  font-size: var(--fs-body); line-height: var(--lh-body);
  margin-top: 24px;
  margin-bottom: 8px;
}
.legal-content p {
  margin-bottom: 16px;
  color: var(--color-text-muted);
}
.legal-content ul,
.legal-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
  color: var(--color-text-muted);
}
.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }
.legal-content li { margin-bottom: 8px; }
.legal-content li::marker { color: var(--color-accent); }
.legal-content strong { color: var(--color-text); }
.legal-content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-content a:hover { color: var(--color-accent-dark); }

/* ---------------------------------------------------------
   8d. SINGLE NEWS POST
   No .hero header band on this template (see single.php) —
   title + meta sit directly on the page background, followed by
   a wide feature image, the body copy (reuses .legal-content
   above for prose typography), tags, share links, then related
   posts (which reuse section 9's .news/.news-card components
   below so the cards can never visually drift from the main grid).
   --------------------------------------------------------- */
.single-post__header { padding-top: 48px; padding-bottom: 24px; max-width: 760px; }
.single-post__title {
  font-size: var(--fs-h1); line-height: var(--lh-h1);
  margin-bottom: 12px;
  max-width: none;
}
.single-post__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.single-post__meta a { color: var(--color-accent); }
.single-post__meta a:hover { color: var(--color-accent-dark); }
.single-post__meta-sep { margin: 0 8px; opacity: 0.6; }

.single-post__feature { margin-bottom: 40px; }
/* Wrapper carries the aspect ratio + crop; the <img> is absolutely
   positioned to fill it. This matches the pattern used everywhere
   else on the site for a cropped, responsive image (see
   .news-card__media, .event-card__image, .feature-card__media) —
   putting `aspect-ratio` directly on the <img> itself (the earlier
   version of this rule) is less reliable: WordPress always writes
   explicit width/height HTML attributes onto a featured image, and
   those can end up dictating the rendered box in some mobile
   browsers even with object-fit set, which is what was letting a
   tall source photo blow out the mobile layout instead of being
   cropped down to the intended banner shape. */
.single-post__feature-media {
  position: relative;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.single-post__feature-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 767px) {
  .single-post__feature-media { aspect-ratio: 4 / 3; }
}

.single-post__content { max-width: 760px; padding-block: 0 40px; }

.single-post__tags {
  max-width: 760px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
}

.single-post__share {
  max-width: 760px;
  margin-bottom: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.single-post__share-label {
  font-family: var(--font-mono);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-text-muted);
  margin-right: 8px;
}
.single-post__share-btn { border: 1px solid var(--color-border); }

/* UPSA Quick Action widget — full-width dark bar of rounded pill
   buttons (e.g. "Explore Programs" / "Talk to Us" / "Apply"), meant
   to sit directly under a page title banner. Distinct from
   .news__filters/.filter-tab below: those live on a light background
   and are a JS-driven active/inactive toggle a visitor clicks; this
   is a dark bar of plain links where "highlighted" is set per-button
   in the widget, not by user interaction. */
.upsa-quick-actions { background: var(--color-header-bg); display: flex; align-items: center; }
.upsa-quick-actions__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 16px var(--wrap-pad);
  overflow-x: auto;
  scrollbar-width: none;
}
.upsa-quick-actions__inner::-webkit-scrollbar { display: none; }
.upsa-quick-action {
  flex-shrink: 0;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.12);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.upsa-quick-action:hover { background: rgba(255, 255, 255, 0.22); }
.upsa-quick-action.is-active { background: var(--color-white); color: var(--color-header-bg); }
.upsa-quick-action.is-active:hover { background: var(--color-white); }

/* ---------------------------------------------------------
   9. NEWS & FEATURE GRID
   --------------------------------------------------------- */
.news { padding-block: 64px; }
.news__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}
.news__header h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); }

.news__filters {
  display: flex;
  gap: 8px;
  border-radius: 0;
  /* Keeps the tabs pinned right even if the heading/sub-heading text
     is turned off in the widget and .news__header ends up with only
     this one flex child — space-between has nothing to "space"
     between in that case, but margin-left: auto still pushes it. */
  margin-left: auto; background: transparent; padding: 0; border-bottom: 1px solid var(--color-border); gap: 24px; }
.filter-tab {
  border-radius: 0;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); background: transparent; padding: 0; min-height: 44px; border: 0; border-bottom: 3px solid transparent; color: var(--color-text-muted); font-weight: 500; }
.filter-tab:hover { color: var(--color-text); }
.filter-tab.is-active { background: transparent; color: var(--color-red); border-bottom-color: var(--color-red); }

.news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  transition: opacity 150ms var(--ease);
}
.news__grid.is-loading { opacity: 0.5; }

.news-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.news-card:hover { border-color: var(--color-header-bg); }

.news-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
/* Block-level so the whole card is one clean clickable region, rather
   than relying on the anchor's default inline flow around its block children. */
.news-card__link { display: block; }
.news-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms var(--ease);
}
.news-card:hover .news-card__media img { transform: scale(1.06); }

.tag {
  position: absolute;
  top: 0.85rem; left: 0.85rem;
  background: var(--color-accent);
  color: var(--color-white);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}
.tag--alt { background: var(--color-header-bg); }

.news-card__body { padding: 20px; }
.news-card__body h3 { font-size: var(--fs-body); line-height: var(--lh-body); margin-bottom: 8px; }
.news-card__body p { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }
.news-card__meta {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  color: var(--color-text-muted);
}

.news__empty {
  text-align: center;
  padding: 48px 0;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------
   9a. NEWS GRID — ALT (split layout)
   Two-column split: a news grid on one side, a dedicated
   "side panel" (eyebrow + title + sub-text + button) on the
   other. --agrid-grid-w / --agrid-side-w are set inline per
   instance by the widget (class-news-grid-alt-widget.php) so
   the ratio is editable per-instance without a recompile of
   this stylesheet; --agrid-gap and --agrid-sticky-top are set
   via ordinary Elementor responsive control selectors instead,
   since those don't need PHP-side math.

   Order (not DOM position) decides left/right: both columns
   are always written grid-col-then-side in markup so the
   default reading order stays sane for keyboard/AT users
   regardless of which side is visually "side panel" — the
   --side-left modifier only flips which grid track each
   occupies via `order`.
   --------------------------------------------------------- */
.upsa-news-grid-alt {
  --agrid-gap: 64px;
  --agrid-sticky-top: 96px;
  display: grid;
  grid-template-columns: minmax(0, var(--agrid-grid-w, 60%)) minmax(0, var(--agrid-side-w, 40%));
  align-items: start;
  gap: var(--agrid-gap);
}
.upsa-news-grid-alt__grid-col { order: 1; min-width: 0; }
.upsa-news-grid-alt__side { order: 2; min-width: 0; height: 100%; }

/* Side-left also needs the column TRACK WIDTHS swapped, not just the
   visual order of the two elements — `order` alone would put the
   side panel into the grid's first track (sized to --agrid-grid-w)
   and vice versa, silently inverting the width ratio the moment the
   side panel moves to the left. Flipping grid-template-columns here
   keeps "News Grid Width" meaning the grid's width regardless of
   which side it visually renders on. */
.upsa-news-grid-alt--side-left {
  grid-template-columns: minmax(0, var(--agrid-side-w, 40%)) minmax(0, var(--agrid-grid-w, 60%));
}
.upsa-news-grid-alt--side-left .upsa-news-grid-alt__grid-col { order: 2; }
.upsa-news-grid-alt--side-left .upsa-news-grid-alt__side { order: 1; }

.upsa-news-grid-alt__side {
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
  padding: 48px;
}
.upsa-news-grid-alt__side-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.upsa-news-grid-alt__side .eyebrow { margin-bottom: 12px; }
.upsa-news-grid-alt__side-heading {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  margin: 0 0 20px;
}
.upsa-news-grid-alt__side-desc {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-muted);
  margin: 0 0 32px;
  max-width: 42ch;
}
.upsa-news-grid-alt__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body); line-height: var(--lh-body);
  background: var(--color-red);
  color: var(--color-white);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.upsa-news-grid-alt__button:hover,
.upsa-news-grid-alt__button:focus-visible {
  background: var(--color-red-dark);
  color: var(--color-white);
}

/* Filter tabs, when enabled, sit above the grid inside the grid
   column only (there's no heading row up here to share space with —
   the heading lives in the side panel instead). */
.upsa-news-grid-alt .news__header--tabs-only {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

/* Sticky side panel — opt-in per instance via the widget's "Make
   Side Panel Sticky" switcher. `align-self: start` plus a bounded
   height keeps the panel from stretching to the grid column's full
   scroll height (which would make position:sticky a no-op). Scoped
   to a min-width so it never sticks on a stacked, single-column
   mobile layout, where the "columns" pin behavior would look like a
   glued header instead of the current two-column effect. */
@media (min-width: 1200px) {
  .upsa-news-grid-alt--sticky .upsa-news-grid-alt__side {
    position: sticky;
    top: var(--agrid-sticky-top);
    align-self: start;
    height: auto;
  }
}

@media (max-width: 1199px) {
  .upsa-news-grid-alt { grid-template-columns: 1fr; }
  .upsa-news-grid-alt__side { padding: 32px; }

  /* Default mobile behavior: keep the same visual order chosen for
     desktop (e.g. side panel "Left" still renders title/button first,
     stacked above the grid) — order is inherited from the rules above,
     nothing to reset here. Opt-in override below. */
  .upsa-news-grid-alt--reverse-mobile .upsa-news-grid-alt__grid-col { order: 1; }
  .upsa-news-grid-alt--reverse-mobile .upsa-news-grid-alt__side { order: 2; }
}

/* ---------------------------------------------------------
   9b. ALERT LIST (announcements)
   Plain title + date rows, one under another, hairline
   divider between them — no image or excerpt. Mirrors the
   .event-list row pattern above (hover fill, hairline
   borders) but stacks title/date instead of laying a date
   badge beside them, since alerts don't carry a location.
   --------------------------------------------------------- */
.alert-list { display: flex; flex-direction: column; }
.alert-item { border-top: 1px solid var(--color-border); }
.alert-item:last-child { border-bottom: 1px solid var(--color-border); }
.alert-item__link {
  display: block;
  padding: 16px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}
.alert-item__link:hover { background: rgba(16, 25, 43, 0.04); }
.alert-item__link:hover .alert-item__title { color: var(--color-accent-dark); }
.alert-item__title {
  display: block;
  font-family: var(--font-display);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--color-header-bg);
  margin-bottom: 8px;
  transition: color var(--dur) var(--ease);
}
.alert-item__date {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
}

/* Fallback for cards whose post has no featured image (search results
   can span post types — pages, faculty profiles, etc. — that don't
   always have one) so the media slot reads as an intentional empty
   panel instead of a blank gap. */
.news-card__media--empty { background: var(--color-bg-accent); }

/* ---------------------------------------------------------
   9b. SEARCH RESULTS
   Reuses .news-card for each result (see above) so results never
   look visually different from the News grid they're styled after —
   just laid out in a fixed 4-column grid instead of auto-fit, per
   spec (12 results per page, see upsa_search_results_per_page() in
   functions.php, so a full page is an even 3 rows of 4). Also reused
   as-is by archive.php's generic category/tag/date archive grid, so
   this column count applies to both.
   --------------------------------------------------------- */
.search-results { padding-block: 64px; }
.search-results__header { margin-bottom: 40px; max-width: 700px; }
.search-results__title {
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  margin-bottom: 8px;
  word-break: break-word;
}
.search-results__count { color: var(--color-text-muted); font-size: var(--fs-body); line-height: var(--lh-body); }
.search-results__empty {
  text-align: center;
  padding: 48px 0;
  color: var(--color-text-muted);
}

.search-results__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
@media (max-width: 1199px) {
  .search-results__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1199px) {
  .search-results__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .search-results__grid { grid-template-columns: 1fr; }
}

.search-results-pagination { margin-top: 48px; }
.search-results-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.search-results-pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  color: var(--color-text);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.search-results-pagination a.page-numbers:hover { border-color: var(--color-accent); color: var(--color-accent); }
.search-results-pagination .page-numbers.current { background: var(--color-header-bg); border-color: var(--color-header-bg); color: var(--color-white); }
.search-results-pagination .page-numbers.dots { border: 0; }

/* ---------------------------------------------------------
   9c. GENERIC ARCHIVE HEADER (category/tag/date archives)
   Powers archive.php: the archive title on the left, a compact
   keyword-search pill on the right — opposite corners of the same
   row, wrapping to stack on narrow screens. The search field submits
   the standard WordPress ?s= query (to search.php, same destination
   as the header's search modal), it isn't scoped to just this
   archive's own terms.
   --------------------------------------------------------- */
.archive-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}
.archive-header__title { margin: 0; }
.archive-header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 16px;
  flex-shrink: 0;
  width: 100%;
  max-width: 300px;
  transition: border-color var(--dur) var(--ease);
}
.archive-header__search:focus-within { border-color: var(--color-accent); }
.archive-header__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  background: transparent;
  color: var(--color-text);
}
.archive-header__search input::placeholder { color: var(--color-text-muted); }
.archive-header__search-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-header-bg);
  color: var(--color-white);
  transition: background var(--dur) var(--ease);
}
.archive-header__search-btn:hover { background: var(--color-accent); }

@media (max-width: 767px) {
  .archive-header { flex-direction: column; align-items: stretch; }
  .archive-header__search { max-width: 100%; }
}

/* ---------------------------------------------------------
   10. EVENTS & ACADEMIC FEATURE
   Two-column homepage section: an events list on the left,
   a single highlighted feature card on the right. Columns are
   unequal width (events gets more room) via explicit fr units
   rather than auto-fit, since this layout has exactly two
   fixed roles rather than an arbitrary repeating collection.
   --------------------------------------------------------- */
.events-feature {
  background: var(--color-bg-accent);
  padding-block: 56px;
}
.events-feature__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 40px;
  align-items: start;
}
.events-feature__col h2 {
  font-size: var(--fs-h3); line-height: var(--lh-h3);
  margin-bottom: 20px;
}

.event-list { display: flex; flex-direction: column; }
.event-list__item { border-top: 1px solid var(--color-border); }
.event-list__item:last-child { border-bottom: 1px solid var(--color-border); }
.event-list__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}
.event-list__link:hover { background: rgba(16, 25, 43, 0.04); }
.event-list__date {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  line-height: 1.1;
}
.event-list__month {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-red);
}
.event-list__day {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-lead); line-height: var(--lh-lead);
  font-weight: 800;
  color: var(--color-text);
}
.event-list__info { flex: 1; min-width: 0; }
.event-list__title {
  display: block;
  font-weight: 700;
  font-size: var(--fs-body); line-height: var(--lh-body);
  margin-bottom: 4px;
}
.event-list__location { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }
.event-list__chevron { flex-shrink: 0; color: var(--color-text-muted); transition: transform var(--dur) var(--ease); }
.event-list__link:hover .event-list__chevron { color: var(--color-accent); }

/* Optional featured-image thumbnail, sitting between the date badge
   and the title/location text — only rendered when the event has a
   featured image set (see class-event-grid-widget.php), so rows
   without one just show date + text with no broken/placeholder box. */
.event-list__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.event-list__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.events-feature__title {
  font-size: var(--fs-h3); line-height: var(--lh-h3);
  margin-bottom: 20px;
}

/* Wraps the optional raw iframe embed pasted into the "Location" ACF
   field's map-embed textarea (single-event.php) — keeps whatever
   fixed width/height the pasted iframe markup specifies from
   overflowing the content column on narrow screens. */
.event-map {
  margin: 16px 0 24px;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
}
/* width: 100% (not just max-width) so the iframe actually stretches
   to fill this wider container — a pasted Google Maps embed usually
   carries hardcoded width/height HTML attributes (e.g. width="600"),
   and max-width alone only ever prevents overflow, it doesn't make
   an element grow past its own specified size. Height is bumped and
   fixed to keep the map from looking flat/letterboxed once it's
   this much wider than the 450px a default embed typically ships
   with, overriding whatever height attribute the pasted code has. */
.event-map iframe {
  width: 100% !important;
  height: 480px !important;
  border: 0;
  display: block;
}
@media (max-width: 767px) {
  .event-map iframe { height: 320px !important; }
}

.events-feature__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-weight: 700;
  font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--color-accent);
}
.events-feature__cta:hover { color: var(--color-accent-dark); }

.feature-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: block;
  border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.feature-card:hover { border-color: var(--color-header-bg); }
.feature-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.feature-card__media img { width: 100%; height: 100%; object-fit: cover; }
.feature-card__body { padding: 24px; }
.feature-card__caption { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--color-text); margin-bottom: 16px; }
.feature-card__accent { display: block; width: 32px; height: 3px; background: var(--color-red); }

/* ---------------------------------------------------------
   11. ADMISSIONS / "ATTEND UPSA" SECTION
   Left: a large image card with a decorative play affordance
   (this demo has no real video — it links straight through to
   Admissions). Right: a stacked list of pathway cards, each
   marked with a coloured left border for quick visual sorting.
   --------------------------------------------------------- */
.attend {
  background: var(--color-white);
  padding-block: 64px;
}
.attend__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}
.attend h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: 20px; }

.attend-card {
  display: block;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.attend-card:hover { border-color: var(--color-header-bg); }
.attend-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.attend-card__media img { width: 100%; height: 100%; object-fit: cover; }
/* Decorative — this demo has no video to actually play, so the whole
   card is just a link through to Admissions instead. */
.attend-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.attend-card__play span {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(196, 41, 31, 0.9); /* --color-red at reduced opacity, no rgba() var support */
  color: var(--color-white);
}
.attend-card__body { padding: 24px; }
.attend-card__title { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); margin-bottom: 8px; }
.attend-card__desc { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); margin-bottom: 16px; }

.pathway-list { display: flex; flex-direction: column; gap: 16px; }

/* The border/shadow/left-accent now live on the wrapping .pathway-item,
   not the button — because the item needs to visually grow (as one
   continuous card) when its dropdown opens beneath the button. */
.pathway-item {
  background: var(--color-white);
  border-left: 4px solid var(--pathway-color, var(--color-accent));
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease); border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.pathway-item:hover,
.pathway-item:focus-within { border-color: var(--color-header-bg); }

.pathway-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-align: left;
}
/* This button also carries .nav-dropdown-toggle (see script.js §2b) to
   get click/Escape/outside-click handling for free — but that shared
   class ships an underline-on-hover meant for slim nav links, which
   would look like a stray line across the bottom of a full card. */
.pathway-card.nav-dropdown-toggle::after { display: none; }
.pathway-card__body { flex: 1; min-width: 0; }
.pathway-card__title { display: block; font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); margin-bottom: 4px; }
.pathway-card__desc { display: block; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }
.pathway-card__icon { flex-shrink: 0; color: var(--color-text-muted); }

/* Dropdown panel — this also carries .nav-dropdown for the shared
   open/close behaviour, but is styled here to expand in-flow beneath
   the button (an inline accordion) rather than the floating flyout
   used in the primary nav — more robust inside a narrow stacked list
   than an absolutely-positioned panel would be. */
.pathway-dropdown {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-accent);
  padding: 8px 20px 8px calc(20px + 4px);
}
.pathway-dropdown a { font-weight: 500; }
/* Neutralizes the primary nav's desktop floating-flyout positioning that
   .nav-dropdown normally gets at ≥900px (see §5b / §18) — this panel
   stays an inline accordion inside its card at every viewport width.
   !important is deliberate here: it's specifically overriding a
   media-query-scoped rule built for a different component's needs. */
.pathway-dropdown.nav-dropdown {
  position: static !important;
  transform: none !important;
  margin-top: 0 !important;
  min-width: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: auto !important;
}

/* ---------------------------------------------------------
   12. FOOTER — 4-column responsive layout
   --------------------------------------------------------- */
.site-footer {
  background: var(--color-header-bg);
  color: rgba(255,255,255,0.85);
  padding-top: 56px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-col h3 {
  color: var(--color-white);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: var(--fs-ui); line-height: var(--lh-ui); opacity: 0.85; transition: opacity var(--dur) var(--ease); }
/* Uses the pale gold variant here, not --color-accent — the darker gold
   is tuned for contrast on white and would nearly disappear on this navy bg */
.footer-col a:hover { opacity: 1; color: var(--color-accent-soft); }

.brand--footer { color: var(--color-white); margin-bottom: 16px; }
.brand--footer .brand__sub { color: rgba(255,255,255,0.6); }
.footer-address { font-style: normal; font-size: var(--fs-ui); opacity: 0.75; line-height: var(--lh-ui); }
.footer-phone { font-size: var(--fs-ui); line-height: var(--lh-ui); opacity: 0.75; margin-top: 8px; }
.footer-phone a { color: inherit; }
.footer-social { display: flex; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: var(--color-white);
  transition: background 0.2s ease, color 0.2s ease;
}
.footer-social a:hover, .footer-social a:focus-visible { background: var(--color-accent-soft); color: var(--color-header-bg); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  opacity: 0.6;
}
.footer-legal { display: flex; gap: 20px; }

/* ---------------------------------------------------------
   13. EVENTS LISTING PAGE (events.html)
   A two-column layout — a paginated grid of event cards next
   to a month calendar widget — plus a decorative filter bar.
   --------------------------------------------------------- */

.events-toolbar { margin-bottom: 32px; }
.events-toolbar h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: 8px; }
/* Upcoming / Past events switch */
.events-toolbar__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.events-when { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 8px; border: 1px solid var(--color-border, #dde1ea); border-radius: 999px; background: #fff; }
.events-when a { padding: 6px 16px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; color: var(--color-text, #12161A); text-decoration: none; }
.events-when a:hover { background: rgba(0, 0, 78, 0.06); }
.events-when a[aria-current="page"] { background: var(--color-primary, #00004E); color: #fff; }
.events-empty-state a { font-weight: 600; margin-left: 4px; }
.section-accent { display: block; width: 32px; height: 3px; background: var(--color-red); margin-bottom: 28px; }

/* Decorative — styled like real filter controls, but not wired to any
   actual filtering logic in this static demo. */
.event-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  background: var(--color-bg-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  color: var(--color-text);
}
.filter-select svg { color: var(--color-text-muted); }
.filter-select select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 8px;
  font: inherit;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-white);
}

/* Two-column layout: card grid + calendar sidebar (see
   inc/cpt-events.php for what actually populates the sidebar). */
.events-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1199px) {
  .events-layout { grid-template-columns: 1fr; }
}

/* 1.56.5: separate cards with a small gap (they used to share borders). */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  transition: opacity 150ms var(--ease);
}
.events-grid > .event-card { border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; background: var(--color-white, #fff); }
@media (max-width: 767px) { .events-grid { gap: 12px; } }
.events-grid.is-loading { opacity: 0.5; }
.events-empty-state {
  grid-column: 1 / -1;
  padding: 40px 24px;
  text-align: center;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.events-clear-filter { color: var(--color-accent); text-decoration: underline; }
.event-card {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
/* Featured image is optional — only rendered by upsa_render_event_card()
   when the event actually has one set, so cards without one just
   start directly at .event-card__body with no empty gap. */
.event-card__image { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.event-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 400ms var(--ease); }
.event-card__image:hover img { transform: scale(1.04); }
.event-card__body { padding: 24px; min-width: 0; }
.event-card__date { line-height: 1.1; margin-bottom: 8px; }
.event-card__month { display: block; font-family: var(--font-mono); font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; letter-spacing: var(--tracking-eyebrow); color: var(--color-red); text-transform: uppercase; }
.event-card__day { display: block; font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: 800; }
.event-card__title { font-size: var(--fs-body); line-height: var(--lh-body); margin-bottom: 8px; }
.event-card__title a { color: inherit; }
.event-card__title a:hover { color: var(--color-accent); }
.event-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.event-card__meta svg { flex-shrink: 0; color: var(--color-accent); }
.event-card__cta { margin-top: 16px; }
.event-card[hidden] { display: none; }

.events-results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.events-results-count { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }

.events-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
}
/* Without this, JS setting the `hidden` attribute (after a calendar
   date-filter, see initEventsCalendar in script.js) wouldn't actually
   hide this element — an author stylesheet's `display` declaration
   always overrides the browser's built-in `[hidden] { display: none }`
   rule regardless of specificity, since origin (author vs. user-agent)
   takes priority over specificity in the cascade. Same fix already
   applied to .mobile-nav-back, .nav-dropdown, .search-modal, and
   .event-card elsewhere in this file. */
.events-pagination[hidden] { display: none; }
.events-pagination__pages { display: flex; align-items: center; gap: 8px; }
.page-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  color: var(--color-text);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.page-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.page-btn.is-active { background: var(--color-header-bg); border-color: var(--color-header-bg); color: var(--color-white); }
.page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.page-btn[disabled]:hover { border-color: var(--color-border); color: var(--color-text); }

.calendar-widget {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.calendar-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-widget__header h3 { font-size: var(--fs-body); line-height: var(--lh-body); }
.calendar-widget__nav {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: background var(--dur) var(--ease);
}
.calendar-widget__nav:hover { background: var(--color-bg-accent); }
.calendar-widget__weekdays,
.calendar-widget__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.calendar-widget__weekdays {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption); line-height: var(--lh-caption);
  color: var(--color-text-muted);
  text-align: center;
}
.calendar-widget__days { row-gap: 4px; }
.calendar-widget__day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  border-radius: 50%;
}
.calendar-widget__day.is-today {
  background: var(--color-red);
  color: var(--color-white);
  font-weight: 700;
}
.calendar-widget__day.has-event {
  position: relative;
  font-weight: 600;
  color: var(--color-accent);
}
.calendar-widget__day.has-event::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
}
.calendar-widget__day.is-today.has-event::after { background: var(--color-white); }
.calendar-widget__today { width: 100%; justify-content: center; margin-top: 24px; }

/* ---------------------------------------------------------
   14. FACULTY DIRECTORY & PROFILE (faculty-directory.html,
   faculty-profile.html)
   --------------------------------------------------------- */

/* Search/filter toolbar — dark navy bar, matches the CTA-red "Filter"
   button convention used for the site's other primary actions. */
.directory-toolbar {
  background: var(--color-header-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 40px;
}
.directory-toolbar input[type="search"],
.directory-toolbar select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font: inherit;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  background: var(--color-white);
  color: var(--color-text);
}
.directory-toolbar select { color: var(--color-text-muted); }
.directory-toolbar .btn { white-space: nowrap; }
.directory-results-count {
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Explicit 4-column grid (not auto-fill) so the column count is
   deliberate — 12 results per page (see posts_per_page in
   inc/faculty-archive-filters.php) divides evenly into exactly 3 rows
   at 4 columns. Narrower viewports step down to 3, then 2, then 1
   column (see the responsive rules further down this file).
   The UPSA: People widget's own Columns control sets --upsa-people-cols
   per breakpoint (see the 'columns' add_responsive_control in
   elementor-widgets/class-people-grid-widget.php) and inlines
   --upsa-people-count (the actual number of cards rendered) on the
   grid element itself. The column count actually used is
   min(desired, actual) — without that clamp, asking for e.g. 4
   columns while only 2 people match the widget's filter would still
   reserve 4 grid tracks, leaving a large empty gap next to the 2 real
   cards instead of them filling the row. On the plain, non-widget
   Directory archive (archive-faculty.php) neither custom property is
   set, so both var() calls fall through to their "4" defaults below —
   identical to the plain repeat(4, 1fr) this replaced. */
.people-grid {
  display: grid;
  grid-template-columns: repeat(min(var(--upsa-people-cols, 4), var(--upsa-people-count, 4)), 1fr);
  gap: 24px;
}
.people-card {
  display: block;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.people-card:hover { border-color: var(--color-header-bg); }
/* max-height caps how tall the photo can grow when a card gets very
   wide (e.g. only 2 people filling a 4-column-wide row — see the
   min() clamp on .people-grid above). Without this, aspect-ratio
   scales height right along with width, so a handful of extra-wide
   cards get an oversized, elongated portrait photo that shoves the
   name far down the card — exactly the "gap" this fixes. Beyond the
   cap, object-fit:cover on the <img> still fills the box completely;
   it just crops the sides instead of growing taller.
   width/max-height are !important as a defensive measure — a site's
   own Additional CSS (Customizer) or another plugin's stylesheet can
   load after this one and silently win on specificity/source-order
   alone even without !important on their side; forcing it here keeps
   this particular fix from being the one that quietly loses that
   fight. */
.people-card__photo { width: 100% !important; aspect-ratio: 4 / 4.6; max-height: 400px !important; overflow: hidden; border-bottom: 4px solid var(--color-accent-soft); }
.people-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.people-card__body { padding: 16px 16px; }
.people-card__name { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--color-header-bg); margin-bottom: 4px; }
.people-card__role { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }

/* Faculty Profile page — matches the reference staff-directory
   plugin's tab-switching "Profile Menu" pattern (see
   initFacultyProfileTabs() in assets/js/script.js): only one
   .profile-panel is visible at a time, toggled by clicking a
   .profile-nav link, rather than every section being stacked and
   visible at once. */
.profile-banner {
  background: var(--color-header-bg);
  border-left: 8px solid var(--color-accent);
  padding-block: 36px;
}
.profile-banner .wrap { padding-left: calc(var(--wrap-pad) - 8px); }
.profile-banner h1 { color: var(--color-white); font-size: var(--fs-h3); line-height: var(--lh-h3); }

.profile-layout {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 40px;
  align-items: start;
}

/* Photo beside the name/title/meta (not stacked above it) — the
   summary sits at the top of the wide right-hand column, directly
   above the active .profile-panel. */
.profile-summary {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 8px;
}
.profile-summary__photo {
  width: 260px;
  flex-shrink: 0;
  aspect-ratio: 4 / 4.6;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.profile-summary__photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-summary__body { padding-top: 4px; }
.profile-summary__name { font-size: var(--fs-lead); line-height: var(--lh-lead); }
.profile-summary__role { color: var(--color-red); font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); margin: 4px 0 16px; }
.profile-summary__role.has-extra { margin-bottom: 4px; }
.profile-summary__extra { list-style: none; margin: 0 0 16px; padding: 0; font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 600; color: var(--color-text); }
.profile-summary__extra li { margin: 0; padding: 0; }
.people-card__extra { display: block; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); }
.profile-summary__meta { font-size: var(--fs-ui); line-height: var(--lh-ui); margin-bottom: 8px; }
.profile-summary__meta strong { color: var(--color-text); }
.profile-summary__meta a { color: var(--color-accent); }
.profile-summary__social { display: flex; gap: 8px; margin-top: 16px; }
.profile-summary__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-accent);
  color: var(--color-text);
  flex-shrink: 0;
}
.profile-summary__social { flex-wrap: wrap; }
.profile-summary__social a,
.profile-summary__social span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-accent);
  color: var(--color-text);
  flex-shrink: 0;
}
.profile-summary__social a:hover { background: var(--color-accent); color: var(--color-white); }
.profile-summary__social .is-empty { opacity: .5; cursor: default; }
.profile-summary__social { gap: 12px; }
.profile-summary__social a,
.profile-summary__social span { width: 64px; height: 64px; }
.profile-summary__social svg { width: 28px; height: 28px; }
@media (max-width: 600px) {
  .profile-summary__social a,
  .profile-summary__social span { width: 52px; height: 52px; }
  .profile-summary__social svg { width: 24px; height: 24px; }
}

.profile-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--audience-h) + 1.5rem);
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.profile-nav__title {
  background: var(--color-text);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  padding: 12px 16px;
}
.profile-nav a {
  display: block;
  padding: 12px 16px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--color-border);
}
.profile-nav a:hover { background: rgba(16,25,43,0.04); }
.profile-nav a:last-child { border-bottom: 0; }
.profile-nav a.is-active { border-left-color: var(--color-red); background: var(--color-white); color: var(--color-red); }

.profile-panel { display: none; }
.profile-panel.is-active { display: block; animation: upsaProfileFade 0.3s var(--ease); }
@keyframes upsaProfileFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.profile-panel h2 { font-size: var(--fs-lead); line-height: var(--lh-lead); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--color-accent); display: inline-block; }
.profile-panel p { margin-bottom: 16px; line-height: 1.65; }
.profile-panel ul,
.profile-panel ol { padding-left: 20px; margin-bottom: 16px; }
.profile-panel li { margin-bottom: 8px; }
.profile-panel ul { list-style: disc; }
.profile-panel ol { list-style: decimal; }
/* Sub-headings inside a free-text panel (e.g. "Graduate level" under Teaching Experience). */
.profile-panel h3,
.profile-panel h4 { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; margin: 24px 0 8px; }
.profile-panel h2 + h3,
.profile-panel h2 + h4 { margin-top: 8px; }
.profile-panel .profile-record__title { margin-bottom: 2px; }
/* Areas of Specialization renders as tags — reuses the site-wide
   .chip component (defined near the top of this file) rather than a
   bespoke tag style. Wrapped in its own block container (rather than
   flowing directly after the h2) since .profile-panel h2 is
   display:inline-block — without this wrapper, the chips would sit
   on the same line as the heading instead of wrapping to their own
   row below it. */
.profile-panel__chips { margin-top: 4px; }
.profile-panel .chip { margin: 0 8px 8px 0; }

/* Structured repeater entries — Qualifications, Positions Held,
   Honours & Awards, Publications, Grants/Funds, Research Projects —
   each is a title line plus an optional muted meta/description line
   underneath, rather than a free-form WYSIWYG paragraph. */
.profile-record { margin-bottom: 20px; }
.profile-record:last-child { margin-bottom: 0; }
.profile-record__title { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); }
.profile-record__meta { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); margin-top: 4px; }
.profile-record__desc { font-size: var(--fs-ui); color: var(--color-text-muted); margin-top: 8px; line-height: var(--lh-ui); }
.profile-record__link { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-accent); margin-top: 8px; display: inline-block; }

.profile-empty { color: var(--color-text-muted); }

@media (max-width: 1199px) {
  /* Sidebar becomes a horizontal, scrollable tab strip stuck under
     the site's own sticky header, instead of a vertical list down
     the page — there's no room for a side column at this width. */
  .profile-nav {
    position: sticky;
    top: calc(var(--header-h) + var(--audience-h));
    z-index: 20;
    display: flex;
    overflow-x: auto;
    border-radius: 0;
    margin-inline: calc(var(--wrap-pad) * -1);
  }
  .profile-nav__title { display: none; }
  .profile-nav a {
    flex-shrink: 0;
    white-space: nowrap;
    border-left: 3px solid transparent;
    border-bottom: 3px solid transparent;
  }
  /* Matches the live reference: the active tab gets a red bar on
     BOTH its left edge and its underside (an "L" bracket around its
     bottom-left corner), not just a bottom underline — the same
     border-left the desktop vertical nav already uses stays lit up
     here too, it just now sits beside horizontally-flowing text
     instead of above stacked text. */
  .profile-nav a.is-active { border-bottom-color: var(--color-red); background: transparent; }
  .profile-summary { flex-direction: column; }
  /* Full width instead of a small fixed-width thumbnail — same
     portrait aspect-ratio as desktop, just scaled up to fill the
     column instead of sitting beside the meta text. */
  .profile-summary__photo { width: 100%; }
}

/* ---------------------------------------------------------
   15. PROGRAMS ARCHIVE & SINGLE (programs.html,
   program-single.html)
   --------------------------------------------------------- */

.programs-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.programs-topbar__filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--color-text);
}
.programs-topbar__filter-label svg { color: var(--color-text-muted); flex-shrink: 0; }

.programs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}
.programs-filters { position: sticky; top: calc(var(--header-h) + var(--audience-h) + 1.5rem); }
.programs-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  margin-bottom: 8px;
  cursor: pointer;
}
.programs-filters input[type="checkbox"],
.programs-filters input[type="radio"] { accent-color: var(--color-accent); width: 16px; height: 16px; }

/* Program / Faculty / Department filter dropdowns — each is a
   collapsible section rather than an always-visible list, so the
   sidebar stays short with many terms. Same 0fr → 1fr
   grid-template-rows height animation used by .course-accordion and
   .admission-card elsewhere in the theme, driven off the header's
   aria-expanded value (see initFilterDropdowns() in script.js). A
   dropdown auto-opens on page load if it already has an active
   selection (data-default-open, set server-side in archive-program.php)
   so an applied filter is never hidden behind a collapsed header. */
.filter-dropdown { border-bottom: 1px solid var(--color-border); margin-bottom: 8px; }
.filter-dropdown:last-of-type { margin-bottom: 20px; }
.filter-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-text-muted);
}
.filter-dropdown__chevron { flex-shrink: 0; transition: transform var(--dur) var(--ease); }
.filter-dropdown__header[aria-expanded="true"] .filter-dropdown__chevron { transform: rotate(180deg); }

.filter-dropdown__panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.filter-dropdown__header[aria-expanded="true"] + .filter-dropdown__panel-wrap { grid-template-rows: 1fr; }
.filter-dropdown__panel {
  overflow: hidden;
  min-height: 0;
}
/* The fieldset is nested inside .filter-dropdown__panel rather than
   being that grid item itself — fieldsets have quirky intrinsic-size
   behavior in Chromium that ignores min-height:0 when they're a
   direct CSS Grid item, which silently breaks the 0fr collapse. */
.filter-dropdown__panel fieldset {
  border: 0;
  padding: 4px 0 20px;
  margin: 0;
}
/* Sits at the bottom of the filter sidebar (below Clear all filters,
   when present) rather than above the grid — mirrors the reference
   layout, where the result count reads as part of "here's what your
   filter selection turned up" rather than as a toolbar item next to
   Sort. */
.programs-result-count { font-weight: 700; font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text); margin-top: 4px; }

/* Explicit 3-column grid (not auto-fill) so the count of columns is
   deliberate and stable — 12 results per page (see posts_per_page in
   inc/program-archive-filters.php) divides evenly into exactly 4 rows
   at 3 columns. Narrower viewports step down to 2, then 1 column
   (see the responsive rules further down this file). */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.program-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.program-card:hover { border-color: var(--color-header-bg); }
.program-card__thumb { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; flex-shrink: 0; }
.program-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.program-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}
.program-card__title { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); }
.program-card__arrow { color: var(--color-accent); flex-shrink: 0; }

@media (max-width: 1199px) {
  .programs-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .programs-grid { grid-template-columns: 1fr; }
}

/* Search bar embedded in the Programs archive hero — same rounded
   white-field styling language as .search-modal__form, just laid
   out horizontally with the button attached instead of stacked in
   a modal. Part of the SAME <form> as the sidebar filters below
   (see archive-program.php) so a keyword and a filter selection can
   both be applied in one submit. */
.hero__search-wrap {
  /* Positioning anchor for .hero__search-results below — sized to
     the search bar itself (not .hero__content's wider 760px), so the
     dropdown lines up with the field it belongs to rather than
     stretching under the headline too. */
  position: relative;
  max-width: 620px;
  margin-top: 24px;
}
.hero__search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 8px 8px 8px 16px;
  box-shadow: 0 16px 32px rgba(16,25,43,0.25);
}
.hero__search-icon { flex-shrink: 0; color: var(--color-text-muted); }
.hero__search-form input {
  flex: 1;
  /* Flex items default to min-width:auto, which for a text input
     resolves to its browser-default intrinsic width (~200px) — that
     silently overrides flex:1's ability to shrink and is exactly
     what pushed .btn off the right edge on narrow screens. */
  min-width: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--color-text);
  background: transparent;
}
.hero__search-form input::placeholder { color: var(--color-text-muted); }
.hero__search-form .btn { flex-shrink: 0; white-space: nowrap; }

@media (max-width: 767px) {
  /* Below ~480px there's no longer room for the input and the
     "Find Programs" button on one row without either cutting the
     button off (pre-fix) or squeezing the input illegibly thin
     (post-fix, min-width:0 alone). Wrap onto two rows instead: input
     on top, full-width button below, both still inside the same
     white pill. */
  .hero__search-form { flex-wrap: wrap; }
  .hero__search-form input { flex-basis: 100%; }
  .hero__search-form .btn { flex: 1 1 100%; text-align: center; }
}

/* Live "type-ahead" results dropdown for the Programs archive hero
   search. Populated via AJAX by initProgramsLiveSearch() in script.js
   (see upsa_programs_live_search_ajax() in
   inc/program-archive-filters.php) as the visitor types — a fast
   "jump straight to a program" path that sits alongside, not instead
   of, the full keyword-submit search the form already supports. */
.hero__search-results {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  right: 0;
  z-index: 10; /* above .hero__overlay (2) / .hero__content (3); well below .search-modal (200) */
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 32px rgba(16,25,43,0.25);
  padding: 24px;
  max-height: 60vh; max-height: 60svh;
  overflow-y: auto;
}
.hero__search-results[hidden] { display: none; }
/* Single-column list rather than a multi-column grid — a 2-3 word
   program title reads fine in a grid, but real titles ("Bachelor of
   Science Computer Engineering") wrap awkwardly and get visually
   lost split across columns, so one column keeps every result
   scannable regardless of title length. */
.hero__search-results__list { display: flex; flex-direction: column; }
.hero__search-results__item {
  display: block;
  padding: 12px 4px;
  color: var(--color-red);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.hero__search-results__list .hero__search-results__item:last-child { border-bottom: 0; }
.hero__search-results__item:hover,
.hero__search-results__item.is-active {
  background: var(--color-bg-accent);
  color: var(--color-red-dark);
  text-decoration: underline;
}
.hero__search-results__empty,
.hero__search-results__loading {
  color: var(--color-text-muted);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  text-align: center;
  padding: 8px;
}

/* Sort control, now living inside .programs-topbar alongside the
   "Filter by…" label (see archive-program.php) rather than in its
   own toolbar above the grid. */
.programs-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  cursor: pointer;
}
.programs-sort svg { flex-shrink: 0; color: var(--color-text-muted); }
.programs-sort select {
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  /* Let the <select>'s own native value drive the width instead of a
     fixed one, so "Newest" and "Alphabetical (Z\u2013A)" both fit without
     the pill jumping size between options. */
}

.programs-filters__clear {
  display: inline-block;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-accent);
  margin-top: 4px;
}
.programs-filters__clear:hover { color: var(--color-accent-dark); text-decoration: underline; }

.programs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------
   Program Single page (single-program.php)
   --------------------------------------------------------- */

/* Intro band: breadcrumb + title + "Book your tour" banner on the
   left; a short summary + Degree Information / Areas of Study
   buttons on the right. Plain white section — the photo lives in its
   own card below, not as a hero background here. */
.program-intro-band { padding-block: 40px 32px; }
.program-intro-band__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.program-hero__breadcrumb { font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted); margin-bottom: 8px; }
.program-hero__breadcrumb--light a { color: inherit; }
.program-hero__breadcrumb--light a:hover { color: var(--color-accent); }
.program-intro-band__title { font-size: var(--fs-h2); line-height: var(--lh-h2); margin-bottom: 20px; }
.program-intro-band__right { padding-top: 8px; }
.program-intro-band__summary { font-size: var(--fs-body); line-height: var(--lh-body); margin-bottom: 20px; }
.program-intro-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* "Visit Carleton! Book your tour today." banner — sits under the
   title on the left side of the intro band (see
   program-tour-banner__dot for the small accent dot). */
.program-tour-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  color: var(--color-text);
}
.program-tour-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}
.program-tour-banner a { color: var(--color-red); text-decoration: underline; margin-left: 4px; }
.program-tour-banner a:hover { color: var(--color-red-dark); }

/* Photo card: the hero image, a tab bar docked to its bottom edge,
   and the dark Admission Requirements widget overlapping the seam
   between the two — position:relative anchor for the widget, which
   breaks out of the card's own rounded/clipped bounds so it can
   overlap both the photo and the tab bar without being clipped by
   either. */
.program-photo-card { position: relative; margin-bottom: 48px; }
.program-photo-card__media {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
  aspect-ratio: 2.2 / 1;
}
.program-photo-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.program-photo-card__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  background: var(--color-bg-accent);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 16px 32px;
}
.program-photo-card__tabs a { font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 600; color: var(--color-text); }
.program-photo-card__tabs a:hover { color: var(--color-accent); }

.program-admission-widget {
  position: absolute;
  right: 2rem;
  bottom: 0;
  transform: translateY(35%);
  width: min(300px, calc(100% - 4rem));
  background: var(--color-header-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 16px 32px rgba(16,25,43,0.35);
}
.program-admission-widget__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 12px;
}
.program-admission-widget__label svg { color: var(--color-accent-soft); flex-shrink: 0; }
.program-admission-widget__select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
  font: inherit;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  padding: 12px 12px;
  margin-bottom: 12px;
}
.program-admission-widget__select option { color: var(--color-text); }
.program-admission-widget__btn { width: 100%; text-align: center; }

/* Program Details (left) + sidebar (right). Left column is one
   continuous flow — Program at a Glance, Experiential Learning, What
   You Will Learn, What You Will Be Able to Do, then Career
   Possibilities — so the column's own content decides its height
   instead of a separate full-width section starting only once the
   (usually taller) sidebar finishes, which used to leave a large gap
   above it. Right column stacks Admission Requirements, the Program
   Video card, the Admission Team contact card, then the "Ready to
   apply?" CTA, in that order (see single-program.php). */
.program-detail {
  /* Extra top padding so the floating admission widget (which
     overhangs below .program-photo-card) has clear space above the
     "Program at a Glance" heading rather than overlapping it. */
  padding-top: 72px;
  /* Also the jump target for the "Program at a Glance" tab in
     .program-photo-card__tabs — scroll-margin-top (same pattern as
     .profile-section) keeps the sticky header from covering the
     heading when the browser scrolls to #program-details. */
  scroll-margin-top: calc(var(--header-h) + var(--audience-h) + 16px);
}
.program-detail__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
/* Every top-level section heading on this page — Program at a Glance,
   Admission Requirements, Experiential Learning, What You Will Learn,
   What You Will Be Able to Do, Career Possibilities, Course
   Structure — is an <h2> and gets the same top/bottom breathing room
   and size. ".program-detail__block > h2" covers the sidebar/left
   blocks that share that wrapper (Admission Requirements, Experiential
   Learning, What You Will Learn, What You Will Be Able to Do); Program
   at a Glance and Career Possibilities aren't wrapped in that div, so
   they're matched individually. See the matching rule on
   .program-courses-section__list h2 further down this file for the
   one that lives outside this block. */
.program-detail__main > h2,
.program-detail__block > h2,
.program-detail__block--careers > h2 {
  padding: 28px 0;
}
.program-detail__sidebar { display: flex; flex-direction: column; gap: 32px; }
/* Sub-headings within a block (e.g. "Sample Careers" under Career
   Possibilities) stay smaller than the block's own <h2>. */
.program-detail__block h3 { font-size: var(--fs-body); line-height: var(--lh-body); padding: 28px 0 8px; }
/* Anchor targets for the tabs in .program-photo-card__tabs — live
   inside .program-detail, whose own scroll-margin-top only guards the
   section's top edge, not these inner jump points further down the
   column. (#admission-requirements's heading padding comes from the
   ".program-detail__block > h2" rule above — this just adds the
   scroll offset.) */
#admission-requirements,
#experiential-learning,
#what-you-will-learn,
#what-you-will-be-able-to-do,
#career-possibilities,
#program-video {
  scroll-margin-top: calc(var(--header-h) + var(--audience-h) + 16px);
}

/* Career Possibilities — now the last block in the left column
   (.program-detail__block--careers) rather than its own full-width
   section, so it flows immediately after What You Will Be Able to Do
   instead of waiting for the sidebar to finish. Sample Careers tags
   and an optional supporting photo (stacked below the text — there's
   no second column to put it beside at this width) still use the
   same .program-careers-section__* class names. */
.program-careers-section__intro { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; margin-bottom: 16px; }
.program-careers-section__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.program-careers-section__image { margin-top: 24px; }
.program-careers-section__image img {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Course Structure — a photo on the left, a plain-list accordion
   (deliberately its OWN component rather than reusing .admission-card:
   the reference design is a flat hairline-divided list with a
   plus/minus toggle, not the bordered/boxed card style
   .admission-card uses) plus a "view more" link on the right. */
.program-courses-section__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.program-courses-section { scroll-margin-top: calc(var(--header-h) + var(--audience-h) + 16px); }
.program-courses-section__image img {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.program-courses-section__list h2 { padding: 28px 0; }
.program-courses-section__more { color: var(--color-text-muted); margin-bottom: 12px; }
.program-courses-section__more-link { color: var(--color-red); font-weight: 600; text-decoration: underline; }
.program-courses-section__more-link:hover { color: var(--color-red-dark); }

/* UPSA Accordion widget — reuses .course-accordion markup/classes
   above so it also reuses initCourseAccordion() in script.js as-is.
   .upsa-accordion__heading is the widget's own optional heading;
   it isn't part of the Program single markup, which supplies its
   own <h2> outside the accordion. */
.upsa-accordion__heading { padding: 28px 0; }

.course-accordion { margin-bottom: 32px; }
.course-accordion__item { border-bottom: 1px solid var(--color-border); }
.course-accordion__item:first-child { border-top: 1px solid var(--color-border); }
.course-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 0;
  text-align: left;
  font-weight: 700;
  font-size: var(--fs-body); line-height: var(--lh-body);
}
.course-accordion__header[disabled] { cursor: default; }
.course-accordion__icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--dur) var(--ease);
}
/* Plus rotates 45° into an "×" (functionally a minus, visually a
   close) once its panel is open. */
.course-accordion__header[aria-expanded="true"] .course-accordion__icon { transform: rotate(45deg); }

/* Same 0fr → 1fr grid-template-rows technique used by .admission-card__panel-wrap:
   animates open/closed without a hard-coded max-height. */
.course-accordion__panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.course-accordion__header[aria-expanded="true"] + .course-accordion__panel-wrap { grid-template-rows: 1fr; }
.course-accordion__panel { overflow: hidden; min-height: 0; }
.course-accordion__panel p {
  padding-bottom: 20px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 1199px) {
  .program-intro-band__grid { grid-template-columns: 1fr; }
  .program-admission-widget { position: static; transform: none; width: 100%; margin-top: 20px; }
  .program-photo-card__tabs { gap: 20px; }
  .program-detail { padding-top: 40px; }
  .program-detail__grid,
  .program-courses-section__grid {
    grid-template-columns: 1fr;
  }
  .program-courses-section__image { order: -1; }
}

/* Reusable full-width CTA banner — closes out the Program Single page,
   and generic enough to reuse on News Single / Event Single too. */
.cta-banner {
  background: var(--color-header-bg);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  color: var(--color-white);
}
.cta-banner h2 { font-size: var(--fs-lead); line-height: var(--lh-lead); margin-bottom: 8px; }
.cta-banner p { color: rgba(255,255,255,0.75); margin-bottom: 24px; }

/* Sidebar variant — used for the "Ready to apply?" CTA under the
   Admission Team card on Program single (see single-program.php).
   Same component, just narrower and left-aligned to fit the sidebar
   column instead of spanning the full page width. Background color
   and border-radius are set inline per-program from ACF (the "Ready
   to Apply CTA" tab), so they're deliberately left out of this rule. */
.cta-banner--sidebar {
  padding: 28px;
  text-align: left;
}
.cta-banner--sidebar .btn { width: 100%; text-align: center; }

/* ---------------------------------------------------------
   16. NEWS SINGLE & EVENT SINGLE ARTICLES
   (news-single.html, event-single.html)
   Shares .legal-content for prose body copy — same restored
   list/heading spacing used on the Privacy/Terms/Accessibility
   pages, since a news or event write-up is the same kind of
   long-form content.
   --------------------------------------------------------- */

.article-hero {
  position: relative;
  min-height: 46vh; min-height: 46svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--color-white);
}
.article-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,25,43,0.25) 0%, rgba(16,25,43,0.6) 55%, rgba(16,25,43,0.92) 100%);
}
.article-hero__content { position: relative; padding-block: 40px 44px; max-width: 820px; }
.article-hero__title { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 800; margin-top: 12px; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 20px 0 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: var(--color-text-muted);
}
.article-meta__item { display: flex; align-items: center; gap: 8px; }
.article-meta__item svg { color: var(--color-accent); flex-shrink: 0; }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.article-share { display: flex; flex-direction: column; gap: 8px; }
.article-share__label { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--color-text-muted); margin-bottom: 4px; }
.article-share a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.article-share a:hover { border-color: var(--color-accent); color: var(--color-accent); }

.event-detail-card {
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
  padding: 24px;
}
.event-detail-card dl { display: flex; flex-direction: column; gap: 16px; }
.event-detail-card dt { font-size: var(--fs-caption); line-height: var(--lh-caption); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--color-text-muted); margin-bottom: 4px; }
.event-detail-card dd { font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body); }
.event-detail-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------------------------------------------------------
   17. SCROLL-REVEAL ANIMATIONS
   Cards and key content blocks fade/rise into place the first
   time they scroll into view (script.js §2d, IntersectionObserver-
   driven). One-time only — elements stay visible once revealed
   rather than re-hiding on scrolling back past them, since
   re-triggering on every pass reads as gimmicky, not polished.
   Under prefers-reduced-motion, the global rule in §1 already
   collapses transition-duration to ~0 site-wide — so this still
   triggers on scroll, just instantly rather than animated, with
   no separate handling needed here.

   The actual .reveal / .reveal.is-visible rules live in §2 (Reset
   & Base) instead of here — they need to come before every card's
   own :hover rule in the cascade, or .reveal.is-visible's
   `transform: none` would win a specificity tie against things
   like .quick-card:hover and silently cancel the hover-lift effect
   on any card that's already revealed. See the comment there for
   the full explanation.
   --------------------------------------------------------- */

/* =========================================================
   18. RESPONSIVE BREAKPOINTS (mobile-first)
   Base styles above already work at mobile width; these
   queries progressively add/reveal desktop-only affordances.
   ========================================================= */

/* ≥ 640px — show the secondary audience-bar links */
@media (min-width: 768px) {
  .audience-bar__list--right { display: flex; }
}

/* ≥ 768px — reveal the header CTA button */
@media (min-width: 768px) {
  .site-header__cta { 
    display: inline-flex; 
    width: 110px;
  }
}

/* < 1200px — collapse primary nav into an off-canvas mobile panel,
   toggled by the hamburger button via a JS-added .is-open class.
   (Was 899/900px — measured too narrow for this nav: 6 top-level
   items including "Current Students" and "Staff & Faculty" need
   roughly 750px on their own, and there's only ~520px actually
   available at 900px once the brand block and header actions take
   their share — a real overflow, not a marginal rounding case.) */
@media (max-width: 1199px) {
  .hamburger { display: grid; }

  .primary-nav {
    position: fixed;
    top: calc(var(--header-h) + var(--audience-h));
    left: 0; right: 0;
    bottom: 0;
    /* Comfortably above every other z-indexed element site-wide
       (.search-modal at 200 is the next-highest) and — just as
       importantly — an explicit z-index here (rather than the
       default `auto`) makes .primary-nav establish its OWN isolated
       stacking context, so unrelated z-indexed elements elsewhere on
       the page (e.g. the hero carousel's arrow controls) can never
       paint on top of the open mobile menu. */
    z-index: 300;
    background: var(--color-white);
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    border-top: 0; /* the header's own bottom border is the line between them */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* the whole panel scrolls as one unit — both .primary-nav__levels and .mobile-nav-utility below — so a short menu just sits at its natural height instead of one part stretching to fill the panel and leaving a gap before the other */
  }
  .primary-nav.is-open { transform: translateX(0); }

  /* Menu open: the header (logo, search, menu button) stays pinned at the
     top and the panel continues straight below it on the same white, with
     no dividing line — header and menu read as one sheet. The audience bar
     is covered. script.js adds .upsa-nav-open to <body> and sets the
     panel's top to the header's bottom edge. */
  body.upsa-nav-open .site-header {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0; right: 0;
    z-index: 310; /* above the panel (300) */
    transform: none !important; /* never auto-hidden while the menu is open */
    transition: none;
    border-bottom-color: transparent;
    box-shadow: none;
  }
  /* WordPress's admin bar stops being fixed at 600px and below, so the header goes to the very top there. */
  @media (max-width: 600px) { body.upsa-nav-open .site-header { top: 0; } }
  /* The panel itself covers the whole screen from the very top (under the
     header), so no page content — or the sticky section nav — can ever show
     between header and menu; its links start below the header (padding-top
     set by script.js). */
  body.upsa-nav-open .primary-nav { top: 0 !important; }
  .admin-bar.upsa-nav-open .primary-nav { z-index: 300; }

  /* Apply Now inside the menu (the header button is hidden on phones). */
  .mobile-nav-cta { padding: 24px var(--wrap-pad) 8px; }
  @media (min-width: 768px) { .mobile-nav-cta { display: none; } } /* the header shows its own Apply Now from here */
  .mobile-nav-cta .btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: var(--control-h);
    border-radius: var(--radius-sm);
    background: var(--color-red); color: var(--color-white);
    font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600;
    text-decoration: none;
  }
  .mobile-nav-cta .btn:hover, .mobile-nav-cta .btn:focus-visible { background: var(--color-red-dark); color: var(--color-white); }

  /* Quick links under Apply Now (1.24.2) */
  .mobile-nav-aud { padding: 16px var(--wrap-pad) 20px; }
  .mobile-nav-aud__label { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--color-text-muted); }
  .mobile-nav-aud ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-nav-aud li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mobile-nav-aud a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 48px; padding: 10px 14px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: #f6f7fa; color: var(--color-red);
    font-size: var(--fs-ui); line-height: 1.25; font-weight: 600; text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
  }
  .mobile-nav-aud a svg { flex: none; color: #8a5a00; }
  .mobile-nav-aud a:hover, .mobile-nav-aud a:focus-visible { background: var(--color-red); border-color: var(--color-red); color: #fff; }
  .mobile-nav-aud a:hover svg, .mobile-nav-aud a:focus-visible svg { color: #ffb606; }

  /* No separate in-panel close bar — the header hamburger button
     itself morphs into an X (see .hamburger[aria-expanded="true"]
     above) and toggles the panel closed, matching the UPenn
     reference. The accordion pattern below also doesn't need a Back
     control, since expanding a submenu never replaces the screen,
     it just grows the list in place. */

  .primary-nav__levels {
    flex: 0 0 auto; /* sized to its own content, not stretched to fill the panel (that stretching is what left an empty gap above .mobile-nav-utility on short menus) */
  }

  .primary-nav__list {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }
  .primary-nav__list a,
  .primary-nav__list > li > a {
    /* `> li > a` too: the base desktop rule (.primary-nav__list > li > a —
       inline-flex, 8px 0 padding) is more specific than a plain
       `.primary-nav__list a`, so without it top-level links lost their
       row padding and full-width divider in the mobile panel. */
    display: flex;
    align-items: center;
    padding: 16px var(--wrap-pad);
    border-bottom: 1px solid var(--color-border);
  }
  .primary-nav__list > li > a::after { display: none; } /* underline hover doesn't apply in stacked mobile nav */

  /* Accordion trigger row: label on the left, toggle chevron on the
     right — expanding it grows the list in place (the submenu is
     just normal in-flow content, shown/hidden via the `hidden`
     attribute; see .nav-dropdown below), pushing whatever comes
     after it further down the page, the way a native <details>
     element would.

     .has-dropdown is `display:flex` globally (see base rule above)
     so the label and its chevron toggle sit in a row together. On
     desktop that's fine because .nav-dropdown becomes `position:
     absolute` and drops out of flow — but on mobile the submenu is a
     normal in-flow child of that same flex row, so without a wrap it
     gets squeezed into whatever horizontal space is left over next
     to the trigger row instead of dropping onto its own line below.
     `flex-wrap: wrap` + forcing the submenu to full width is what
     makes it wrap onto a new row underneath, the way an accordion
     should. */
  .has-dropdown {
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
  }
  .has-dropdown > .nav-dropdown {
    flex: 1 0 100%;
    width: 100%;
  }
  .has-dropdown > a,
  .primary-nav__list > li.has-dropdown > a,
  .has-dropdown > .nav-dropdown-toggle {
    border-bottom: 0; /* .has-dropdown itself supplies the row's bottom border now */
  }
  .has-dropdown > .nav-top-link {
    flex: 1; /* link takes the remaining row width; icon-only toggle stays compact */
  }
  /* .primary-nav prefix: outranks generic button resets (e.g. Elementor's
     [type=button] padding) so the label lines up with the other rows. */
  .primary-nav .nav-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    margin: 0;
    padding: 16px var(--wrap-pad);
    border: 0;
    border-radius: 0;
    background: none;
  }
  .primary-nav .nav-dropdown-toggle--icon-only {
    width: auto;
    flex: 0 0 auto;
    padding: 16px var(--wrap-pad);
  }
  .nav-dropdown-toggle::after { display: none; }

  /* Chevron flips to point up, inside a filled circle, while
     expanded — the same "active" treatment as the reference design.
     Equal selector specificity to the base rotate(180deg) open-state
     rule further up this file, so this wins by appearing later in
     the cascade; the base rule already does the "point up when open"
     rotation, this just adds the circle backdrop on top of it. */
  .nav-dropdown-toggle__chevron {
    border-radius: 50%;
    padding: 7px;
    box-sizing: content-box;
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-toggle__chevron {
    background: var(--color-bg-accent);
  }

  /* The submenu itself: plain in-flow content, shown/hidden via the
     native `hidden` attribute — no special positioning at all. This
     IS the whole accordion mechanism; the open/close animation is
     just the browser's normal reflow, same as expanding a <details>
     element. Left-aligned flush with the top-level items (same
     var(--wrap-pad) inset, no added indent) — matching the UPenn
     reference, where sub-items sit directly under their parent
     rather than being nested further to the right. */
  .nav-dropdown {
    padding: 4px 0 8px 0;
  }
  .nav-dropdown a {
    padding: 12px var(--wrap-pad);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-body); line-height: var(--lh-body);
  }
  .nav-dropdown li:last-child a { border-bottom: 0; }

  /* Secondary utility list (Current Students, Faculty & Staff, etc.)
     folded into the bottom of the mobile menu — lighter weight than
     the primary nav items above it, no chevrons, matching the
     reference design's secondary section. */
  .mobile-nav-utility {
    border-top: 0; /* the last menu row already draws this line */
    padding: 8px 0;
  }
  .mobile-nav-utility ul { display: flex; flex-direction: column; }
  .mobile-nav-utility a {
    display: block;
    padding: 12px var(--wrap-pad);
    font-size: var(--fs-ui); line-height: var(--lh-ui);
    font-weight: 400;
    color: var(--color-text-muted);
  }
}


/* ≥ 1200px — hamburger no longer needed; nav sits inline via flexbox */
@media (min-width: 1200px) {
  .hamburger { display: none; }
  .primary-nav {
    display: flex;
    align-items: center;
    position: static;
    transform: none;
    border: 0;
  }

  /* .mobile-nav-utility (Current Students / Faculty & Staff / etc.,
     folded into the bottom of the off-canvas mobile menu) has no
     display rule of its own outside the mobile media query, and
     .primary-nav itself had no explicit `display` at this width
     either — so it fell back to a plain block-level <nav>, stacking
     .primary-nav__levels and .mobile-nav-utility as two full-width
     blocks instead of hiding the second one, and overlapping into
     the header/hero below it. Those same links are already shown in
     the always-visible audience bar above the header, so on desktop
     this duplicate simply isn't needed. */
  .mobile-nav-utility { display: none; }
  .mobile-nav-cta { display: none; }
  .mobile-nav-aud { display: none; }

  /* Desktop: the submenu becomes a floating panel anchored to its trigger */
  .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    margin-top: 8px;
    min-width: 230px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(18,18,18,0.14);
    padding: 8px;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
  }
  .nav-dropdown:not([hidden]) {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  /* ---------------------------------------------------------
     MEGA MENU — full-width dropdown panel (desktop only)
     ---------------------------------------------------------
     .has-mega-menu drops the `position: relative` its <li>
     otherwise gets (see .primary-nav__list > li, top of this
     file) so .nav-dropdown--mega's `position: absolute` skips
     right past it and resolves against .site-header instead —
     .site-header is `position: sticky` (see §4), which counts as
     a positioned ancestor, and it already spans the full site
     width. That's what lets `left: 0; right: 0;` below break the
     panel out to full width regardless of where its trigger sits
     in the nav bar. */
  .primary-nav__list > li.has-mega-menu { position: static; }

  .nav-dropdown--mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    background: var(--color-white);
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: 0 24px 48px rgba(18,18,18,0.14);
    padding: 0;
    transform: none;
  }
  .nav-dropdown--mega:not([hidden]) { transform: none; }

  .nav-dropdown__media {
    display: block;
    position: relative;
  }
  .nav-dropdown__media img,
  .nav-dropdown__media video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md);
  }
  .nav-dropdown__media-toggle {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    color: var(--color-white);
    cursor: pointer;
  }
  .nav-dropdown__media-toggle:hover,
  .nav-dropdown__media-toggle:focus-visible {
    background: rgba(0,0,0,0.75);
  }
  /* Exactly one icon at a time, driven off aria-pressed (which JS is
     the only thing that ever changes) rather than toggling the
     `hidden` attribute on each <svg> — one boolean switch instead of
     two things that have to stay in sync. aria-pressed="true" means
     "currently playing" (see inc/class-nav-walker.php's default
     markup and initMegaMenuVideoToggle() in script.js), so the pause
     icon is the default state and the play icon is the exception. */
  .nav-dropdown__media-toggle .icon-play { display: none; }
  .nav-dropdown__media-toggle[aria-pressed="false"] .icon-pause { display: none; }
  .nav-dropdown__media-toggle[aria-pressed="false"] .icon-play { display: block; }
  /* Scrim: dims the page below the open panel (the shadow is clipped so
     it never covers the header above). Purely visual — clicking outside
     still closes the panel through script.js. */
  .nav-dropdown--mega:not([hidden]) {
    box-shadow: 0 24px 48px rgba(41, 52, 75,0.16), 0 0 0 100vmax rgba(41, 52, 75,0.28);
    clip-path: inset(0 -100vmax -100vmax -100vmax);
  }

  /* Three columns: intro (title, description, Explore link) · links ·
     optional media. Without media the links take the extra width. */
  .nav-dropdown__inner {
    display: grid;
    grid-template-columns: minmax(220px, 3fr) 9fr;
    align-items: start;
    max-width: var(--wrap-max);
    margin-inline: auto;
    gap: 48px;
    padding: 48px var(--wrap-pad) 56px;
  }
  .nav-dropdown__inner--with-media {
    grid-template-columns: minmax(200px, 3fr) 6fr minmax(260px, 3fr);
  }

  /* 1. Intro */
  .nav-dropdown__intro { display: block; position: relative; padding-top: 20px; }
  .nav-dropdown__intro::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 32px; height: 2px; background: var(--color-accent-soft);
  }
  .nav-dropdown__heading {
    display: block;
    margin: 0;
    font-family: var(--font-serif);
    font-weight: var(--fw-display, 600);
    font-size: var(--fs-h3); line-height: var(--lh-h3);
    letter-spacing: var(--tracking-display);
    color: var(--color-text);
  }
  .nav-dropdown__lead {
    margin: 12px 0 0;
    font-size: var(--fs-body); line-height: var(--lh-body);
    color: var(--color-text-muted);
  }
  .nav-dropdown--mega a.nav-dropdown__all {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 24px; padding: 0;
    font-size: var(--fs-ui); line-height: var(--lh-ui); font-weight: 500;
    color: var(--color-accent);
    border-radius: 0;
  }
  .nav-dropdown--mega a.nav-dropdown__all:hover,
  .nav-dropdown--mega a.nav-dropdown__all:focus-visible {
    background: none; color: var(--color-accent-dark);
    text-decoration: underline; text-underline-offset: 4px;
  }
  .nav-dropdown__all .nav-dropdown__arrow { transition: transform var(--dur) var(--ease); }
  .nav-dropdown__all:hover .nav-dropdown__arrow { transform: translateX(3px); }

  /* 2. Links — rows with a hairline between them, two columns. */
  .nav-dropdown__links { min-width: 0; }
  .nav-dropdown--mega .sub-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    border-top: 1px solid var(--color-border);
  }
  .nav-dropdown__inner:not(.nav-dropdown__inner--with-media) .sub-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-dropdown--mega .sub-menu > li { border-bottom: 1px solid var(--color-border); }
  .nav-dropdown--mega .sub-menu > li > a {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    height: 100%;
    min-height: 64px;
    padding: 16px 12px;
    border-radius: 0;
    color: var(--color-text);
  }
  .nav-dropdown__text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
  .nav-dropdown__label {
    font-family: var(--font-serif);
    font-size: 20px; line-height: 26px;
  }
  .nav-dropdown__desc {
    display: block;
    font-size: var(--fs-ui); line-height: var(--lh-ui);
    color: var(--color-text-muted);
  }
  .nav-dropdown--mega .sub-menu > li > a .nav-dropdown__arrow {
    flex: none; color: var(--color-accent);
    opacity: 0; transform: translateX(-6px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .nav-dropdown--mega .sub-menu > li > a:hover,
  .nav-dropdown--mega .sub-menu > li > a:focus-visible { background: var(--color-paper); color: var(--color-text); }
  .nav-dropdown--mega .sub-menu > li > a:hover .nav-dropdown__label,
  .nav-dropdown--mega .sub-menu > li > a:focus-visible .nav-dropdown__label { color: var(--color-accent); }
  .nav-dropdown--mega .sub-menu > li > a:hover .nav-dropdown__arrow,
  .nav-dropdown--mega .sub-menu > li > a:focus-visible .nav-dropdown__arrow { opacity: 1; transform: none; }
  .nav-dropdown--mega .sub-menu > li > a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
  .nav-dropdown--mega .sub-menu > li.is-current > a .nav-dropdown__label { color: var(--color-accent); }
  .nav-dropdown--mega .sub-menu > li.is-current > a .nav-dropdown__arrow { opacity: 1; transform: none; }

  /* A child with its own children: a titled group with plain links. */
  .nav-dropdown--mega .nav-dropdown__arrow { display: block; }
  .nav-dropdown--mega .sub-menu > li.nav-dropdown__group > a .nav-dropdown__arrow { display: none; }
  .nav-dropdown--mega .nav-dropdown__group .sub-menu {
    display: block; border-top: 0; padding: 0 0 16px;
  }
  .nav-dropdown--mega .nav-dropdown__group .sub-menu li { border: 0; }
  .nav-dropdown--mega .nav-dropdown__group .sub-menu a {
    display: block; padding: 6px 0; border-radius: 0;
    font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--color-text-muted);
  }
  .nav-dropdown--mega .nav-dropdown__group .sub-menu a:hover,
  .nav-dropdown--mega .nav-dropdown__group .sub-menu a:focus-visible { background: none; color: var(--color-accent); text-decoration: underline; text-underline-offset: 4px; }

  /* 3. Media */
  .nav-dropdown__media img,
  .nav-dropdown__media video { aspect-ratio: 4 / 3; }

  /* Open motion: links settle in after the panel. */
  @media (prefers-reduced-motion: no-preference) {
    .nav-dropdown--mega:not([hidden]) .nav-dropdown__inner > * { animation: upsa-mega-in 260ms var(--ease) both; }
    .nav-dropdown--mega:not([hidden]) .nav-dropdown__links { animation-delay: 40ms; }
    .nav-dropdown--mega:not([hidden]) .nav-dropdown__media { animation-delay: 80ms; }
  }
  @keyframes upsa-mega-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Small phones — tighten hero and section spacing */
@media (max-width: 767px) {
  .hero { min-height: 88vh; min-height: 88svh; }
  .news__header { align-items: flex-start; }
  .news__filters { flex-wrap: wrap; }
}

/* < 860px — stack the two-column Events/Feature and Attend/Admissions
   sections into a single column; the events list and pathway cards
   read fine top-to-bottom, they just need the room. */
@media (max-width: 1199px) {
  .events-feature__grid,
  .attend__grid {
    grid-template-columns: 1fr;
  }
  .events-feature__col + .events-feature__col { margin-top: 40px; }
  .attend__grid { gap: 32px; }
}

@media (max-width: 1199px) {
  .people-grid { grid-template-columns: repeat(3, 1fr); }
}

/* < 900px — stack the remaining sidebar+content layouts (Programs
   Archive, article pages) into a single column. Sticky sidebars only
   make sense once there's real vertical room to scroll past them.
   (Faculty Profile's own mobile treatment — .profile-nav becoming a
   horizontal tab strip, .profile-summary stacking — lives right next
   to its base rules further up this file, not here, since it needs
   more than a blanket grid-template-columns:1fr reset.) */
@media (max-width: 1199px) {
  .profile-layout,
  .programs-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .programs-filters { position: static; }
  .program-intro__grid { grid-template-columns: 1fr; }
  .programs-topbar { flex-wrap: wrap; }
  .hero__search-wrap { max-width: 100%; }
  .directory-toolbar { grid-template-columns: 1fr 1fr; }
  .directory-toolbar .btn { grid-column: 1 / -1; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .directory-toolbar { grid-template-columns: 1fr; }
  /* Single column, not auto-fill(minmax(150px,...)) — at this width
     150px still fits two narrow columns side by side, which is
     exactly the cramped 2-up layout this is meant to avoid. */
  .people-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   ELEMENTOR WIDGET ADDITIONS
   New component added for the UPSA: Stat Band widget.
   Not present in the original static site — follows the same
   CSS-variable design system as everything above.
   --------------------------------------------------------- */
.stat-band {
  background: var(--color-header-bg);
  padding: 48px 0;
}
.stat-band__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  text-align: center;
}
.stat-band__item { display: flex; flex-direction: column; gap: 4px; }
.stat-band__number {
  font-family: var(--font-display);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  color: var(--color-accent-soft);
}
.stat-band__label {
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  color: rgba(255,255,255,0.75);
}

/* Static single-image hero variant used by the UPSA: Hero widget
   on interior pages (as opposed to the homepage's multi-slide video
   hero, which keeps its own .hero__slides markup). */
.hero--static .hero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

/* .hero--static inherits the base .hero's min-height: 78vh (and, on
   phones, the 88vh bump from the max-width:480px query above) —
   sized for the homepage's full-bleed video carousel, not for a
   single/archive page's title banner. On a tall, narrow phone
   viewport that forces the section itself to be nearly the full
   screen height; combined with object-fit:cover on .hero__bg, the
   image then has to crop away most of its width to fill that
   height, cutting into the subject instead of just being a header
   band. Giving this variant its own, shorter, responsive heights —
   tallest on desktop where the crop is mild, shortest on small
   phones where it's most severe — keeps it acting like a banner
   instead of a second full-screen section. Same-specificity rules
   (single class each) so source order after the .hero override
   above is what makes these win at each width. */
.hero--static {
  min-height: 56vh; min-height: 56svh;
}
@media (max-width: 1199px) {
  .hero--static { min-height: 46vh; min-height: 46svh; }
}
@media (max-width: 767px) {
  .hero--static { min-height: 40vh; min-height: 40svh; }
}

/* Shorter banner option for the UPSA: Page Title widget — used on
   interior pages where a full 78vh hero (see .hero above) is more
   than a simple title/sub-text banner needs. */
.hero--compact {
  min-height: 30vh; min-height: 30svh;
}

/* ---------------------------------------------------------------
   UPSA: PAGE TITLE ALT — split-screen banner (photo one half,
   solid-color text panel the other), separate from .hero/.hero--
   static above. Desktop is a plain 50/50 flex row; .page-title-alt--
   photo-right just flips which side the photo starts on via
   flex-direction: row-reverse rather than reordering the actual
   markup. On mobile the two panels stack — photo on top, text panel
   below, matching normal DOM order — unless .page-title-alt--
   reverse-mobile is present (the widget's own "Reverse Columns on
   Mobile" toggle), which flips that stacked order specifically at
   mobile width without touching the desktop row above.
   --------------------------------------------------------------- */
.page-title-alt {
  display: flex;
  min-height: 60vh; min-height: 60svh;
  background: var(--color-header-bg);
}
.page-title-alt--photo-right {
  flex-direction: row-reverse;
}

.page-title-alt__media {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  overflow: hidden;
}
.page-title-alt__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-title-alt__content {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(32px, 5vw, 64px);
}
.page-title-alt__inner {
  max-width: 640px;
}
.page-title-alt__title {
  font-family: var(--font-serif);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  color: var(--color-white);
  margin: 0 0 16px;
}
.page-title-alt__sub {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 58ch;
}

@media (max-width: 767px) {
  .page-title-alt,
  .page-title-alt--photo-right {
    flex-direction: column;
    min-height: 0;
  }
  .page-title-alt--reverse-mobile {
    flex-direction: column-reverse;
  }
  .page-title-alt__media {
    aspect-ratio: 4 / 3;
    flex: none;
    width: 100%;
  }
  .page-title-alt__content {
    padding: 28px 20px;
    align-items: flex-start;
  }
}
@media (min-width: 1200px) {
  .hero--compact { min-height: 36vh; min-height: 36svh; }
}

/* UPSA: Admission Card — accordion list of admission tracks
   (Undergraduate, Graduate, Continuing Studies, etc.). Each row is a
   bordered card with a colored left accent bar (--admission-accent,
   set per-card via inline style from the editor's color picker), a
   title + one-line description in the always-visible header, and a
   chevron that expands the card to reveal a list of sub-links.

   The expand/collapse height animation uses the CSS-grid "0fr → 1fr"
   technique: .admission-card__panel-wrap is a grid container whose
   single row is 0fr collapsed / 1fr open, transitioned; the actual
   content (.admission-card__panel) just needs overflow:hidden. This
   animates smoothly to the content's natural height without JS ever
   having to measure or set a pixel height — see initSingleAdmission-
   Cards() in script.js, which only ever toggles the .is-open class. */
.admission-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admission-card {
  --admission-accent: var(--color-accent);
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  overflow: hidden;
}
.admission-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--admission-accent);
}

.admission-card__header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  padding: 24px 28px 24px 32px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
/* Card with no sub-links (see class-admission-card-widget.php) — a
   plain <div>, not a <button>, so it's not focusable/clickable and
   shouldn't look like it is. */
.admission-card__header--static { cursor: default; }
.admission-card__header-text { display: flex; flex-direction: column; gap: 8px; }
.admission-card__title {
  font-family: var(--font-display);
  font-size: var(--fs-lead); line-height: var(--lh-lead);
  font-weight: var(--fw-display, 600);
  color: var(--color-text);
}
.admission-card__desc { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 600; color: var(--color-text-muted); }

.admission-card__chevron {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--color-text-muted);
  transition: transform var(--dur) var(--ease);
}
.admission-card.is-open .admission-card__chevron { transform: rotate(180deg); }

.admission-card__panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease);
}
.admission-card.is-open .admission-card__panel-wrap { grid-template-rows: 1fr; }

.admission-card__panel { overflow: hidden; min-height: 0; }
.admission-card__links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 28px 32px 32px;
}
.admission-card__links a {
  display: inline-block;
  font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--color-text);
  transition: color var(--dur) var(--ease);
}
.admission-card__links a:hover { color: var(--color-accent); }

@media (max-width: 767px) {
  .admission-card__header { padding: 20px 20px 20px 24px; }
  .admission-card__links { padding: 0 20px 24px 24px; gap: 20px; }
}

/* UPSA: Welcome Card — a heading above a single card: a poster
   image with a Play button that swaps in the video inline, inside
   this same panel (see footer.php removal / initInlineVideoCards()
   in script.js), then a title (optionally a link out to a post/page)
   and a short description below it. */
.welcome-card__heading {
  font-family: var(--font-display);
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  font-weight: var(--fw-display, 600);
  color: var(--color-text);
  margin-bottom: 24px;
}

.welcome-card__panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  overflow: hidden;
}

.welcome-card__media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-accent);
}
.welcome-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The inline player that replaces the poster image + Play button
   once clicked — same fill/positioning as .welcome-card__image so it
   drops into the same 16:9 container without a layout shift. */
.welcome-card__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.welcome-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  background: var(--color-red);
  color: var(--color-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.welcome-card__play svg { margin-left: 3px; } /* optically center the play triangle within the circle */
.welcome-card__play:hover { background: var(--color-red-dark); transform: translate(-50%, -50%); }

.welcome-card__body { padding: 32px; }
.welcome-card__title {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-lead); line-height: var(--lh-lead);
  font-weight: var(--fw-display, 600);
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 8px;
}
a.welcome-card__title:hover { color: var(--color-accent); }
.welcome-card__desc {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-muted);
  margin-bottom: 20px;
}
.welcome-card__divider {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-red);
}

@media (max-width: 767px) {
  .welcome-card__body { padding: 24px; }
  .welcome-card__play { width: 60px; height: 60px; }
}

/* ---------------------------------------------------------
   19. UTILITIES
   --------------------------------------------------------- */

/* .u-sticky-col — drop this on any Elementor column (Advanced tab →
   CSS Classes) to pin it in place while the rest of the row scrolls
   past — the common "sticky sidebar next to long content" pattern.
   `top` accounts for this theme's own sticky site-header + audience
   bar (see .profile-nav / .programs-filters above, which use the
   same calc()) so the column settles just below them instead of
   scrolling up underneath and being hidden. `align-self: start` is
   the other half of the trick: a flex/grid row stretches its
   children to equal height by default, and a stretched item has no
   room left to actually move within its own box — this opts the
   column out of that stretch so it's free to stick.
   Note: the parent Elementor row/column container (and everything
   above it up the DOM) must not have `overflow: hidden` — that
   clips sticky positioning, which is the most common reason a
   sticky column silently doesn't stick. */
.u-sticky-col {
  position: sticky;
  top: calc(var(--header-h) + var(--audience-h) + 1.5rem);
  align-self: start;
}

/* Below the 1024px breakpoint the primary nav collapses off-canvas
   and no longer competes for header height, but the sticky site
   header + audience bar are still both present, so the offset stays
   the same — no override needed here. Turn sticky off entirely on
   small screens instead, where a pinned sidebar column usually just
   eats scroll space above the content that matters: */
@media (max-width: 767px) {
  .u-sticky-col {
    position: static;
  }
}

/* .u-parallax — drop this on any Elementor Section/Container (Advanced
   tab → CSS Classes) that already has a Background Image OR a
   Background Video set (Style tab → Background → Classic/Image, or
   Video). JS (see initParallaxBackgrounds() in script.js) detects
   whichever one is present and animates it as the page scrolls — the
   real "background moves slower than foreground" effect, not the
   cheaper background-attachment:fixed trick (which iOS Safari doesn't
   support at all, and which moves the image in lockstep with the
   viewport rather than at a distinct rate).

   Image backgrounds: JS moves the background-image into a dedicated
   oversized layer (.u-parallax__bg below) behind the content and
   animates that layer's position.

   Video backgrounds: Elementor already renders its own
   '.elementor-background-video-container' (self-hosted <video> or a
   YouTube/Vimeo embed) sized to cover the section; JS reuses that
   container directly rather than creating a new layer — see
   .u-parallax__video-layer below for the overshoot this needs.

   The container needs position:relative + overflow:hidden so the
   oversized background layer (sized taller than the container so it
   has room to shift without exposing an edge) stays clipped to the
   section's own bounds; JS applies both automatically; the
   position/overflow here are the pre-JS fallback so nothing looks
   broken for a split second before script.js runs, or if it doesn't
   run at all (e.g. JS disabled) — in that case the section simply
   keeps its normal, static background (image or video) instead of
   animating.
   Respects prefers-reduced-motion: reduce (see script.js) — the
   background still shows, it just doesn't move. */
.u-parallax {
  position: relative;
  isolation: isolate;
  /* !important because this specific property MUST win against
     Elementor's own per-element CSS (`.elementor-element.elementor-
     element-{id}`, a two-class selector that outranks this one-class
     rule) — without it, Elementor's own overflow value (frequently
     "visible") lets .u-parallax__bg's oversized 130%/-15% layer spill
     out past this section's own box into the sections before/after
     it. Because a positioned element like this one always paints
     *above* ordinary static-flow siblings regardless of DOM order,
     that spillover was covering the neighboring sections instead of
     sitting harmlessly behind them.
  */
  overflow: hidden !important;
}
.u-parallax__bg {
  position: absolute;
  left: 0;
  right: 0;
  top: -15%;
  height: 130%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  will-change: transform;
  pointer-events: none;
}
/* Elementor's own video-background container is already
   position:absolute; inset:0, sized/centered by Elementor's own
   script to cover the section — it doesn't leave itself any spare
   edge the way .u-parallax__bg's 130%/-15% sizing does above, so a
   static scale(1.25) overshoot is added here as the pre-JS fallback
   (matches the scale JS bakes into every scroll-driven transform it
   writes, so there's no jump once JS takes over). */
.u-parallax__video-layer { transform: scale(1.25); will-change: transform; }
/* Elementor wraps a Container/Section's actual widgets in its own
   inner wrapper div, which — being a normal, later element in the
   DOM than the __bg layer script.js prepends — already paints on top
   without needing a z-index bump. This rule is a defensive fallback
   for the rare case content sits in a plain child that isn't
   automatically stacked above an absolutely-positioned z-index:0
   sibling. */
.u-parallax > *:not(.u-parallax__bg) { position: relative; z-index: 1; }

/* .u-sticky-reveal — the "stanford.edu/academics" pinned-intro effect
   from the screen recording: a full-bleed photo or video sits behind
   everything, already sized to fill the viewport from the very start
   — it never grows, zooms, or moves. A heading + featured-story strip
   with its own solid background sits pinned on TOP of that media as
   the visitor scrolls, and FADES OUT (with a slight upward drift)
   rather than scrolling away with the page, gradually uncovering the
   media that was there the whole time. Scrolling back up brings the
   strip back. Once it's fully faded, the pin releases and normal
   scrolling continues into whatever section comes next. This is a
   different mechanism from .u-parallax above (nothing here moves at
   a different rate — one layer is static, the other fades/pins) so
   it's a separate utility rather than an option on that one.

   REQUIRED STRUCTURE — build this with three nested Elementor
   Containers:

     .u-sticky-reveal                 <- outer wrapper. Give it an
                                          explicit tall Min Height on
                                          its Layout tab (e.g. 220vh)
                                          — this is what gives the
                                          pin somewhere to hold before
                                          it releases into the next
                                          section. Taller = longer the
                                          video stays fully revealed
                                          before the page moves on.
       .u-sticky-reveal__pin          <- inner Container, one level
                                          in. This becomes the
                                          sticky/pinned element itself
                                          — leave its own height at
                                          default, the CSS below sets
                                          it to 100vh.
         .u-sticky-reveal__media      <- an Image or Video widget (or
                                          its wrapping Container),
                                          sized to fill the pin
                                          completely behind everything
                                          else in it.
         .u-sticky-reveal__header     <- the heading + news-card row,
                                          needs ITS OWN solid
                                          background (white/gray/etc.)
                                          so it fully covers the media
                                          until the point it's faded.

   Optional: a data-fade-fraction="0.5" attribute (Advanced → Custom
   Attributes) on the OUTER .u-sticky-reveal element controls how much
   of the pinned scroll distance the header takes to fully fade —
   0.5 (the default) means it's gone by the halfway point, leaving the
   back half of the scroll as pure full-bleed media before it unpins.

   IMPORTANT — position: sticky's one real gotcha: none of
   .u-sticky-reveal's ANCESTORS (a parent Section/Container further
   up the page) can have "overflow" set to anything but visible, or
   the browser silently breaks the sticky behavior. The overflow:
   hidden .u-sticky-reveal__pin sets on ITSELF below is fine — it's
   only ancestors of the sticky element that matter, not the sticky
   element itself.

   Respects prefers-reduced-motion: reduce (see initStickyReveal() in
   script.js) — the header simply doesn't animate; it's shown at
   its normal, fully-opaque, authored position throughout. */
.u-sticky-reveal { position: relative; }
.u-sticky-reveal__pin {
  position: sticky;
  top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.u-sticky-reveal__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.u-sticky-reveal__media img,
.u-sticky-reveal__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.u-sticky-reveal__header {
  position: relative;
  z-index: 1;
  will-change: opacity, transform;
}

/* .u-sticky — plain CSS `position: sticky` for a single column/
   container (Advanced tab → "Sticky (UPSA)" → Enable Sticky): it
   pins in place and stays on screen while its siblings keep
   scrolling past, then releases and scrolls away normally once its
   parent row runs out of extra height. Top offset and z-index come
   from that same panel as an inline style per-instance, since they're
   reasonably tuned per element (this theme's fixed header + audience
   bar mean most uses want ~100px, but a sticky element nested lower
   on the page, inside another sticky/offset context, may want less).

   align-self: flex-start is the actual load-bearing part inside an
   Elementor Container (a flexbox row): Elementor containers default
   their cross-axis alignment to "stretch", which would make this
   column exactly as tall as its tallest sibling — already fully
   "used up" the moment the row renders, leaving no shorter box that
   scroll can carry past. flex-start lets it size to its own content
   instead, which is what actually gives sticky something to do. This
   is a no-op on legacy Section/Column (block layout, not flex), so
   it's harmless to apply there too.

   Same gotcha as .u-sticky-reveal above: none of this element's
   ANCESTORS can have overflow: hidden set, or sticky positioning is
   silently cancelled for the whole chain — that's a CSS spec rule,
   not something either utility can work around.

   !important on both properties here too, matching the inline style
   the widget-panel toggle also sets (see upsa_render_sticky_attributes()
   in inc/elementor-parallax-control.php) — needed because Elementor's
   own base CSS for .e-con / .elementor-column sets `position` (and
   sometimes `align-self`) at this same single-class specificity, and
   Elementor's stylesheet commonly loads after this one, so without
   !important a tied specificity lets source order silently cancel
   `position: sticky` before it ever applies. This class only matters
   on its own if "u-sticky" is typed into Advanced → CSS Classes by
   hand instead of using the toggle — the toggle already covers itself
   with its own inline !important. */
.u-sticky {
  position: sticky !important;
  align-self: flex-start !important;
}

/* "Reverse Columns (Tablet Portrait / Mobile Portrait)" — Advanced →
   Responsive. Used to be a static .u-reverse-columns-mobile class
   here (mobile-only). Now covers both breakpoints and their four
   possible combinations, which a single static class can't express,
   so it's generated per-element as a small scoped <style> block
   instead — see upsa_render_reverse_columns_attributes() in
   inc/elementor-parallax-control.php. Nothing to maintain here. */

/* .u-offset-image-down / .u-offset-image-up — drop on an Elementor
   column (or its Image widget) to let it hang past the bottom/top
   edge of the row it's in, instead of being confined to match its
   sibling column's height — the "photo overlaps into the section
   below" layout. Needs a sibling with a solid background (a colored
   column, or the section below) for the overlap to actually read as
   intentional rather than like a layout bug; doesn't require
   .u-parallax and isn't related to it — this is a pure static offset,
   no scroll animation.

   z-index: 10, not 2 — this is a generic utility meant to be usable
   on any Elementor column/image, including ones that overlap into or
   out of a .hero section (a very plausible real use: a photo hanging
   off the bottom edge of a hero into the content below). .hero never
   establishes its own stacking context (position:relative with no
   z-index of its own), so its internals — .hero__overlay (2),
   .hero__content (3), .hero__nav (4) — sit in the SAME ambient
   context as this utility, not a contained one. At z-index: 2 this
   would tie with .hero__overlay and lose outright to .hero__content/
   .hero__nav, burying the "overlapping" image behind exactly the
   section it's meant to overlap. 10 matches the value
   .hero__search-results already established elsewhere in this file
   for the same "safely above every hero internal" requirement.

   !important on the margin properties — not optional here, unlike
   most of this file's utilities. Elementor's own frontend CSS ships
   `.e-con .elementor-widget.elementor-widget { margin-block-end: 0; }`
   for any widget inside its flexbox Container layout (`.e-con`,
   Elementor 3.6+'s replacement for the old Section/Column structure)
   — three classes in that selector, specificity (0,3,0), beating this
   single-class utility's (0,1,0) outright. margin-block-end is the
   logical-property twin of margin-bottom (same physical bottom edge
   in the normal horizontal-tb/ltr case every page on this site uses),
   so Elementor's reset silently wins and cancels this utility's
   offset completely with ZERO visible effect — not a partial/wrong
   offset, literally none — whenever it's applied inside a Container
   rather than the older Section/Column. Setting margin-block-end
   here too (not just margin-bottom) closes that specific hole;
   !important on both is what actually guarantees the win regardless
   of which structure a given page uses or which stylesheet happens
   to be enqueued last. */
.u-offset-image-down {
  margin-bottom: -3.5rem !important;
  margin-block-end: -3.5rem !important;
  position: relative;
  z-index: 10;
}
.u-offset-image-up {
  margin-top: -3.5rem !important;
  margin-block-start: -3.5rem !important;
  position: relative;
  z-index: 10;
}

/* .u-parallax-img — the "Stanford academics page" style: a normal,
   in-flow content photo (an Elementor Image widget, a <figure>, a
   plain <img> — anything, not a section background) that drifts
   gently as the visitor scrolls past it, the same way the photo above
   the "Die Luft der Freiheit weht" pull-quote does on
   stanford.edu/academics.

   Usage: drop the class "u-parallax-img" into Advanced → CSS Classes
   on any Elementor Image widget (or wrap a plain <img> in an element
   with this class) — no PHP/Elementor-control changes needed, this
   is a pure CSS+JS utility exactly like the original .u-parallax
   manual-class workflow. Optionally add a
   Custom Attribute/data attribute data-parallax-speed="0.2" (default
   0.12 — gentler than the 0.15 section default, since a content image
   has much less room to move before its cropped edges show) to tune
   intensity per-image.

   Mechanism (see initParallaxImages() in script.js): the wrapper
   clips (overflow: hidden) a fixed-ratio window; the <img> inside is
   sized taller than that window (130%) and shifted up by the extra
   25% so it's centered with slack on both edges, then JS nudges its
   own translateY as the page scrolls — a real "photo moves slower/
   faster than the page" parallax, not background-attachment:fixed
   (unsupported on iOS Safari, and it locks the image to the viewport
   rather than letting it drift at its own rate). */
.u-parallax-img {
  position: relative;
  overflow: hidden;
  display: block;
}
.u-parallax-img img {
  display: block;
  width: 100%;
  height: 130%;
  max-width: none;
  object-fit: cover;
  position: relative;
  top: -15%;
  will-change: transform;
}

@media (max-width: 767px) {
  /* A column that's already stacked full-width on mobile doesn't
     have a neighboring block for the overlap to read against the way
     it does in the two-column desktop layout — so the offset is
     dialed back rather than removed outright, just enough to avoid
     it looking like an accidental overlap with whatever follows.
     Same !important + margin-block-* duplication as the base rule
     above, and for the same reason — this still has to outrank
     Elementor's .e-con .elementor-widget.elementor-widget reset. */
  .u-offset-image-down { margin-bottom: -1.25rem !important; margin-block-end: -1.25rem !important; }
  .u-offset-image-up { margin-top: -1.25rem !important; margin-block-start: -1.25rem !important; }
}

/* ---------------------------------------------------------
   UPSA: Admissions Team widget
   Flat, light-grey contact cards — distinct from .people-card
   (photo-forward profile cards): name+title beside a small photo,
   then an icon-led list of contact details (department, phone,
   office, email, "schedule a meeting" link). Column count is set by
   the widget's own Columns control via the --admissions-team-cols
   custom property (falls back to 3 if that's never set, e.g. if this
   class is ever reused outside the widget). See
   elementor-widgets/class-admissions-team-widget.php.
   --------------------------------------------------------- */
.admissions-team__heading {
  display: flex;
  align-items: center;
  gap: 24px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  font-size: var(--fs-h3); line-height: var(--lh-h3);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}
/* The horizontal accent rule stretching to the right of the heading
   text — a flex sibling pseudo-element rather than a border, so it
   only takes up the row's remaining width instead of running under
   the text too. */
.admissions-team__heading::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--color-red);
}

.admissions-team__grid {
  display: grid;
  grid-template-columns: repeat(var(--admissions-team-cols, 3), 1fr);
  gap: 24px;
}

.admissions-team__card {
  background: var(--color-bg-accent);
  border-radius: var(--radius-sm);
  padding: 28px;
  --admissions-card-pad: 1.75rem;
}

/* Featured photo — full width, above the name (not shrunk/pinned to
   one side the way it used to sit next to .admissions-team__info).
   Bleeds edge-to-edge on the card using a negative margin equal to
   the card's own padding, then the padded content below picks back
   up as normal — so the image reads as a true full-width photo
   without needing to unpad the whole card. */
.admissions-team__photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: calc(var(--admissions-card-pad) * -1) calc(var(--admissions-card-pad) * -1) 24px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.admissions-team__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.admissions-team__top { margin-bottom: 24px; }
.admissions-team__info { min-width: 0; }
.admissions-team__name { font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: 700; color: var(--color-header-bg); margin-bottom: 4px; }
.admissions-team__title { font-size: var(--fs-ui); color: var(--color-text-muted); line-height: var(--lh-ui); }

.admissions-team__details { display: flex; flex-direction: column; gap: 12px; }
.admissions-team__details li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.admissions-team__details svg { flex-shrink: 0; color: var(--color-text-muted); margin-top: 4px; }
.admissions-team__details a { color: var(--color-accent); text-decoration: underline; }
.admissions-team__details a:hover { color: var(--color-accent-dark); }
.admissions-team__details span { color: var(--color-text); }

@media (max-width: 767px) {
  .admissions-team__heading { font-size: var(--fs-lead); line-height: var(--lh-lead); gap: 16px; }
}

/* ---------------------------------------------------------
   Program single: Admission Team contact card
   A compact sidebar counselor card — small square photo beside
   name/title, then an icon-led list of contact details below.
   Distinct from .admissions-team__card (that one is a full-width
   photo-topped grid card meant for a multi-person "meet the team"
   section); this is the single, always-on-brand counselor card
   that sits in the Program single sidebar under Admission
   Requirements. See single-program.php.
   --------------------------------------------------------- */
.admission-team-card {
  background: var(--color-bg-accent);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admission-team-card__top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admission-team-card__photo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.admission-team-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.admission-team-card__info { min-width: 0; }
.admission-team-card__name { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; color: var(--color-header-bg); margin-bottom: 4px; }
.admission-team-card__title { font-size: var(--fs-ui); color: var(--color-text-muted); line-height: var(--lh-ui); }

.admission-team-card__details { display: flex; flex-direction: column; gap: 8px; }
.admission-team-card__details li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-ui);
  line-height: var(--lh-ui);
  color: var(--color-text);
}
.admission-team-card__details svg { flex-shrink: 0; color: var(--color-text-muted); }
.admission-team-card__details a { color: var(--color-text); text-decoration: none; }
.admission-team-card__details a:hover { color: var(--color-accent); text-decoration: underline; }

@media (max-width: 767px) {
  .admission-team-card__photo { width: 80px; height: 80px; }
}

/* ---------------------------------------------------------------
   WHATSAPP FLOATING BUTTON + PRE-CHAT POPUP
   Configured at Appearance -> Theme Options -> WhatsApp Chat Button.
   z-index: 150 is deliberately below .search-modal (200) and the
   mobile .primary-nav off-canvas panel (300), so this never paints
   over either of those when they're open, but above ordinary page
   content (which tops out well under 20 elsewhere in this file).
   --------------------------------------------------------------- */
.upsa-whatsapp {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
}

.upsa-whatsapp-button {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  line-height: 0;
  transition: transform var(--dur, 0.2s) var(--ease, ease);
}
.upsa-whatsapp-button:hover,
.upsa-whatsapp-button:focus-visible {
  transform: scale(1.08);
}

.upsa-whatsapp-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--color-white, #fff);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  font-family: var(--font-body, inherit);
}

.upsa-whatsapp-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #075E54;
  color: #fff;
}
.upsa-whatsapp-panel__avatar { flex-shrink: 0; line-height: 0; }
.upsa-whatsapp-panel__title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.upsa-whatsapp-panel__title strong { font-size: var(--fs-body); line-height: var(--lh-body); }
.upsa-whatsapp-panel__title span { font-size: var(--fs-caption); opacity: 0.85; line-height: var(--lh-caption); }
.upsa-whatsapp-panel__close {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  cursor: pointer;
  padding: 4px 4px;
  opacity: 0.85;
}
.upsa-whatsapp-panel__close:hover { opacity: 1; }

.upsa-whatsapp-panel__body {
  padding: 16px;
  background: #E5DDD5;
}
.upsa-whatsapp-panel__bubble {
  background: #fff;
  border-radius: var(--radius-md);
  border-top-left-radius: 2px;
  padding: 8px 12px;
  font-size: var(--fs-ui);
  line-height: var(--lh-ui);
  color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  margin: 0;
}

.upsa-whatsapp-panel__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--color-border, #e2e2e2);
}
.upsa-whatsapp-panel__form textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border, #e2e2e2);
  border-radius: 8px;
  padding: 8px 8px;
  font-size: var(--fs-ui);
  font-family: inherit;
  line-height: var(--lh-ui);
  max-height: 90px;
}
.upsa-whatsapp-panel__form button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #25D366;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 600;
  cursor: pointer;
}
.upsa-whatsapp-panel__form button:hover { background: #1ebe5b; }

@media (max-width: 767px) {
  .upsa-whatsapp { right: 16px; bottom: 16px; }
  .upsa-whatsapp-button { width: 50px; height: 50px; }
}

/* ---------------------------------------------------------------
   UPSA: INFO CARD — icon + title + sub-title grid, two flavors
   (.info-card-grid--card / .info-card-grid--row). See
   elementor-widgets/class-info-card-widget.php for the icon set
   powering .info-card__icon.
   Defined after .reveal (line ~102) intentionally: .reveal also sets
   `transform` on scroll-in, and per the note above it, whichever
   hover rule comes LAST in the file wins a tied-specificity conflict
   with .reveal's own transform — this needs to be after it so the
   hover lift below isn't silently cancelled on a .reveal-wrapped
   instance.
   --------------------------------------------------------------- */
.info-card-grid__heading {
  text-align: center;
  margin-bottom: 40px;
}
.info-card-grid__heading-text {
  font-family: var(--font-display);
  font-weight: var(--fw-display, 600);
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  color: var(--color-text);
  margin: 0 0 12px;
}
.info-card-grid__heading-rule {
  display: inline-block;
  width: 64px;
  height: 3px;
  background: var(--color-accent-soft);
  border-radius: 2px;
}

.info-card-grid__items {
  display: grid;
  gap: 24px;
}
.info-card-grid--cols-2 .info-card-grid__items { grid-template-columns: repeat(2, 1fr); }
.info-card-grid--cols-3 .info-card-grid__items { grid-template-columns: repeat(3, 1fr); }
.info-card-grid--cols-4 .info-card-grid__items { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1199px) {
  .info-card-grid--cols-3 .info-card-grid__items,
  .info-card-grid--cols-4 .info-card-grid__items {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .info-card-grid__items {
    grid-template-columns: 1fr !important;
  }
}

.info-card {
  display: flex;
  text-decoration: none;
  color: inherit;
}

/* Icon itself — shared by both style flavors. color defaults to
   Brand Crimson and is overridden per-instance by the widget's
   "Icon Color" control (a scoped inline rule on .info-card__icon). */
.info-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--color-red);
}
.info-card__icon svg,
.info-card__icon i {
  display: block;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Icons picked from other libraries: a font icon (Font Awesome…) is sized with
   font-size; an uploaded SVG takes the icon colour (Lucide icons are outlines
   and keep fill: none). */
.info-card__icon i { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.info-card__icon svg:not(.lucide) { fill: currentColor; }
.info-card:hover .info-card__icon svg,
.info-card:hover .info-card__icon i {
  transform: scale(1.15) rotate(-8deg);
}
@media (prefers-reduced-motion: reduce) {
  .info-card__icon svg,
  .info-card__icon i { transition: none; }
  .info-card:hover .info-card__icon svg,
  .info-card:hover .info-card__icon i { transform: none; }
}

.info-card__body {
  display: flex;
  flex-direction: column;
}
.info-card__title {
  font-family: var(--font-widget-heading);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.info-card__subtitle {
  color: var(--color-text-muted, #5b5b5b);
  font-size: var(--fs-ui);
  line-height: var(--lh-ui);
  margin-top: 4px;
}

/* "Card" flavor — white, rounded, shadowed panel; icon sits on top,
   larger and un-circled (matches the "#4 in Canada" stat-card
   reference this was built from). */
.info-card-grid--card .info-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease; border: 1px solid var(--color-border); transition: border-color var(--dur) var(--ease);
}
.info-card-grid--card .info-card:hover { border-color: var(--color-header-bg); }
.info-card-grid--card .info-card__icon svg { width: 32px; height: 32px; }
.info-card-grid--card .info-card__icon i { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.info-card-grid--card .info-card__title { font-size: var(--fs-lead); line-height: var(--lh-lead); }
/* Full width, so the widget's "Text Alignment" (center / right) has room to work; left-aligned text looks the same. */
.info-card-grid--card .info-card__body { align-self: stretch; }

/* "Row" flavor — circular bordered icon beside two lines of text, no
   card chrome (matches the "Industries We Serve" reference this was
   built from). */
.info-card-grid--row .info-card {
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.info-card-grid--row .info-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  transition: border-color 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.info-card-grid--row .info-card:hover .info-card__icon {
  border-color: var(--color-red);
}
.info-card-grid--row .info-card__icon svg { width: 26px; height: 26px; }
.info-card-grid--row .info-card__icon i { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.info-card-grid--row .info-card__title { font-size: var(--fs-body); line-height: var(--lh-body); }

/* =========================================================
   ACCESSIBILITY & PRINT (added in 1.1.0)
   ========================================================= */

/* Brand Gold text (--color-accent, #846E45) is 4.9:1 on white but only
   3.46:1 on Brand Light Gray (#D9D9D9) — below the 4.5:1 AA minimum for
   normal-size text. Inside the components that sit on that gray,
   re-point the token at the darker accent (5.0:1 on the same gray) so
   every link, icon and label inside them passes without touching each
   individual rule. */
.quick-links,
.media-list__row,
.news__filters,
.upsa-news-grid-alt__side,
.events-feature,
.pathway-dropdown,
.event-filter-bar,
.profile-nav,
.program-photo-card__tabs,
.event-detail-card,
.admissions-team__card,
.admission-team-card,
.welcome-card__media {
  --color-accent: var(--color-accent-dark);
}

/* The skip link moves focus to <main tabindex="-1">; that's a programmatic
   focus target, not a control, so it shouldn't draw a ring around the
   whole page body. */
#main-content:focus { outline: none; }

/* "Results update as you change a filter" notice. Filters that submit on
   change need to say so up front (WCAG 3.2.2 On Input). */
.filter-hint {
  font-size: var(--fs-ui); line-height: var(--lh-ui);
  font-weight: 400;
  color: var(--color-text-muted);
}
.event-filter-bar .filter-hint { align-self: center; margin-right: auto; }

/* Print: readable pages without site chrome, sliders, or animation that
   hasn't run. Without the .reveal reset, anything that scrolls in on
   screen would print as a blank area. */
@media print {
  :root { --color-bg-accent: #fff; }
  html, body { background: #fff !important; color: #000 !important; font-size: 12pt; }

  .audience-bar,
  .site-header,
  .site-footer,
  .search-modal,
  .skip-link,
  .hero__nav,
  .hero__controls,
  .hero__overlay,
  .upsa-whatsapp,
  .upsa-whatsapp-button,
  .upsa-whatsapp-panel,
  .calendar-widget,
  .programs-filters,
  .filter-hint,
  .article-share,
  video,
  iframe { display: none !important; }

  .reveal,
  .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Hero images behind text would print as a heavy dark block. */
  .hero,
  .hero--static,
  .hero--compact { min-height: 0 !important; background: none !important; color: #000 !important; }
  .hero__bg { display: none !important; }

  a { color: #000 !important; text-decoration: underline; }
  /* Show where external links go — useful on paper. */
  .legal-content a[href^="http"]::after,
  .single-post__content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }

  h1, h2, h3, h4 { break-after: avoid; }
  img, figure, .news-card, .event-card, .people-card, .program-card { break-inside: avoid; }
  img { max-width: 100% !important; }
}

/* ---------------------------------------------------------
   POST FORMATS (added in 1.1.0) — Audio / Gallery / Video badge on
   news cards and in the single-post meta line. Standard posts show nothing.
   --------------------------------------------------------- */
.news-card__format {
  position: absolute;
  bottom: 0.85rem; left: 0.85rem;
  background: var(--color-header-bg);
  color: var(--color-white);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  padding: 2px 12px;
  border-radius: var(--radius-pill); /* badge */
}

/* Video-format article: the player replaces the featured image. 16:9,
   centred over the (narrower) text column and capped so it doesn't fill
   the whole screen. */
.single-post__video {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.single-post__video iframe,
.single-post__video video,
.single-post__video > .wp-video,
.single-post__video > .wp-block-embed,
.single-post__video > div {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
.single-post__video video { object-fit: contain; }
