/* Shared accessibility controls for public pages using layouts.app. */
.accessibility-tools {
  position: fixed;
  left: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 96;
  color: #26333a;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.accessibility-fab {
  position: relative;
  display: inline-grid;
  width: 3.35rem;
  height: 3.35rem;
  place-items: center;
  border: 1px solid rgba(20, 90, 120, .24);
  border-radius: 50%;
  padding: 0;
  color: #145a78;
  background: linear-gradient(135deg, #fffaf1, #efb329);
  box-shadow: 0 18px 42px rgba(38, 51, 58, .22), inset 0 1px 0 rgba(255, 255, 255, .72);
  cursor: pointer;
  font: inherit;
  transition: transform .24s ease, box-shadow .24s ease, background .24s ease;
}

.accessibility-fab:hover { transform: translateY(-.2rem); box-shadow: 0 24px 54px rgba(38, 51, 58, .28); }
.accessibility-fab > span { position: absolute; top: 50%; left: calc(100% + .65rem); transform: translate(-.25rem, -50%); border: 1px solid rgba(20, 90, 120, .2); border-radius: 999px; padding: .45rem .68rem; color: #145a78; background: #fffaf1; box-shadow: 0 12px 28px rgba(38, 51, 58, .14); opacity: 0; pointer-events: none; white-space: nowrap; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; transition: opacity .22s ease, transform .22s ease; }
.accessibility-fab:hover > span, .accessibility-fab:focus-visible > span { opacity: 1; transform: translate(0, -50%); }
.accessibility-fab svg { width: 1.38rem; height: 1.38rem; }

.accessibility-panel {
  position: absolute;
  bottom: calc(100% + .75rem);
  left: 0;
  width: min(23rem, calc(100vw - 2rem));
  max-height: calc(100svh - 5.25rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(32, 128, 176, .24);
  border-radius: 1.45rem;
  color: #26333a;
  background: radial-gradient(circle at 0 0, rgba(239, 179, 41, .18), transparent 34%), linear-gradient(145deg, #fffaf1, #f4ead7);
  box-shadow: 0 32px 86px rgba(38, 51, 58, .32), inset 0 1px 0 rgba(255, 255, 255, .76);
  backdrop-filter: blur(22px);
}

.accessibility-panel[hidden] { display: none; }
.accessibility-panel::before { position: absolute; inset: 0 0 auto; height: .35rem; background: linear-gradient(90deg, #2080b0, #b93424, #efb329, #40a052, #ef7424); content: ""; }
.accessibility-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .75rem; }
.accessibility-panel__head p { margin: 0; color: #b93424; font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.accessibility-panel__head strong { display: block; margin-top: .2rem; color: #26333a; font-family: "Libre Caslon Display", Georgia, serif; font-size: 1.9rem; font-weight: 400; line-height: .95; }
.accessibility-close { min-height: 2.75rem; border: 1px solid rgba(20, 90, 120, .2); border-radius: 999px; padding: .55rem .75rem; color: #145a78; background: rgba(255, 255, 255, .72); cursor: pointer; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.accessibility-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; padding: 0 1rem 1rem; }
.accessibility-control { display: flex; min-height: 3.6rem; align-items: center; gap: .55rem; border: 1px solid rgba(32, 128, 176, .16); border-radius: 1rem; padding: .65rem .7rem; color: #26333a; background: rgba(255, 255, 255, .64); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; line-height: 1.15; text-align: left; transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease; }
.accessibility-control svg { width: 1.25rem; height: 1.25rem; flex: 0 0 1.25rem; color: #145a78; }
.accessibility-control:hover { transform: translateY(-.12rem); border-color: rgba(239, 179, 41, .55); background: rgba(239, 179, 41, .15); }
.accessibility-control[aria-pressed="true"] { border-color: #145a78; color: white; background: #145a78; }
.accessibility-control[aria-pressed="true"] svg { color: #efb329; }
.accessibility-note { margin: 0; border-top: 1px solid rgba(32, 128, 176, .14); padding: .75rem 1rem .9rem; color: #68747a; font-size: .82rem; line-height: 1.4; }

.reading-guide-line { position: fixed; top: var(--guide-y, 50vh); right: 0; left: 0; z-index: 95; display: none; height: 3.2rem; transform: translateY(-50%); border-block: 1px solid rgba(32, 128, 176, .16); background: linear-gradient(90deg, transparent, rgba(239, 179, 41, .22) 18%, rgba(239, 179, 41, .32) 50%, rgba(239, 179, 41, .22) 82%, transparent); pointer-events: none; }
html.a11y-reading-guide .reading-guide-line { display: block; }
html.a11y-font-n1 { font-size: 93.75%; }
html.a11y-font-p1 { font-size: 106.25%; }
html.a11y-font-p2 { font-size: 112.5%; }
html.a11y-font-p3 { font-size: 125%; }
html.a11y-readable body, html.a11y-readable p, html.a11y-readable li, html.a11y-readable a, html.a11y-readable button, html.a11y-readable input, html.a11y-readable textarea, html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3, html.a11y-readable h4, html.a11y-readable .font-serif { font-family: Arial, Verdana, system-ui, sans-serif !important; }
html.a11y-readable p, html.a11y-readable li { line-height: 1.72 !important; }
html.a11y-spacing p, html.a11y-spacing li, html.a11y-spacing a, html.a11y-spacing button { letter-spacing: .035em !important; word-spacing: .08em !important; line-height: 1.78 !important; }
html.a11y-grayscale main, html.a11y-grayscale header, html.a11y-grayscale footer { filter: grayscale(1); }
html.a11y-big-cursor body, html.a11y-big-cursor a, html.a11y-big-cursor button { cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 3l18 13-8 2 5 8-4 3-5-9-6 6V3z' fill='%23145a78' stroke='%23efb329' stroke-width='2'/%3E%3C/svg%3E") 5 3, auto !important; }

html.a11y-contrast { color-scheme: dark; }
html.a11y-contrast body { color: #fffaf1 !important; background: #11191d !important; }
html.a11y-contrast header, html.a11y-contrast footer, html.a11y-contrast section, html.a11y-contrast main, html.a11y-contrast article, html.a11y-contrast .bg-paper, html.a11y-contrast .bg-paper2, html.a11y-contrast .bg-white { color: #fffaf1 !important; border-color: rgba(239, 179, 41, .68) !important; background-color: #11191d !important; background-image: none !important; }
html.a11y-contrast p, html.a11y-contrast li, html.a11y-contrast span, html.a11y-contrast small, html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3, html.a11y-contrast h4, html.a11y-contrast strong { color: #fffaf1 !important; text-shadow: none !important; }
html.a11y-contrast a, html.a11y-contrast button { color: #fffaf1 !important; border-color: rgba(239, 179, 41, .8) !important; }
html.a11y-contrast a:not(.accessibility-fab), html.a11y-contrast button:not(.accessibility-fab):not(.accessibility-control):not(.accessibility-close) { background-color: #1d2a31 !important; }
html.a11y-contrast img, html.a11y-contrast video, html.a11y-contrast iframe { outline: 2px solid rgba(239, 179, 41, .65); }
html.a11y-contrast .accessibility-panel { color: #26333a !important; background: #fffaf1 !important; }
html.a11y-contrast .accessibility-panel p, html.a11y-contrast .accessibility-panel strong, html.a11y-contrast .accessibility-panel span { color: #26333a !important; }
html.a11y-contrast .accessibility-control { color: #26333a !important; background: white !important; }
html.a11y-contrast .accessibility-control[aria-pressed="true"] { color: white !important; background: #145a78 !important; }
html.a11y-reduced-motion { scroll-behavior: auto; }
html.a11y-reduced-motion *, html.a11y-reduced-motion *::before, html.a11y-reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

@media (max-width: 760px) {
  .accessibility-tools { left: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .accessibility-panel { width: min(22rem, calc(100vw - 1.5rem)); max-height: calc(100svh - 5.5rem); }
  .accessibility-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .accessibility-tools *, .accessibility-tools *::before, .accessibility-tools *::after { transition-duration: .001ms !important; }
}
