/* ==========================================================================
   Janae Inc. shared accessibility layer (all designs)
   - Utilities, skip link, focus, accessibility widget, lightbox,
     and the user-selectable modes set by assets/js/site.js
   ========================================================================== */

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: 10000;
  padding: .85rem 1.25rem; background: #111; color: #fff; font-weight: 700;
  text-decoration: none; border-radius: .5rem; border: 3px solid #fff;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: none; outline: 3px solid #ffbf47; outline-offset: 2px; }

main:focus { outline: none; }

/* Every design sets --focus; this guarantees a visible indicator everywhere */
:focus-visible { outline: 3px solid var(--focus, #1a5fd0); outline-offset: 3px; }

img { max-width: 100%; height: auto; }

/* Reduced motion: honour the OS preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ---------------- Accessibility widget ---------------- */
.a11y-widget { position: fixed; left: 1rem; bottom: 1rem; z-index: 9000; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.a11y-fab {
  width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 2px solid #fff;
  background: #1a4fb8; color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); transition: transform .2s;
}
.a11y-fab:hover { transform: scale(1.06); }
.a11y-fab:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.a11y-panel {
  position: absolute; left: 0; bottom: 4rem; width: min(20rem, calc(100vw - 2rem));
  background: #fff; color: #111; border-radius: 1rem; padding: 1.1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid #d0d4dc;
  font-size: 1rem; line-height: 1.4;
}
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.a11y-head h2 { margin: 0; font-size: 1.15rem; font-family: inherit; color: #111; letter-spacing: 0; text-transform: none; }
.a11y-close { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid #b9bec8; background: #fff; color: #111; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.a11y-label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .4rem; color: #333; }
.a11y-size { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.a11y-size button { flex: 1; min-height: 2.75rem; border-radius: .6rem; border: 1px solid #b9bec8; background: #f3f5f9; color: #111; font-weight: 700; font-size: 1rem; cursor: pointer; }
.a11y-size output { min-width: 4rem; text-align: center; font-weight: 700; }
.a11y-toggles { display: grid; gap: .4rem; }
.a11y-toggle {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 2.75rem; padding: .5rem .75rem;
  border-radius: .6rem; border: 1px solid #d0d4dc; background: #f7f8fb; color: #111;
  font: inherit; font-size: .95rem; text-align: left; cursor: pointer;
}
.a11y-switch { position: relative; width: 2.3rem; height: 1.3rem; border-radius: 1rem; background: #8a909c; flex: none; transition: background .2s; }
.a11y-switch::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: transform .2s; }
.a11y-toggle[aria-pressed="true"] { border-color: #1a4fb8; background: #eaf0fd; }
.a11y-toggle[aria-pressed="true"] .a11y-switch { background: #1a4fb8; }
.a11y-toggle[aria-pressed="true"] .a11y-switch::after { transform: translateX(1rem); }
.a11y-reset { margin-top: .8rem; width: 100%; min-height: 2.75rem; border-radius: .6rem; border: 2px solid #111; background: #fff; color: #111; font-weight: 700; cursor: pointer; }
.a11y-note { margin: .8rem 0 0; font-size: .82rem; color: #444; }
.a11y-note a { color: #1a4fb8; }
.a11y-widget :focus-visible { outline: 3px solid #1a4fb8; outline-offset: 2px; }

/* ---------------- Lightbox ---------------- */
.lightbox {
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 4rem 1rem 3rem;
  border: 0; background: rgba(8,8,10,.94); color: #fff; overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; animation: lb-in .3s ease; }
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lightbox-figure { margin: 0; display: grid; gap: .8rem; justify-items: center; max-width: min(1100px, 92vw); }
.lightbox-figure img { max-height: 76vh; width: auto; border-radius: .5rem; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox-figure figcaption { font-size: 1rem; text-align: center; color: #e8e8e8; }
.lightbox-count { position: absolute; top: 1.3rem; left: 1.5rem; margin: 0; font-size: .9rem; color: #ddd; }
.lightbox-btn {
  position: absolute; width: 3.25rem; height: 3.25rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.5); color: #fff; font-size: 1.5rem; cursor: pointer; display: grid; place-items: center;
}
.lightbox-btn:hover { background: #fff; color: #000; }
.lightbox-btn:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- User-selected modes ---------------- */

/* Stop animations */
.a11y-no-motion *, .a11y-no-motion *::before, .a11y-no-motion *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
.a11y-no-motion [data-reveal], .a11y-no-motion [data-split] .wi { opacity: 1 !important; transform: none !important; clip-path: none !important; }

/* Highlight links */
.a11y-links a:not(.a11y-widget a) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
  outline: 2px dashed currentColor; outline-offset: 2px;
}

/* Readable font */
.a11y-readable body, .a11y-readable body *:not(svg):not(svg *) {
  font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
  font-style: normal !important;
}

/* Text spacing (WCAG 1.4.12 values) */
.a11y-spacing body *:not(svg *) {
  line-height: 1.6 !important; letter-spacing: .12em !important; word-spacing: .16em !important;
}
.a11y-spacing p { margin-bottom: 2em !important; }

/* High contrast */
.a11y-contrast body, .a11y-contrast body *:not(img):not(video):not(iframe):not(svg):not(svg *):not(.a11y-widget):not(.a11y-widget *) {
  background-color: #000 !important; background-image: none !important; color: #fff !important;
  border-color: #fff !important; text-shadow: none !important; box-shadow: none !important;
}
.a11y-contrast body a:not(.a11y-widget a), .a11y-contrast body a *:not(img) { color: #ffe94d !important; }
.a11y-contrast body button:not(.a11y-widget button), .a11y-contrast input, .a11y-contrast textarea, .a11y-contrast select { border: 2px solid #fff !important; }
.a11y-contrast svg:not(.a11y-widget svg) { color: #fff !important; }
.a11y-contrast [class*="overlay"], .a11y-contrast [class*="scrim"] { opacity: .85 !important; }
.a11y-contrast :focus-visible { outline-color: #ffe94d !important; }

/* Long words / emails never force horizontal scrolling (WCAG 1.4.10 reflow),
   even with the text-size control at its maximum. */
h1, h2, h3, h4 { overflow-wrap: anywhere; }
p, li, a, dd, dt, figcaption, blockquote, address, label { overflow-wrap: break-word; }
a[href^="mailto:"] { overflow-wrap: anywhere; }
