/* ============================================================
   Campus Theme — Accessibility Overrides
   Applied via body classes set by JS accessibility toolbar.
   ============================================================ */

/* ── Text size scale ── */
body.text-size-large {
  font-size: 1.2rem;
}

body.text-size-xlarge {
  font-size: 1.45rem;
}

/* Scale headings proportionally */
body.text-size-large .hero__heading      { font-size: clamp(2rem, 6vw, 4rem); }
body.text-size-large .section__title     { font-size: 2rem; }
body.text-size-large .single-post__title { font-size: clamp(1.75rem, 5vw, 3rem); }

body.text-size-xlarge .hero__heading      { font-size: clamp(2.25rem, 7vw, 4.5rem); }
body.text-size-xlarge .section__title     { font-size: 2.25rem; }
body.text-size-xlarge .single-post__title { font-size: clamp(2rem, 6vw, 3.5rem); }

/* ── High contrast mode ── */
body.contrast-high {
  --txt-primary:   #FFFFFF;
  --txt-secondary: #F0ECFF;
  --txt-muted:     #D4CCF8;
  --bg-base:       #000000;
  --bg-surface:    #0A0A0A;
  --bg-elevated:   #111111;
  --border:        #FFFFFF;
  --border-strong: #FFFFFF;
  --clr-purple:    #C8A8FF;
  --clr-accent:    #FFB347;
  --focus-ring:    #FFFF00;
  --focus-ring-width: 4px;
}

body.contrast-high a {
  color: #C8A8FF;
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

body.contrast-high .btn--primary {
  background: #C8A8FF;
  color: #000000;
  border-color: #FFFFFF;
  font-weight: 800;
}

body.contrast-high .btn--outline {
  color: #C8A8FF;
  border-color: #C8A8FF;
}

body.contrast-high .post-card {
  border: 2px solid #FFFFFF;
}

body.contrast-high .post-card__category {
  background: #000000;
  color: #C8A8FF;
  border: 1px solid #C8A8FF;
}

body.contrast-high .site-header {
  background: #000000;
  border-bottom-color: #FFFFFF;
}

body.contrast-high :focus-visible {
  outline: 4px solid #FFFF00;
  outline-offset: 3px;
}

/* ── Black and white mode ── */
body.contrast-bw .site-wrapper {
  filter: grayscale(100%);
}

/* ── Reduced / paused animations ── */
body.animations-paused *,
body.animations-paused *::before,
body.animations-paused *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ── Reading mode ── */
body.reading-mode .site-header,
body.reading-mode .site-footer,
body.reading-mode .sidebar,
body.reading-mode .breadcrumbs,
body.reading-mode .post-navigation {
  display: none;
}

body.reading-mode .page-layout {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-inline: auto;
}

body.reading-mode .prose {
  font-size: 1.125rem;
  line-height: 1.95;
}

/* Reading mode exit banner */
#reading-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-6);
  background: var(--clr-purple-dark);
  color: #fff;
  font-size: var(--fz-sm);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.reading-mode-banner__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reading-mode-banner__exit {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-sm);
  font-size: var(--fz-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.reading-mode-banner__exit:hover {
  background: rgba(255, 255, 255, .15);
  border-color: #fff;
}

.reading-mode-banner__exit:focus-visible {
  outline: 3px solid var(--clr-accent);
  outline-offset: 2px;
}

body.reading-mode {
  padding-top: 3rem;
}

/* ── Reduced motion (user-toggled, supplements prefers-reduced-motion) ── */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ── Focus enhancement for keyboard/SR users ── */

/* Ensure all interactive elements have visible focus */
body a:focus-visible,
body button:focus-visible,
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible,
body [tabindex]:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Extra spacing for readability with large text */
body.text-size-large .prose,
body.text-size-xlarge .prose {
  line-height: 1.95;
}

body.text-size-large .post-card__excerpt,
body.text-size-xlarge .post-card__excerpt {
  line-height: 1.9;
}
