/* Reading options — shared by the homepage and the Readapt legal pages.
   Preferences are applied as body classes by /reading.js and stored in
   localStorage only (never transmitted). OpenDyslexic is self-hosted so
   these pages make no third-party requests. */

@font-face {
  font-family: "OpenDyslexic";
  src: url("/fonts/OpenDyslexic-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "OpenDyslexic";
  src: url("/fonts/OpenDyslexic-Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

/* --- Preference effects --- */

body.ro-font-dyslexic,
body.ro-font-dyslexic h1,
body.ro-font-dyslexic h2,
body.ro-font-dyslexic .wordmark {
  font-family: "OpenDyslexic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

body.ro-size-large { font-size: 18px; }
body.ro-size-larger { font-size: 21px; }

body.ro-spacing-relaxed { line-height: 2.1; letter-spacing: 0.02em; }
body.ro-spacing-relaxed p,
body.ro-spacing-relaxed li { margin-bottom: 20px; }

/* --- The options bar --- */

#reading-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 24px 0;
  font-size: 13px;
  /* The bar keeps its own compact type regardless of page settings */
  line-height: 1.4;
  letter-spacing: normal;
}

#reading-options[hidden] { display: none; }

#reading-options .ro-label {
  font-weight: 600;
  color: #2D4A3E;
  margin-right: 2px;
}

#reading-options .ro-group {
  display: inline-flex;
  border: 1px solid #d5d0c8;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
}

#reading-options button {
  font: inherit;
  font-size: 13px;
  border: none;
  background: transparent;
  color: #2D4A3E;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 32px;
}

#reading-options button + button {
  border-left: 1px solid #d5d0c8;
}

#reading-options button[aria-pressed="true"] {
  background: #2D4A3E;
  color: #ffffff;
}

#reading-options button:focus-visible {
  outline: 3px solid #1a2f3d;
  outline-offset: 2px;
}

#reading-options .ro-note {
  color: #5a6b7a;
  flex-basis: 100%;
}

/* Skip link — visually hidden until a keyboard user tabs to it (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: #2D4A3E;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

@media (min-width: 720px) {
  #reading-options .ro-note {
    flex-basis: auto;
    margin-left: auto;
  }
}
