/* Endo Diatribes accessibility fixes and Accessibility Options panel.
   Loaded after each page's own styles so these rules take priority. */

/* ---------- Color contrast (WCAG 2.2 AA, 4.5:1 for body text) ---------- */
:root {
  --pink: #E0005A;       /* was #FF4D94; white text on it now passes 4.5:1 */
  --pink-deep: #B8005A;  /* was #D6006B; passes on pale pink and pale yellow */
}
.footer-bottom, .footer-bottom a { color: rgba(255,255,255,0.72) !important; }
.fund-note { color: #B5B5B5 !important; }
.post-footer .post-meta, .post-footer .post-meta time, .blog-card .blog-meta, .blog-card .blog-meta time { color: #6B6B6B !important; }
/* Links inside running text are underlined so they are not identified by color alone */
main p a:not([class]), main li a:not([class]) { text-decoration: underline !important; text-underline-offset: 2px; }
.strip-stat-label { color: #FFFFFF !important; }
.organic-cta { background: #1E7E46 !important; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 10000;
  background: #1A1A1A; color: #FFD93D !important; padding: 0.75rem 1.25rem;
  border: 3px solid #FFD93D; border-radius: 8px; font-weight: 700; text-decoration: underline;
}
.skip-link:focus { top: 1rem; }

/* ---------- Visible keyboard focus ---------- */
:focus-visible {
  outline: 3px solid #FFD93D !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px #1A1A1A !important;
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility Options: effects ---------- */
html.a11y-text-1 { font-size: 112.5% !important; }
html.a11y-text-2 { font-size: 125% !important; }
html.a11y-text-3 { font-size: 140% !important; }

html.a11y-links a:not(.a11y-btn) { text-decoration: underline !important; text-underline-offset: 3px; }

html.a11y-font body, html.a11y-font body * {
  font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
  letter-spacing: 0.02em !important; word-spacing: 0.08em !important;
}
html.a11y-font p, html.a11y-font li { line-height: 1.9 !important; }

html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

html.a11y-contrast body, html.a11y-contrast body *:not(img):not(svg):not(path) {
  background-color: #000000 !important; background-image: none !important;
  color: #FFFFFF !important; border-color: #FFFFFF !important; text-shadow: none !important;
}
html.a11y-contrast body a, html.a11y-contrast body a * { color: #FFD93D !important; text-decoration: underline !important; }
html.a11y-contrast body button, html.a11y-contrast body .btn-submit,
html.a11y-contrast body input, html.a11y-contrast body select, html.a11y-contrast body textarea {
  border: 2px solid #FFFFFF !important;
}

/* ---------- Accessibility Options: panel ---------- */
.a11y-toggle {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 9998;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: #1A1A1A; color: #FFFFFF; border: 3px solid #FFD93D; border-radius: 999px;
  padding: 0.6rem 1rem; font: 700 0.9rem/1.2 "DM Sans", Arial, sans-serif; cursor: pointer;
}
.a11y-toggle svg { width: 1.3rem; height: 1.3rem; flex-shrink: 0; }
.a11y-panel {
  position: fixed; left: 1rem; bottom: 4.75rem; z-index: 9999; width: min(320px, calc(100vw - 2rem));
  max-height: calc(100vh - 6rem); overflow-y: auto;
  background: #FFFFFF; color: #1A1A1A; border: 3px solid #1A1A1A; border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font: 400 1rem/1.4 "DM Sans", Arial, sans-serif;
}
.a11y-panel[hidden] { display: none !important; }
.a11y-panel h2 { font: 800 1.15rem/1.2 "DM Sans", Arial, sans-serif; margin: 0 0 0.75rem; color: #1A1A1A; }
.a11y-panel .a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.a11y-panel .a11y-label { font-weight: 600; font-size: 0.95rem; }
.a11y-btn {
  background: #FFFFFF; color: #1A1A1A; border: 2px solid #1A1A1A; border-radius: 8px;
  padding: 0.45rem 0.75rem; font: 700 0.9rem/1.1 "DM Sans", Arial, sans-serif; cursor: pointer; min-width: 44px; min-height: 44px;
}
.a11y-switch { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; text-align: left; }
.a11y-switch .a11y-state { font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1.5px solid currentColor; }
.a11y-btn[aria-pressed="true"] { background: #1A1A1A; color: #FFD93D; }
.a11y-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.a11y-panel .a11y-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid #DDDDDD; }
.a11y-panel .a11y-foot a { color: #B8005A; font-weight: 700; text-decoration: underline; font-size: 0.9rem; }
html.a11y-contrast .a11y-panel, html.a11y-contrast .a11y-panel * { background-color: #000000 !important; color: #FFFFFF !important; }
html.a11y-contrast .a11y-btn[aria-pressed="true"] { background-color: #FFD93D !important; color: #000000 !important; }
@media print { .a11y-toggle, .a11y-panel, .skip-link { display: none !important; } }
html.a11y-contrast body *::before, html.a11y-contrast body *::after { background: none !important; box-shadow: none !important; }
html.a11y-contrast .a11y-btn[aria-pressed="true"] * { background-color: transparent !important; color: #000000 !important; border-color: #000000 !important; }
html.a11y-contrast .a11y-panel { border: 3px solid #FFFFFF !important; }
