/* FV Accessibility — frontend button + drawer.
 *
 * Note on cascade: feature classes on <html> (in fv-a11y-features.css)
 * intentionally use `body :not(.fv-a11y-button)*...` selectors to skip
 * our UI. Where unavoidable, the rules below re-declare typography
 * properties with !important so the menu/button stay readable even if a
 * user enables every text adjustment.
 */
.fv-a11y-button,
.fv-a11y-button *,
.fv-a11y-panel,
.fv-a11y-panel * {
  font-family: "Heebo", "Assistant", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}
.fv-a11y-panel,
.fv-a11y-panel * {
  font-size: 15px !important;
  line-height: 1.45 !important;
  text-align: start !important;
}
.fv-a11y-panel h2 { font-size: 18px !important }
.fv-a11y-panel h3 { font-size: 16px !important }


/* Trigger button. Position properties are emitted inline per-request based on
   the desktop/mobile config; this stylesheet only owns appearance + chrome. */
/* Defensive `!important` on the visual properties: many themes (Bootstrap,
   AMP-derived, custom resets) override `button` background, border-radius
   and outline on :focus and :active. Without these we'd see the button
   "turn into a gray square" the moment it's clicked. */
.fv-a11y-button {
  position: fixed;
  z-index: 999999;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--fv-a11y-bg, #1d4ed8) !important;
  color: var(--fv-a11y-fg, #ffffff) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  /* Defensive box-model: many themes add padding, min-width, min-height
     and font-size to bare <button> — those would skew our circle into
     an ellipse and crowd out the icon. Lock everything we care about. */
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  box-sizing: border-box !important;
  aspect-ratio: 1 / 1 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  /* Composes the positional transform (set inline as --fv-a11y-pos-transform
     by inline_styles()) with any visual transform we want to add. */
  transform: var(--fv-a11y-pos-transform);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  outline: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.fv-a11y-button:hover,
.fv-a11y-button:focus,
.fv-a11y-button:active {
  background: var(--fv-a11y-bg, #1d4ed8) !important;
  color: var(--fv-a11y-fg, #ffffff) !important;
  border-radius: 50% !important;
  border: 0 !important;
}

.fv-a11y-button:hover {
  transform: var(--fv-a11y-pos-transform) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

.fv-a11y-button:focus-visible {
  outline: 3px solid #ffffff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px currentColor !important;
}

.fv-a11y-icon {
  display: block !important;
  width: 60% !important;
  height: 60% !important;
  fill: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  /* Themes occasionally apply `svg { display: none }` resets or filter:
     transitions; force visible. */
}

/* Drawer panel. Slides in from the right edge regardless of document
   direction; translateX(100%) is purely geometric. */
.fv-a11y-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(380px, 92vw);
  background: #ffffff !important;
  color: #111827 !important;
  z-index: 1000000;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  font-family: "Heebo", "Assistant", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.fv-a11y-panel.is-open {
  transform: translateX(0);
}

.fv-a11y-panel[hidden] {
  display: none;
}

.fv-a11y-panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.fv-a11y-panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.fv-a11y-panel-header h2:focus {
  outline: none;
}

/* Generic reset for the drawer's buttons — only universally-safe
   properties. Dimensions (padding/min-/max-/width/height) stay free
   so each specific button class (.fv-a11y-ctl, .fv-a11y-panel-close,
   etc.) can declare its own. */
.fv-a11y-panel button {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  font-family: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-shadow: none !important;
}

.fv-a11y-panel-close {
  background: transparent !important;
  border: 0 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  color: #4b5563 !important;
  padding: 0 6px !important;
  border-radius: 4px !important;
  width: auto !important;
  height: auto !important;
}

.fv-a11y-panel-close:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.fv-a11y-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: #ffffff !important;
  color: #111827 !important;
}

.fv-a11y-placeholder {
  color: #6b7280;
  text-align: center;
  padding: 32px 8px;
  margin: 0;
}

.fv-a11y-panel-footer {
  border-top: 1px solid #e5e7eb !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  text-align: center !important;
  background: #ffffff !important;
  color: #111827 !important;
}

.fv-a11y-statement-link,
.fv-a11y-statement-link:visited,
.fv-a11y-statement-link:hover,
.fv-a11y-statement-link:focus,
.fv-a11y-statement-link:active {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
  background: transparent !important;
}

.fv-a11y-statement-link:focus-visible {
  outline: 2px solid #1d4ed8 !important;
  outline-offset: 2px;
}

/* Drawer sections (main + feedback + structure + outline). Only one
   visible at a time; the currently-shown one fills the body. Some themes
   override the default `[hidden] { display: none }` (Bootstrap-style
   resets do), so this needs to be !important. */
.fv-a11y-section[hidden],
.fv-a11y-panel [hidden] {
  display: none !important;
}

.fv-a11y-section-back {
  background: transparent !important;
  border: 0 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  color: #1d4ed8 !important;
  cursor: pointer !important;
  padding: 4px 0 !important;
  margin: 0 0 8px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
}

.fv-a11y-section-back:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.fv-a11y-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

/* aria-live region for state-change announcements. Visually hidden but
   readable by screen readers (the standard "sr-only" pattern). */
.fv-a11y-announce {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Feature control grid (the drawer's "main" section content). */
.fv-a11y-controls-cat {
  margin-bottom: 18px;
}

.fv-a11y-controls-cat h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fv-a11y-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.fv-a11y-ctl {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px;
  min-height: 92px !important;
  padding: 12px 8px 16px !important;
  background: #f3f4f6 !important;
  border: 2px solid transparent !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  color: #111827 !important;
  cursor: pointer !important;
  text-align: center !important;
  width: auto !important;
  height: auto !important;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.fv-a11y-ctl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #1d4ed8;
  flex-shrink: 0;
}
.fv-a11y-ctl-icon svg { width: 100%; height: 100%; display: block; }
.fv-a11y-ctl.is-active .fv-a11y-ctl-icon { color: inherit; }

.fv-a11y-ctl-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.fv-a11y-ctl-dot {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #c7d2fe;
  transition: background 0.12s ease;
}

.fv-a11y-ctl-dot.is-on { background: #1d4ed8; }
.fv-a11y-ctl.is-active .fv-a11y-ctl-dot { background: #93c5fd; }
.fv-a11y-ctl.is-active .fv-a11y-ctl-dot.is-on { background: #ffffff; }

.fv-a11y-ctl:hover {
  background: #e5e7eb;
}

.fv-a11y-ctl.is-active {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.fv-a11y-ctl:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.fv-a11y-ctl-label {
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 500;
}

.fv-a11y-ctl-state:empty { display: none }
.fv-a11y-ctl-state {
  /* Step indicator (1/3, 2/3...) is now communicated by the dots row
     below the button, so the textual state badge is purely for cycle
     names ('right', 'high'). Hidden visually by default. */
  display: none;
}

/* Custom-colors picker: occupies a full grid row, three inline color
   inputs labeled, plus a clear button. Wider than a single button cell so
   it spans the 2-column grid. */
.fv-a11y-color-picker {
  grid-column: 1 / -1;
  background: #f3f4f6;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px;
}

.fv-a11y-color-picker > .fv-a11y-ctl-label {
  display: block;
  font-size: 13px !important;
  font-weight: 600;
  margin-bottom: 8px;
}

.fv-a11y-color-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.fv-a11y-color-row label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px !important;
  color: #4b5563;
}

.fv-a11y-color-row input[type="color"] {
  width: 100%;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
  background: #ffffff;
}

.fv-a11y-color-clear {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font: inherit;
  font-size: 12px !important;
  cursor: pointer;
}
.fv-a11y-color-clear:hover { background: #f9fafb; }

/* Profile chips (one-click presets) — visually distinct from the regular
   feature buttons so they read as "shortcuts that bundle multiple". */
.fv-a11y-profile-chip {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 12px 14px !important;
  background: #eef2ff !important;
  border: 2px solid transparent !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  color: #1e3a8a !important;
  cursor: pointer !important;
  text-align: start !important;
  margin-bottom: 6px !important;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.fv-a11y-profile-chip:hover  { background: #dbeafe; }
.fv-a11y-profile-chip.is-active { background: #1d4ed8; color: #ffffff; border-color: #1e3a8a; }
.fv-a11y-profile-chip:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* Page structure / outline sub-section: tabs + scrollable list. */
.fv-a11y-structure-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px;
}
.fv-a11y-structure-tabs button {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13px !important;
  color: #4b5563;
  cursor: pointer;
}
.fv-a11y-structure-tabs button.is-active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}
.fv-a11y-structure-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}
.fv-a11y-structure-list[hidden] { display: none; }
.fv-a11y-structure-list li {
  margin-bottom: 4px;
}
.fv-a11y-structure-list button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  background: #f9fafb;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 13px !important;
  text-align: start;
  color: #111827;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fv-a11y-structure-list button:hover { background: #e5e7eb; }
.fv-a11y-structure-list button:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.fv-a11y-structure-list .fv-a11y-h-1 { font-weight: 700 }
.fv-a11y-structure-list .fv-a11y-h-2 { padding-inline-start: 18px !important; font-weight: 600 }
.fv-a11y-structure-list .fv-a11y-h-3 { padding-inline-start: 28px !important }
.fv-a11y-structure-list .fv-a11y-h-4 { padding-inline-start: 38px !important; color: #4b5563 }
.fv-a11y-structure-list .fv-a11y-h-5 { padding-inline-start: 46px !important; color: #6b7280 }
.fv-a11y-structure-list .fv-a11y-h-6 { padding-inline-start: 54px !important; color: #6b7280 }
.fv-a11y-structure-empty {
  padding: 20px 8px;
  color: #6b7280;
  text-align: center;
}

.fv-a11y-reset {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 14px 0 8px !important;
  padding: 10px 14px !important;
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fbbf24 !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
}

.fv-a11y-reset:hover {
  background: #fde68a;
}

.fv-a11y-reset:focus-visible {
  outline: 2px solid #b45309;
  outline-offset: 2px;
}

.fv-a11y-feedback-trigger {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 12px auto 0 !important;
  padding: 10px 14px !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
}

.fv-a11y-feedback-trigger:hover {
  background: #1e40af;
}

.fv-a11y-feedback-trigger:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #1d4ed8;
}

/* Feedback form (used inside the drawer and via the shortcode in the
   statement page). */
.fv-a11y-feedback-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.fv-a11y-feedback-form label span {
  display: block;
  margin-bottom: 4px;
  color: #374151;
}

.fv-a11y-feedback-form input[type="text"],
.fv-a11y-feedback-form input[type="email"],
.fv-a11y-feedback-form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
  background: #ffffff;
}

.fv-a11y-feedback-form input:focus-visible,
.fv-a11y-feedback-form textarea:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
  border-color: #1d4ed8;
}

.fv-a11y-feedback-form .fv-a11y-fb-desc {
  color: #6b7280;
  margin: 0 0 12px;
  font-size: 13px;
}

.fv-a11y-feedback-form .fv-a11y-fb-submit {
  margin-top: 4px;
  padding: 9px 18px;
  background: #1d4ed8;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.fv-a11y-feedback-form .fv-a11y-fb-submit[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.fv-a11y-feedback-form .fv-a11y-fb-status {
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 13px;
}

.fv-a11y-feedback-form .fv-a11y-fb-status.is-success { color: #065f46; }
.fv-a11y-feedback-form .fv-a11y-fb-status.is-error   { color: #b91c1c; }

/* Statement page chrome (rendered by [fv_accessibility_statement]). */
.fv-a11y-statement {
  font-family: "Heebo", "Assistant", system-ui, sans-serif;
  line-height: 1.7;
}
.fv-a11y-statement h2 { font-size: 28px; margin: 0 0 12px; }
.fv-a11y-statement h3 { font-size: 18px; margin: 24px 0 8px; }
.fv-a11y-statement ul.fv-a11y-coordinator { list-style: none; padding: 0; }
.fv-a11y-statement ul.fv-a11y-coordinator li { padding: 4px 0; }
.fv-a11y-statement-meta { color: #6b7280; font-size: 13px; margin-top: 24px; }
.fv-a11y-statement-disclaimer { color: #6b7280; margin-top: 12px; }

/* Reduced-motion users get instant transitions and no scale-up on hover. */
@media (prefers-reduced-motion: reduce) {
  .fv-a11y-button,
  .fv-a11y-panel {
    transition: none;
  }
  .fv-a11y-button:hover {
    /* Skip the scale-up under reduced motion, but keep the positional
       transform so the button stays where it should. */
    transform: var(--fv-a11y-pos-transform);
  }
}
