/* ========== Site layout – bright theme ========== */
:root {
  --site-bg: #f0f7ff;
  --site-surface: #ffffff;
  --site-border: #c5d9f0;
  --site-text: #1a365d;
  --site-text-muted: #4a5568;
  --site-primary: #58a6ff;
  --site-accent: #0ea5e9;
  --site-radius: 8px;
  --site-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--site-font);
  background: var(--site-bg);
  color: var(--site-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--site-surface);
  border-bottom: 2px solid var(--site-border);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.site-nav {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--site-primary);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  color: var(--site-accent);
  text-decoration: underline;
}

.site-nav .nav-home {
  margin-right: auto;
  font-weight: 700;
  color: var(--site-text);
}

.site-nav .nav-home:hover {
  color: var(--site-primary);
}

.site-main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
}

.site-footer {
  background: var(--site-surface);
  border-top: 2px solid var(--site-border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--site-text-muted);
}

.site-footer p {
  margin: 0;
}

/* LMS content blocks */
.lms-hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.lms-hero {
  background: rgba(88, 166, 255, 0.08);
  margin: 0 -1.5rem 2rem;
  padding: 2rem 1.5rem 3rem;
}

.lms-hero h1 {
  color: var(--site-primary);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.lms-hero p {
  font-size: 1.125rem;
  color: var(--site-text-muted);
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.lms-section {
  margin-bottom: 2.5rem;
}

.lms-section h2 {
  color: var(--site-primary);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--site-border);
  padding-bottom: 0.5rem;
}

.lms-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.lms-card {
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lms-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.lms-card .lms-card-body {
  padding: 1.25rem;
}

.lms-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: var(--site-text);
}

.lms-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--site-text-muted);
  line-height: 1.5;
}

/* ========== Accessibility widget: light blue, square boxes (icon above text) ========== */
/* Screen-reader only: visible to assistive tech, hidden visually */
.a11y-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.a11y-widget-wrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: var(--site-font);
  font-size: 16px;
}

/* Trigger: light blue */
.a11y-trigger {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  border: 2px solid #DFAB2B;
  background: linear-gradient(180deg, #E0BC66 0%, #DFAB2B 100%);
  color: #1a365d;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(223, 171, 43, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.a11y-trigger:hover {
  background: linear-gradient(180deg, #e8c876 0%, #E0BC66 100%);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(223, 171, 43, 0.5);
}

.a11y-trigger:focus {
  outline: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #009944;
}

.a11y-trigger:focus:not(:focus-visible) {
  box-shadow: 0 4px 14px rgba(223, 171, 43, 0.4);
}

.a11y-trigger svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* Panel: theme background #e5eef9 */
.a11y-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.75rem;
  width: min(380px, calc(100vw - 2rem));
  min-width: 280px;
  max-height: 85vh;
  overflow-y: auto;
  background: #e5eef9;
  border: 2px solid #E0BC66;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0, 153, 68, 0.15);
  display: none;
  padding: 0;
}

.a11y-panel.is-open {
  display: block;
}

.a11y-panel-header {
  padding: 1rem 0.75rem 0.75rem;
  border-bottom: 2px solid #E0BC66;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px 12px 0 0;
  box-sizing: border-box;
}

.a11y-panel h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #009944;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* Option list: grid of square boxes – equal columns */
.a11y-option-list {
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}

/* Each option: square box, icon above, text below – equal width blocks */
.a11y-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  min-width: 0;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 600;
  color: #1a365d;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #E0BC66;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.a11y-option:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #009944;
  box-shadow: 0 2px 8px rgba(0, 153, 68, 0.2);
}

.a11y-option:focus {
  outline: none;
  border-color: #009944;
  box-shadow: 0 0 0 3px rgba(0, 153, 68, 0.25);
}

.a11y-option:focus:not(:focus-visible) {
  box-shadow: none;
}

/* Icon above */
.a11y-option-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #009944;
}

.a11y-option-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Text below */
.a11y-option-label {
  line-height: 1.25;
  letter-spacing: 0.01em;
  word-break: break-word;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Stepped option: step indicators (dots) – like Userway level 1 of 3 */
.a11y-option-stepped .a11y-option-label {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.a11y-option-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.a11y-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 153, 68, 0.25);
  transition: background 0.15s;
}

.a11y-step-active {
  background: #009944;
}

.a11y-step-i {
  display: block;
  width: 100%;
  height: 100%;
}

/* Active state – theme #009944 / #E0BC66 */
.a11y-option.is-on {
  background: rgba(0, 153, 68, 0.12);
  border-color: #009944;
  color: #1a365d;
}

.a11y-option.is-on .a11y-option-icon {
  color: #009944;
}

.a11y-option.is-on:hover {
  background: rgba(0, 153, 68, 0.18);
}

/* Full-width actions (Reset, Hide) – align with grid */
.a11y-option-full {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.a11y-option-full .a11y-option-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.a11y-option-full .a11y-option-label {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  text-align: left;
}

/* Reset button – theme #DFAB2B */
.a11y-option-reset {
  margin-top: 0.25rem;
  font-weight: 700;
  border-color: #DFAB2B;
  color: #b8860b;
  background: rgba(224, 188, 102, 0.2);
}

.a11y-option-reset .a11y-option-icon {
  color: #DFAB2B;
}

.a11y-option-reset:hover {
  background: rgba(224, 188, 102, 0.35);
  color: #8b6914;
}

/* Move/Hide button */
.a11y-option-hide {
  font-weight: 600;
  color: #4b5563;
  background: rgba(243, 244, 246, 0.95);
  border-color: #9ca3af;
}

.a11y-option-hide .a11y-option-icon {
  color: #6b7280;
}

.a11y-option-hide:hover {
  color: #1f2937;
  background: #f3f4f6;
}

/* TTS: Play and Stop – same size as a11y-option (equal width in grid) */
.a11y-tts-play {
  border-color: #009944 !important;
  color: #009944 !important;
  background: rgba(0, 153, 68, 0.1) !important;
}

.a11y-tts-play .a11y-option-icon {
  color: #009944 !important;
}

.a11y-tts-play:hover {
  background: rgba(0, 153, 68, 0.18) !important;
  border-color: #009944 !important;
}

.a11y-tts-stop {
  border-color: #DFAB2B !important;
  color: #b8860b !important;
  background: rgba(224, 188, 102, 0.15) !important;
}

.a11y-tts-stop .a11y-option-icon {
  color: #DFAB2B !important;
}

.a11y-tts-stop:hover {
  background: rgba(224, 188, 102, 0.28) !important;
  border-color: #DFAB2B !important;
}

/* Widget responsive: narrow panel */
@media (max-width: 340px) {
  .a11y-panel {
    min-width: 260px;
    width: calc(100vw - 1.5rem);
  }
}

/* Oversized widget */
.a11y-widget-wrap.a11y-oversized-widget {
  font-size: 18px;
}

.a11y-widget-wrap.a11y-oversized-widget .a11y-panel {
  width: min(440px, calc(100vw - 2rem));
  min-width: 320px;
}

.a11y-widget-wrap.a11y-oversized-widget .a11y-option-list {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}

.a11y-widget-wrap.a11y-oversized-widget .a11y-option {
  min-height: 100px;
  padding: 0.75rem 0.5rem;
  font-size: 0.9375rem;
}

.a11y-widget-wrap.a11y-oversized-widget .a11y-option-icon {
  width: 36px;
  height: 36px;
}

.a11y-widget-wrap.a11y-oversized-widget .a11y-option-icon svg {
  width: 30px;
  height: 30px;
}

/* ========== Body/HTML accessibility classes (applied by widget) ========== */
/* Contrast + – stepped: 1=Invert, 2=Dark, 3=Light */
html.a11y-contrast-invert body {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.a11y-contrast-invert img,
html.a11y-contrast-invert video {
  filter: invert(1) hue-rotate(180deg) !important;
}

html.a11y-contrast-dark,
html.a11y-contrast-dark body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-contrast-dark a {
  color: #7eb8ff !important;
  text-decoration: underline !important;
}

html.a11y-contrast-dark button,
html.a11y-contrast-dark input,
html.a11y-contrast-dark select,
html.a11y-contrast-dark textarea {
  background: #222 !important;
  color: #fff !important;
  border: 1px solid #555 !important;
}

html.a11y-contrast-light,
html.a11y-contrast-light body {
  background: #fff !important;
  color: #111 !important;
}

html.a11y-contrast-light a {
  color: #0066cc !important;
  text-decoration: underline !important;
}

html.a11y-contrast-light button,
html.a11y-contrast-light input,
html.a11y-contrast-light select,
html.a11y-contrast-light textarea {
  background: #f5f5f5 !important;
  color: #111 !important;
  border: 1px solid #333 !important;
}

/* Highlight links */
html.a11y-highlight-links a {
  outline: 2px solid #58a6ff !important;
  outline-offset: 2px !important;
  background: rgba(88, 166, 255, 0.15) !important;
}

/* Bigger text – stepped: 1=Big, 2=Bigger, 3=Biggest */
html.a11y-bigger-text-1 {
  font-size: 110% !important;
}

html.a11y-bigger-text-1 body {
  font-size: 1rem !important;
}

html.a11y-bigger-text-2 {
  font-size: 120% !important;
}

html.a11y-bigger-text-2 body {
  font-size: 1rem !important;
}

html.a11y-bigger-text-3 {
  font-size: 135% !important;
}

html.a11y-bigger-text-3 body {
  font-size: 1rem !important;
}

/* Text spacing – stepped: 1=Light, 2=Moderate, 3=Heavy */
html.a11y-text-spacing-1 * {
  letter-spacing: 0.06em !important;
  word-spacing: 0.1em !important;
}

html.a11y-text-spacing-2 * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

html.a11y-text-spacing-3 * {
  letter-spacing: 0.18em !important;
  word-spacing: 0.24em !important;
}

/* Pause animations */
html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* Hide images */
html.a11y-hide-images img {
  visibility: hidden !important;
}

/* Legible fonts */
html.a11y-legible-fonts,
html.a11y-legible-fonts * {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* Dyslexia-friendly font (Lexend – designed for readability) */
@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@400;500;600;700&display=swap');

html.a11y-dyslexia-friendly,
html.a11y-dyslexia-friendly * {
  font-family: 'Lexend Deca', sans-serif !important;
}

/* Cursor – stepped: 1=Big Cursor, 2=Reading Mask, 3=Reading Guide */
html.a11y-cursor-big,
html.a11y-cursor-big * {
  cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="black" stroke="white" stroke-width="1" d="M2 2 L2 28 L10 22 L14 30 L18 26 L14 18 L26 14 Z"/></svg>') 0 0, auto !important;
}

/* Reading mask: dimmed page with a bright horizontal band (reading strip) */
html.a11y-cursor-mask body {
  position: relative !important;
}

html.a11y-cursor-mask body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* Reading guide: highlight current line (thick underline effect on text) */
html.a11y-cursor-guide body {
  position: relative !important;
}

html.a11y-cursor-guide p,
html.a11y-cursor-guide li,
html.a11y-cursor-guide .site-main * {
  background: linear-gradient(transparent 60%, rgba(255, 235, 120, 0.4) 60%, rgba(255, 235, 120, 0.4) 85%, transparent 85%) !important;
  background-size: 100% 1.5em !important;
  background-repeat: repeat-y !important;
}

/* Tooltips: ensure title-based tooltips are visible */
html.a11y-tooltips [title]:focus::after {
  content: attr(title);
  position: absolute;
  background: #1e40af;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  z-index: 10000;
  margin-top: 0.25rem;
  border: 1px solid #2563eb;
}

/* Line height – stepped: 1=1.5x, 2=1.75x, 3=2x */
html.a11y-line-height-15 body,
html.a11y-line-height-15 .site-main,
html.a11y-line-height-15 p,
html.a11y-line-height-15 li,
html.a11y-line-height-15 h1,
html.a11y-line-height-15 h2,
html.a11y-line-height-15 h3 {
  line-height: 1.5 !important;
}

html.a11y-line-height-175 body,
html.a11y-line-height-175 .site-main,
html.a11y-line-height-175 p,
html.a11y-line-height-175 li,
html.a11y-line-height-175 h1,
html.a11y-line-height-175 h2,
html.a11y-line-height-175 h3 {
  line-height: 1.75 !important;
}

html.a11y-line-height-2 body,
html.a11y-line-height-2 .site-main,
html.a11y-line-height-2 p,
html.a11y-line-height-2 li,
html.a11y-line-height-2 h1,
html.a11y-line-height-2 h2,
html.a11y-line-height-2 h3 {
  line-height: 2 !important;
}

/* Text align – stepped: 1=Left, 2=Right, 3=Center, 4=Justify */
html.a11y-text-align-left body,
html.a11y-text-align-left .site-main,
html.a11y-text-align-left p,
html.a11y-text-align-left h1,
html.a11y-text-align-left h2,
html.a11y-text-align-left h3 {
  text-align: left !important;
}

html.a11y-text-align-right body,
html.a11y-text-align-right .site-main,
html.a11y-text-align-right p,
html.a11y-text-align-right h1,
html.a11y-text-align-right h2,
html.a11y-text-align-right h3 {
  text-align: right !important;
}

html.a11y-text-align-center body,
html.a11y-text-align-center .site-main,
html.a11y-text-align-center p,
html.a11y-text-align-center h1,
html.a11y-text-align-center h2,
html.a11y-text-align-center h3 {
  text-align: center !important;
}

html.a11y-text-align-justify body,
html.a11y-text-align-justify .site-main,
html.a11y-text-align-justify p,
html.a11y-text-align-justify h1,
html.a11y-text-align-justify h2,
html.a11y-text-align-justify h3 {
  text-align: justify !important;
}

/* Saturation – stepped: 1=Low, 2=High, 3=Desaturate */
html.a11y-saturation-low body {
  filter: saturate(0.65) !important;
}

html.a11y-saturation-high body {
  filter: saturate(1.4) !important;
}

html.a11y-saturation-none body {
  filter: saturate(0) !important;
}
