/*
 * Mind Pilot Accessibility
 *
 * 1. Menu UI (launcher + panel)
 * 2. Larger text
 * 3. High contrast
 * 4. Underline links
 * 5. Reduce motion
 *
 * Page adjustments are keyed off classes on <html> (set before first paint):
 *   .mpa-text  + .mpa-text-1 | -2 | -3     larger text
 *   .mpa-contrast                           high contrast
 *   .mpa-links                              underline links
 *   .mpa-motion                             reduce motion (forced on)
 *   .mpa-t-{theme}                          active theme, e.g. .mpa-t-mind-pilot
 *
 * Position can be tuned from a theme or Additional CSS without editing this
 * file, e.g.  .mpa { --mpa-launcher-top: 62%; }
 */

/* ══════════════════════════════════════════
   1. MENU UI
   Reads the Mind Pilot theme tokens (--mp-*), so it follows the theme's
   light and dark modes. The fallbacks are for any other theme.
   ══════════════════════════════════════════ */
.mpa {
  --mpa-ink: var(--mp-navy, #1A2234);
  --mpa-on-ink: var(--mp-warm-white, #FFFFFF);
  --mpa-surface: var(--mp-card-bg, #FFFFFF);
  --mpa-text: var(--mp-text, #1A2234);
  --mpa-muted: var(--mp-text-muted, #5A6A8A);
  --mpa-line: var(--mp-border, #D8D8D8);
  --mpa-line-strong: var(--mp-border-strong, #857D74);
  --mpa-accent: var(--mp-red, #C62828);
  --mpa-accent-fill: var(--mp-red-fill, var(--mp-red, #C62828));
  --mpa-tint: var(--mp-cream, #F5F5F5);
  --mpa-shadow: var(--mp-shadow-lg, 0 12px 48px rgba(0, 0, 0, 0.18));
  --mpa-font-display: inherit;

  --mpa-launcher-size: 48px;
  --mpa-launcher-top: 50%;
  --mpa-gap: 12px;
  --mpa-z-launcher: 990;     /* below the theme's top bar (1000) and mobile menu (999) */
  --mpa-z-panel: 100000;
}

.mpa-t-mind-pilot .mpa { --mpa-font-display: 'Archivo Black', sans-serif; }

.mpa[hidden],
.mpa [hidden] { display: none !important; }

.mpa,
.mpa *,
.mpa *::before,
.mpa *::after { box-sizing: border-box; }

/* ── Launcher: a tab on the right edge, mid-height ──
   Mid-height keeps it clear of the fixed top bar, of cookie or consent
   bars (top or bottom) and of bottom-corner chat/back-to-top buttons. */
.mpa-launcher {
  position: fixed;
  top: var(--mpa-launcher-top);
  right: 0;
  z-index: var(--mpa-z-launcher);
  transform: translateY(-50%);
  width: var(--mpa-launcher-size);
  height: var(--mpa-launcher-size);
  margin: 0;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  /* !important here and on the panel buttons: many themes style every
     <button> on the page, and the menu has to look the same regardless. */
  background: var(--mpa-ink) !important;
  color: var(--mpa-on-ink) !important;
  border: 2px solid var(--mpa-on-ink) !important;
  border-right: 0 !important;
  border-radius: 12px 0 0 12px !important;
  min-height: 0;
  box-shadow: var(--mp-shadow, 0 4px 24px rgba(0, 0, 0, 0.14));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: width .15s ease;
}

.mpa-launcher:hover,
.mpa.is-open .mpa-launcher { width: calc(var(--mpa-launcher-size) + 6px); }

/* Two-tone ring: one of the two bands contrasts with whatever is behind
   the launcher (cream, navy or the red newsletter band). */
.mpa-launcher:focus { outline: none; }
.mpa-launcher:focus-visible {
  outline: 3px solid transparent; /* forced-colors mode draws this */
  border-radius: 12px 0 0 12px;
  box-shadow: 0 0 0 3px var(--mpa-on-ink), 0 0 0 6px var(--mpa-ink);
  width: calc(var(--mpa-launcher-size) + 6px);
}

.mpa-launcher-icon { display: block; flex-shrink: 0; }

/* ── Panel ── */
.mpa-panel {
  position: fixed;
  z-index: var(--mpa-z-panel);
  top: 50%;
  right: calc(var(--mpa-launcher-size) + 6px + var(--mpa-gap));
  transform: translateY(-50%);
  width: 21rem;
  max-width: calc(100vw - var(--mpa-launcher-size) - 6px - (var(--mpa-gap) * 2));
  max-height: calc(100vh - (var(--mpa-gap) * 2));
  max-height: calc(100dvh - (var(--mpa-gap) * 2));
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1rem;
  background: var(--mpa-surface);
  color: var(--mpa-text);
  border: 1px solid var(--mpa-line-strong);
  border-radius: 12px;
  box-shadow: var(--mpa-shadow);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
}

/* Phones and high zoom: a sheet along the bottom, full width. */
@media (max-width: 560px), (max-height: 420px) {
  .mpa-panel {
    top: auto;
    bottom: var(--mpa-gap);
    left: var(--mpa-gap);
    right: var(--mpa-gap);
    transform: none;
    width: auto;
    max-width: none;
  }

  /* The sheet would sit on top of the launcher, so the launcher steps
     aside while it is open; mpa.js moves focus into the sheet and hands
     it back on close. */
  .mpa.is-open .mpa-launcher { visibility: hidden; }
}

/* Phones: a slimmer tab, so it stays mostly within the page gutter
   instead of sitting on the ends of text lines or the player controls. */
@media (max-width: 600px) {
  .mpa { --mpa-launcher-size: 48px; }
  .mpa-launcher,
  .mpa-launcher:hover,
  .mpa-launcher:focus-visible { width: 38px; }
  .mpa-launcher-icon { width: 22px; height: 22px; }
}

.mpa-panel:focus { outline: none; }
.mpa-panel:focus-visible { outline: 3px solid var(--mpa-accent); outline-offset: 2px; }

.mpa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.mpa-title {
  margin: 0;
  font-family: var(--mpa-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mpa-ink);
}

.mpa-panel button {
  margin: 0;
  font: inherit;
  line-height: 1.3;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none !important;
  color: var(--mpa-text) !important;
  background: var(--mpa-surface) !important;
  border: 1px solid var(--mpa-line-strong) !important;
  border-radius: 10px;
  box-shadow: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mpa-panel button:focus-visible {
  outline: 3px solid var(--mpa-accent);
  outline-offset: 2px;
  border-radius: 10px;
}

.mpa-panel button:hover { background: var(--mpa-tint) !important; }

.mpa-panel .mpa-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
}

/* ── Text size ── */
.mpa-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid var(--mpa-line-strong);
  border-radius: 10px;
}

.mpa-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}

.mpa-label,
.mpa-toggle-label { font-weight: 700; }

.mpa-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mpa-accent);
}

.mpa-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.mpa-panel .mpa-step {
  flex: 1 1 7rem;
  min-height: 44px;
  padding: .5rem .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 700 !important;
}

.mpa-panel .mpa-step[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  background: var(--mpa-surface) !important;
}

/* ── Toggles ── */
.mpa-panel .mpa-toggle {
  width: 100%;
  min-height: 48px;
  padding: .6rem .75rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  text-align: left;
}

.mpa-toggle-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* State is shown three ways: knob position, track fill, and the word. */
.mpa-switch {
  flex-shrink: 0;
  position: relative;
  width: 40px;
  height: 22px;
  border: 2px solid var(--mpa-muted);
  border-radius: 999px;
  background: transparent;
}

.mpa-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mpa-muted);
  transition: transform .15s ease;
}

.mpa-toggle[aria-pressed="true"] .mpa-switch {
  background: var(--mpa-accent-fill);
  border-color: var(--mpa-accent-fill);
}

.mpa-toggle[aria-pressed="true"] .mpa-switch-knob {
  background: #FFFFFF;
  transform: translateX(18px);
}

.mpa-state {
  flex-shrink: 0;
  min-width: 2.1em;
  font-size: .875rem;
  font-weight: 700;
  color: var(--mpa-muted);
}

.mpa-toggle[aria-pressed="true"] .mpa-state { color: var(--mpa-accent); }

.mpa-toggle[aria-disabled="true"] { cursor: default; }
.mpa-panel .mpa-toggle[aria-disabled="true"]:hover { background: var(--mpa-surface) !important; }
.mpa-toggle[aria-disabled="true"] .mpa-state { min-width: 0; max-width: 9.5rem; text-align: right; }

.mpa-note {
  margin: -.2rem .15rem 0;
  font-size: .875rem;
  color: var(--mpa-muted);
}

/* ── Reset ── */
.mpa-panel .mpa-reset {
  width: 100%;
  min-height: 46px;
  margin-top: .15rem !important;
  padding: .55rem .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-weight: 700 !important;
  color: var(--mpa-ink) !important;
  border: 2px solid var(--mpa-ink) !important;
}

.mpa-panel .mpa-reset:hover {
  background: var(--mpa-ink) !important;
  color: var(--mpa-on-ink) !important;
}

/* Live region: announced, not shown. */
.mpa-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .mpa { display: none !important; }
}

@media (forced-colors: active) {
  .mpa-launcher,
  .mpa-panel,
  .mpa-panel button { border: 2px solid ButtonText !important; }
  .mpa-toggle[aria-pressed="true"] .mpa-switch { background: Highlight; border-color: Highlight; }
  .mpa-switch-knob { background: ButtonText; }
  .mpa-toggle[aria-pressed="true"] .mpa-switch-knob { background: HighlightText; }
}

/* ══════════════════════════════════════════
   2. LARGER TEXT
   The Mind Pilot theme sizes its type and spacing in rem, so scaling the
   root size scales the whole design in proportion, the way browser zoom
   does. The rest of this section removes the places where bigger text
   would otherwise be clipped, truncated or pushed off-screen.
   ══════════════════════════════════════════ */
html.mpa-text-1 { font-size: 115%; }
html.mpa-text-2 { font-size: 130%; }
html.mpa-text-3 { font-size: 150%; }

html.mpa-text { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Block-editor preset sizes are pixel values in classic themes. */
html.mpa-text.mpa-t-mind-pilot body {
  --wp--preset--font-size--small: .8125rem;
  --wp--preset--font-size--medium: 1.25rem;
  --wp--preset--font-size--large: 2.25rem;
  --wp--preset--font-size--x-large: 2.625rem;
}

/* Never truncate: excerpts are clamped to 2–3 lines by default. */
html.mpa-text .mp-ep-excerpt,
html.mpa-text .mp-blog-body p {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* Let long words and labels wrap instead of overflowing. */
html.mpa-text :is(h1, h2, h3, h4, .mp-ep-title, .mp-stat-num, .mp-footer li a, .mp-nav-logo span) {
  overflow-wrap: break-word;
}

html.mpa-text :is(.mp-filter-pill, .mp-search-btn, .mp-filter-label, .mp-hero-badge) { white-space: normal; }
html.mpa-text .mp-hero-badge { border-radius: 16px; }
html.mpa-text :is(.mp-ep-meta, .mp-ep-footer, .mp-single-meta, .mp-listen-platforms, .mp-hero-actions) { flex-wrap: wrap; }
html.mpa-text .mp-search-form { flex-wrap: wrap; padding: .5rem; }
html.mpa-text .mp-search-input { flex: 1 1 8rem; }

/* A taller filter bar must not stay pinned over the list. */
html.mpa-text .mp-filter-bar { position: static; }

/* Fixed-pixel columns give the text too little room once it grows. */
html.mpa-text-2 .mp-episodes-grid,
html.mpa-text-3 .mp-episodes-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); }
html.mpa-text .mp-resources-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }

@media (max-width: 1200px) {
  html.mpa-text-2 .mp-hero-inner,
  html.mpa-text-3 .mp-hero-inner { grid-template-columns: 1fr; }
  html.mpa-text-2 .mp-hero-art,
  html.mpa-text-3 .mp-hero-art { order: -1; }
  html.mpa-text-2 .mp-hero-logo-img,
  html.mpa-text-3 .mp-hero-logo-img { max-width: 280px; }
  html.mpa-text-2 .mp-about-grid,
  html.mpa-text-3 .mp-about-grid,
  html.mpa-text-2 .mp-book-grid,
  html.mpa-text-3 .mp-book-grid { grid-template-columns: 1fr; }
  html.mpa-text-2 .mp-about-photo-wrap,
  html.mpa-text-3 .mp-about-photo-wrap { max-width: 300px; }
  html.mpa-text-2 .mp-book-cover,
  html.mpa-text-3 .mp-book-cover { max-width: 240px; }
  html.mpa-text-3 .mp-footer-inner { grid-template-columns: 1fr 1fr; }
}

/* Small screens: the rem-based gutters scale too; hand that width back to the text. */
@media (max-width: 600px) {
  html.mpa-text :is(.mp-section, .mp-single-header, .mp-single-content, .mp-page-header,
      .mp-page-content, .mp-filter-bar, .mp-newsletter, .mp-hero, .mp-book-section, .mp-stats-bar, .mp-footer) {
    padding-left: 16px;
    padding-right: 16px;
  }
  html.mpa-text .mp-container { padding-left: 0; padding-right: 0; }
  html.mpa-text :is(.mp-ep-card, .mp-resource-card) { padding: 1rem; }
  html.mpa-text .mp-nav-inner { padding: 0 16px; }
  html.mpa-text .mp-nav-logo span { font-size: 1.05rem; }
  html.mpa-text-3 .mp-hero h1 { font-size: 1.6rem; }
  html.mpa-text-3 :is(.mp-single-header h1, .mp-page-header h1) { font-size: 1.6rem; }
  html.mpa-text-3 :is(.mp-section-title, .mp-book-info h2, .mp-about-text h2) { font-size: 1.5rem; }
  html.mpa-text .mp-mobile-links li a { padding-left: 16px; padding-right: 16px; }
  html.mpa-text .mp-footer-inner { grid-template-columns: minmax(0, 1fr); }
  html.mpa-text .mp-footer li a { overflow-wrap: anywhere; }

  /* Top bar: let the site name take two lines so the menu button stays on screen. */
  html.mpa-text .mp-nav-inner { gap: 8px; }
  html.mpa-text .mp-nav-logo { min-width: 0; flex-shrink: 1; gap: 8px; }
  html.mpa-text .mp-nav-logo img { flex-shrink: 0; }
  html.mpa-text .mp-nav-logo span { white-space: normal; line-height: 1.05; }
  html.mpa-text .mp-nav-actions { flex-shrink: 0; gap: 8px; }
}

/* The desktop menu has a fixed 72px bar to live in. Browser zoom would
   switch to the mobile menu as the text grows, so do the same here: each
   step moves the theme's 900px breakpoint up by the same factor. */
@media (min-width: 901px) and (max-width: 1035px) {
  html.mpa-text-1 .mp-nav-desktop { display: none !important; }
  html.mpa-text-1 .mp-mobile-toggle { display: flex !important; }
  html.mpa-text-1 .mp-social-buttons--icons.mp-social-buttons--nav { display: none; }
  html.mpa-text-1 .mp-mobile-panel[aria-hidden="false"] { display: block !important; }
}

@media (min-width: 901px) and (max-width: 1170px) {
  html.mpa-text-2 .mp-nav-desktop { display: none !important; }
  html.mpa-text-2 .mp-mobile-toggle { display: flex !important; }
  html.mpa-text-2 .mp-social-buttons--icons.mp-social-buttons--nav { display: none; }
  html.mpa-text-2 .mp-mobile-panel[aria-hidden="false"] { display: block !important; }
}

@media (min-width: 901px) and (max-width: 1350px) {
  html.mpa-text-3 .mp-nav-desktop { display: none !important; }
  html.mpa-text-3 .mp-mobile-toggle { display: flex !important; }
  html.mpa-text-3 .mp-social-buttons--icons.mp-social-buttons--nav { display: none; }
  html.mpa-text-3 .mp-mobile-panel[aria-hidden="false"] { display: block !important; }
}

/* ══════════════════════════════════════════
   3. HIGH CONTRAST
   A deliberate palette, not an inversion: the brand's navy and red are
   kept but deepened until body text, links and controls all clear 7:1,
   tints become plain surfaces with real borders, and translucent text
   becomes solid. It follows the theme's own light/dark switch.

   Light   ink #0A0F1C on #FFFFFF (19.2:1)   red #8F1414 (9.2:1)
   Dark    #FFFFFF on #000000 (21:1)         red #FFA3A3 (11.3:1)
   ══════════════════════════════════════════ */
html.mpa-contrast.mpa-t-mind-pilot body {
  --mp-text: #0A0F1C;
  --mp-navy: #0A0F1C;
  --mp-navy-light: #1E2740;
  --mp-ink: #0A0F1C;
  --mp-slate: #26304A;
  --mp-text-muted: #26304A;
  --mp-red: #8F1414;
  --mp-red-dark: #6E0E0E;
  --mp-red-fill: #8F1414;
  --mp-red-fill-hover: #6E0E0E;
  --mp-red-strong: #6E0E0E;
  --mp-red-light: #FFFFFF;
  --mp-cream: #FFFFFF;
  --mp-warm-white: #FFFFFF;
  --mp-sand: #FFFFFF;
  --mp-card-bg: #FFFFFF;
  --mp-input-bg: #FFFFFF;
  --mp-nav-bg: #FFFFFF;
  --mp-border: #26304A;
  --mp-border-strong: #0A0F1C;
  --mp-on-dark-muted: #FFFFFF;
  --mp-shadow: none;
  --mp-shadow-lg: none;
  --mpa-focus: #0A0F1C;
  --mpa-hc-edge: #0A0F1C;
  --mpa-hc-on-fill: #FFFFFF;
}

html.mpa-contrast.mpa-t-mind-pilot body.mp-dark {
  --mp-text: #FFFFFF;
  --mp-navy: #FFFFFF;
  --mp-navy-light: #1C1C1C;
  --mp-ink: #000000;
  --mp-slate: #E4E8F0;
  --mp-text-muted: #E4E8F0;
  --mp-red: #FFA3A3;
  --mp-red-dark: #FFC2C2;
  --mp-red-fill: #A51E1E;
  --mp-red-fill-hover: #8F1414;
  --mp-red-strong: #FFC2C2;
  --mp-red-light: #000000;
  --mp-cream: #000000;
  --mp-warm-white: #000000;
  --mp-sand: #000000;
  --mp-card-bg: #000000;
  --mp-input-bg: #000000;
  --mp-nav-bg: #000000;
  --mp-border: #C9D0DC;
  --mp-border-strong: #FFFFFF;
  --mpa-focus: #FFFFFF;
  --mpa-hc-edge: #FFFFFF;
}

/* Surfaces: flat fills, real edges, no translucency or decoration. */
html.mpa-contrast.mpa-t-mind-pilot .mp-topbar {
  background: var(--mp-nav-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 2px solid var(--mpa-hc-edge);
}

html.mpa-contrast.mpa-t-mind-pilot .mp-hero { background: var(--mp-cream); }
html.mpa-contrast.mpa-t-mind-pilot .mp-hero::before,
html.mpa-contrast.mpa-t-mind-pilot .mp-book-section::before { display: none; }
html.mpa-contrast.mpa-t-mind-pilot .mp-hero h1 em::after { background: currentColor; height: 3px; bottom: 0; }
html.mpa-contrast.mpa-t-mind-pilot .mp-hero-logo-img { filter: none; }
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark img { opacity: 1; }

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-section-alt, .mp-page-header, .mp-single-header, .mp-filter-bar) {
  border-top: 1px solid var(--mp-border);
  border-bottom: 1px solid var(--mp-border);
  box-shadow: none;
}

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-ep-card, .mp-resource-card, .mp-speaking-card, .mp-blog-card, .widget),
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark :is(.mp-ep-card, .mp-resource-card, .mp-speaking-card, .mp-blog-card) {
  background: var(--mp-card-bg);
  border: 2px solid var(--mpa-hc-edge);
  box-shadow: none;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-ep-card:hover { border-color: var(--mpa-hc-edge); }

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-hero-badge, .mp-ep-tag, .mp-resource-icon, .mp-platform-icon,
    .mp-speaking-cta, .mp-episode-player, .mp-single-content .entry-content blockquote),
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark :is(.mp-ep-tag, .mp-platform-icon) {
  background: var(--mp-card-bg);
  border: 1px solid var(--mpa-hc-edge);
  box-shadow: none;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-single-content .entry-content blockquote { border-left-width: 6px; border-left-color: var(--mp-red); }
html.mpa-contrast.mpa-t-mind-pilot :is(.mp-ep-tag, .mp-ep-date, .mp-ep-duration, .mp-filter-label) { color: var(--mp-text); }
html.mpa-contrast.mpa-t-mind-pilot .entry-content :is(th, td) { border-color: var(--mpa-hc-edge); }

/* Dark bands (stats, book, footer) and the red newsletter band. */
html.mpa-contrast.mpa-t-mind-pilot :is(.mp-stats-bar, .mp-book-section, .mp-footer),
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark :is(.mp-stats-bar, .mp-book-section, .mp-footer) {
  background: #0A0F1C;
  color: #FFFFFF;
  --mpa-focus: #FFFFFF;
}

html.mpa-contrast.mpa-t-mind-pilot body.mp-dark :is(.mp-stats-bar, .mp-book-section, .mp-footer) {
  background: #000000;
  border-top: 2px solid #FFFFFF;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-newsletter {
  background: var(--mp-red-fill);
  color: #FFFFFF;
  --mpa-focus: #FFFFFF;
}

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-stat-num, .mp-stat-label, .mp-book-info h2, .mp-book-info .mp-section-tag,
    .mp-book-info .authors, .mp-book-info p, .mp-footer-brand p, .mp-footer li a, .mp-footer .mp-footer-heading,
    .mp-footer h4, .mp-footer-bottom, .mp-footer-widgets, .mp-footer-widgets p, .mp-footer-widgets a,
    .mp-footer-widgets .widget-title, .mp-newsletter h2, .mp-newsletter p) {
  color: #FFFFFF;
  opacity: 1;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-footer-bottom { border-top-color: #FFFFFF; }
html.mpa-contrast.mpa-t-mind-pilot .mp-footer li a { text-decoration: underline; text-underline-offset: .18em; }
html.mpa-contrast.mpa-t-mind-pilot .mp-social-buttons--icons.mp-social-buttons--footer .mp-social-btn { background: transparent; border: 2px solid #FFFFFF; }
html.mpa-contrast.mpa-t-mind-pilot .mp-social-buttons--icons.mp-social-buttons--footer .mp-social-btn .mp-social-glyph { color: #FFFFFF; }

/* Links in running text: color plus underline. */
html.mpa-contrast.mpa-t-mind-pilot .entry-content a:not(.wp-block-button__link):not(.wp-element-button),
html.mpa-contrast.mpa-t-mind-pilot :is(.mp-about-text p a, .mp-page-header p a) {
  color: var(--mp-red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .18em;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-nav-links li a:hover,
html.mpa-contrast.mpa-t-mind-pilot .mp-ep-title a:hover { color: var(--mp-red); text-decoration: underline; }

/* Buttons: solid fill or solid outline, always with an edge. */
html.mpa-contrast.mpa-t-mind-pilot :is(.mp-btn-primary, .mp-ep-play, .mp-search-btn, .mp-filter-pill.active,
    .mp-pagination .current, .mp-blog-cat, .mp-single-meta .category),
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark .mp-filter-pill.active {
  background: var(--mp-red-fill);
  color: #FFFFFF;
  border: 2px solid var(--mpa-hc-edge);
  box-shadow: none;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-nav-cta {
  background: var(--mp-red-fill) !important;
  color: #FFFFFF !important;
  outline: 2px solid var(--mpa-hc-edge);
  outline-offset: -2px;
}

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-btn-outline, .mp-filter-pill, .mp-dark-toggle, .mp-pagination a,
    .mp-social-buttons--buttons .mp-social-btn, .mp-social-buttons--icons.mp-social-buttons--nav .mp-social-btn),
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark :is(.mp-btn-outline, .mp-filter-pill) {
  background: var(--mp-card-bg);
  color: var(--mp-text);
  border: 2px solid var(--mpa-hc-edge);
}

html.mpa-contrast.mpa-t-mind-pilot .mp-filter-pill-tag { border-style: solid; }
html.mpa-contrast.mpa-t-mind-pilot .mp-btn-white { background: #FFFFFF; color: #0A0F1C; border: 2px solid #FFFFFF; }
html.mpa-contrast.mpa-t-mind-pilot .mp-social-buttons--icons .mp-social-btn .mp-social-glyph { color: var(--mp-text); }
html.mpa-contrast.mpa-t-mind-pilot .mp-social-buttons--icons:not(.mp-social-buttons--footer):not(.mp-social-buttons--nav) .mp-social-btn {
  background: var(--mp-card-bg);
  border: 2px solid var(--mpa-hc-edge);
  box-shadow: none;
}
html.mpa-contrast.mpa-t-mind-pilot .entry-content :is(.wp-block-button__link, .wp-element-button) {
  background: var(--mp-text);
  color: var(--mp-warm-white);
  border: 2px solid var(--mpa-hc-edge);
}

/* Forms. */
html.mpa-contrast.mpa-t-mind-pilot .mp-search-form,
html.mpa-contrast.mpa-t-mind-pilot body.mp-dark .mp-search-form {
  background: var(--mp-input-bg);
  border: 2px solid var(--mpa-hc-edge);
  box-shadow: none;
}

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-search-input, .mp-search-icon) { color: var(--mp-text); }
html.mpa-contrast.mpa-t-mind-pilot .mp-search-input::placeholder { color: var(--mp-text-muted); opacity: 1; }

html.mpa-contrast.mpa-t-mind-pilot :is(.mp-newsletter-form input, .entry-content input, .entry-content textarea,
    .entry-content select, .comment-form input, .comment-form textarea) {
  background: #FFFFFF;
  color: #0A0F1C;
  border: 2px solid #0A0F1C;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-newsletter-form input::placeholder { color: #26304A; opacity: 1; }
html.mpa-contrast.mpa-t-mind-pilot :is(.mp-newsletter-form button, .mp-newsletter-form input[type="submit"]) {
  background: #0A0F1C;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
}

/* Focus: thicker, and switched to white inside the dark and red bands. */
html.mpa-contrast.mpa-t-mind-pilot :is(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 4px solid var(--mpa-focus);
  outline-offset: 3px;
}

html.mpa-contrast.mpa-t-mind-pilot .mp-search-form:focus-within { box-shadow: 0 0 0 4px var(--mpa-focus); }

/* The menu itself. */
html.mpa-contrast .mpa-panel { border: 2px solid var(--mpa-ink); box-shadow: none; }
html.mpa-contrast .mpa-panel button,
html.mpa-contrast .mpa-group { border-color: var(--mpa-ink) !important; }
html.mpa-contrast .mpa-switch,
html.mpa-contrast .mpa-switch-knob { border-color: var(--mpa-ink); }
html.mpa-contrast .mpa-toggle:not([aria-pressed="true"]) .mpa-switch-knob { background: var(--mpa-ink); }
html.mpa-contrast .mpa-state,
html.mpa-contrast .mpa-note { color: var(--mpa-text); }
html.mpa-contrast .mpa-panel button:focus-visible { outline: 4px solid var(--mpa-ink); outline-offset: 3px; }
html.mpa-contrast .mpa-launcher { box-shadow: none; }

/* ── Any other theme: a plain, predictable fallback ──
   Black on white, blue underlined links, visible edges on controls. */
html.mpa-contrast:not(.mpa-t-mind-pilot) body,
html.mpa-contrast:not(.mpa-t-mind-pilot) body :where(:not(.mpa, .mpa *, img, picture, video, canvas, iframe, embed, object, svg, svg *)) {
  background-color: #FFFFFF !important;
  background-image: none !important;
  color: #000000 !important;
  border-color: #000000 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

html.mpa-contrast:not(.mpa-t-mind-pilot) body a:not(.mpa *),
html.mpa-contrast:not(.mpa-t-mind-pilot) body a:not(.mpa *) :where(:not(img, svg, svg *)) {
  color: #00299B !important;
  text-decoration: underline !important;
}

html.mpa-contrast:not(.mpa-t-mind-pilot) body :is(button, input, select, textarea, [role="button"], .wp-element-button):not(.mpa *) {
  border: 2px solid #000000 !important;
}

html.mpa-contrast:not(.mpa-t-mind-pilot) body :is(a, button, input, select, textarea, summary, [tabindex]):not(.mpa *):focus-visible {
  outline: 4px solid #000000 !important;
  outline-offset: 3px !important;
}

/* ══════════════════════════════════════════
   4. UNDERLINE LINKS
   Text links in the page content and footer. Buttons, icon links and
   filter chips already read as controls and are left alone.
   ══════════════════════════════════════════ */
html.mpa-links :is(main, [role="main"], article, .entry-content, footer) a:not(.mpa *):not(.wp-block-button__link):not(.wp-element-button):not([role="button"]):not(.button):not(.mp-btn-primary):not(.mp-btn-outline):not(.mp-btn-white):not(.mp-ep-play):not(.mp-platform-icon):not(.mp-social-btn):not(.mp-filter-pill):not(.mp-ep-tag):not(.page-numbers):not([aria-hidden="true"]) {
  text-decoration: underline !important;
  text-decoration-thickness: max(1px, .08em) !important;
  text-underline-offset: .18em !important;
}

/* ══════════════════════════════════════════
   5. REDUCE MOTION
   Applied when the visitor turns it on here (.mpa-motion) and, for any
   theme that does not already do so, when their device asks for it.
   Scripted smooth scrolling is handled in mpa.js.
   ══════════════════════════════════════════ */
html.mpa-motion,
html.mpa-motion * { scroll-behavior: auto !important; }

html.mpa-motion *,
html.mpa-motion *::before,
html.mpa-motion *::after {
  animation-duration: .01ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  transition-delay: 0s !important;
}

/* Mind Pilot: reveal-on-scroll content is simply shown; hover lifts are flattened. */
html.mpa-motion .mp-fade-in { opacity: 1 !important; transform: none !important; }

html.mpa-motion :is(.mp-btn-primary, .mp-btn-outline, .mp-btn-white, .mp-ep-play, .mp-ep-card, .mp-resource-card,
    .mp-blog-card, .mp-platform-icon, .mp-social-btn, .mp-nav-cta, .mp-hero-logo-img):hover,
html.mpa-motion .mp-dark-toggle:hover svg {
  transform: none !important;
}

html.mpa-motion .mp-book-cover:hover { transform: rotate(-3deg) !important; }

@media (prefers-reduced-motion: reduce) {
  html.mpa-js,
  html.mpa-js * { scroll-behavior: auto !important; }

  html.mpa-js *,
  html.mpa-js *::before,
  html.mpa-js *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }

  html.mpa-js .mp-fade-in { opacity: 1 !important; transform: none !important; }
}
