/**
 * CIC Accessibility Toolbar Styles
 * Zero external dependencies — no web fonts, no CDN references.
 */

/* ── Toolbar wrapper ──────────────────────────────────────────────── */
#cic-accessibility-toolbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Toggle button — same style as topStrip header bar links ─────── */
#cic-a11y-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  height: 37px;
  /* matches topStrip bar height */
  background: #062a4a;
  color: #fff;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  /* subtle separator like other topStrip items */
  cursor: pointer;
  font-size: 87.5%;
  /* same as site body font */
  font-family: open_sansregular, Arial, sans-serif;
  font-weight: normal;
  line-height: 23px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: normal;
  box-shadow: none;
  border-radius: 0;
  transition: color 0.2s;
}

#cic-a11y-toggle:hover,
#cic-a11y-toggle:focus {
  color: #fbb8c9;
  text-decoration: underline;
  background: #062a4a;
  outline: none;
}


/* ── Controls panel — drops below the toggle button ─────────────── */
#cic-a11y-controls {
  background: #fff;
  border: 1px solid #ddd;
  border-top: 3px solid #062a4a;
  border-radius: 0 0 0 10px;
  box-shadow: -4px 8px 20px rgba(0, 0, 0, 0.25);
  width: 320px;
  padding: 14px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

#cic-a11y-controls[hidden] {
  display: none;
}

/* ── Section title ────────────────────────────────────────────────── */
.cic-a11y-section-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #062a4a;
  border-bottom: 2px solid #062a4a;
  padding-bottom: 4px;
  margin-top: 4px;
  width: 100%;
}

/* ── Button row wrapper ───────────────────────────────────────────── */
#cic-a11y-controls .cic-a11y-section-title~.cic-a11y-btn,
#cic-a11y-controls {
  flex-wrap: wrap;
}

/* Grid of buttons */
#cic-a11y-controls {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
}

.cic-a11y-section-title {
  flex-basis: 100%;
}

/* ── Individual buttons ───────────────────────────────────────────── */
.cic-a11y-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px 6px;
  background: #f5f7fa;
  color: #062a4a;
  border: 1.5px solid #d0d7e3;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  width: 80px;
  min-height: 68px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: normal;
  line-height: 1.2;
}

.cic-a11y-btn:hover,
.cic-a11y-btn:focus {
  background: #e0e8f4;
  border-color: #062a4a;
  outline: none;
}

.cic-a11y-btn[aria-pressed="true"] {
  background: #062a4a;
  color: #fff;
  border-color: #062a4a;
}

.cic-a11y-btn[aria-pressed="true"]:hover,
.cic-a11y-btn[aria-pressed="true"]:focus {
  background: #03172B;
  border-color: #03172B;
}

.cic-a11y-btn[aria-pressed="true"] svg {
  stroke: #fff;
  fill: #fff;
}

/* Reset button – spans full row */
.cic-reset-btn {
  flex-basis: 100%;
  width: 100%;
  flex-direction: row;
  justify-content: center;
  padding: 8px 14px;
  background: #8b1a1a;
  color: #fff;
  border-color: #8b1a1a;
  font-size: 12px;
  min-height: 38px;
  border-radius: 6px;
  margin-top: 4px;
}

.cic-reset-btn:hover,
.cic-reset-btn:focus {
  background: #6b1010;
  border-color: #6b1010;
}

.cic-reset-btn svg {
  stroke: #fff;
}

/* ── Body-level accessibility classes ────────────────────────────── */

/* High contrast */
body.cic-high-contrast,
body.cic-high-contrast * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.cic-high-contrast a,
body.cic-high-contrast a * {
  color: #ff0 !important;
}

body.cic-high-contrast img {
  filter: contrast(120%) brightness(90%);
}

body.cic-high-contrast #cic-accessibility-toolbar,
body.cic-high-contrast #cic-accessibility-toolbar * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Normal contrast – reset any custom contrast */
body.cic-normal-contrast {
  filter: contrast(100%) !important;
}

/* Highlight links */
body.cic-highlight-links a {
  background-color: #ff0 !important;
  color: #000 !important;
  text-decoration: underline !important;
  padding: 0 2px;
  border-radius: 2px;
}

/* Invert */
body.cic-invert {
  filter: invert(100%);
}

body.cic-invert img,
body.cic-invert video {
  filter: invert(100%);
}

body.cic-invert #cic-accessibility-toolbar {
  filter: invert(100%);
}

/* Saturation (low saturation) */
body.cic-saturation {
  filter: saturate(50%);
}

body.cic-saturation #cic-accessibility-toolbar {
  filter: saturate(100%);
}

/* Grayscale */
body.cic-grayscale {
  filter: grayscale(100%);
}

/* Readable font */
body.cic-readable-font,
body.cic-readable-font p,
body.cic-readable-font li,
body.cic-readable-font td,
body.cic-readable-font th,
body.cic-readable-font h1,
body.cic-readable-font h2,
body.cic-readable-font h3,
body.cic-readable-font h4,
body.cic-readable-font h5,
body.cic-readable-font h6,
body.cic-readable-font span,
body.cic-readable-font div {
  font-family: Georgia, 'Times New Roman', serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
}

/* Text spacing */
body.cic-text-spacing * {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
  font-size: inherit;
}

/* Line height */
body.cic-line-height * {
  line-height: 2.0 !important;
}

/* Hide images */
body.cic-hide-images img,
body.cic-hide-images svg:not(#cic-accessibility-toolbar svg),
body.cic-hide-images video,
body.cic-hide-images picture {
  visibility: hidden !important;
}

/* Big cursor */
body.cic-big-cursor,
body.cic-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M5 3l14 9-7.5 1.5L8 21z'/%3E%3C/svg%3E") 5 5, auto !important;
}

/* ── Focus indicator (WCAG 2.4.7) ────────────────────────────────── */
body.cic-high-contrast *:focus {
  outline: 3px solid #ff0 !important;
  outline-offset: 3px !important;
}