/* ==========================================================================
   Abundant & Comfort Living — Accessibility widget styles
   Pairs with assets/a11y-widget.js. Everything is namespaced "acl-" so it
   cannot collide with the site stylesheet. Remove both files and the two
   tags that load them to uninstall.
   ========================================================================== */

/* ---------- Widget shell ---------- */
.acl-a11y{
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink, #172B2E);
}
.acl-a11y[data-position="left"]{ left: max(16px, env(safe-area-inset-left)); }
.acl-a11y[data-position="right"]{ right: max(16px, env(safe-area-inset-right)); }

.acl-a11y *, .acl-a11y *::before, .acl-a11y *::after{ box-sizing: border-box; }
.acl-a11y [hidden]{ display: none !important; }

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

/* ---------- Floating button ---------- */
.acl-a11y__fab{
  width: 52px; height: 52px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--blue-700, #14567D);
  color: #fff;
  box-shadow: 0 8px 22px -6px rgba(14, 59, 84, 0.55);
  cursor: pointer;
}
.acl-a11y__fab:hover{ background: var(--blue-900, #0E3B54); }
.acl-a11y__fab svg{ width: 28px; height: 28px; display: block; }

/* ---------- Panel ---------- */
.acl-a11y__panel{
  position: absolute;
  bottom: 64px;
  width: min(22rem, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  background: var(--cream, #FBFAF6);
  color: var(--ink, #172B2E);
  border: 1px solid rgba(23, 43, 46, 0.25);
  border-radius: var(--radius-md, 18px);
  box-shadow: 0 24px 50px -18px rgba(14, 59, 84, 0.45);
}
.acl-a11y[data-position="left"] .acl-a11y__panel{ left: 0; }
.acl-a11y[data-position="right"] .acl-a11y__panel{ right: 0; }
.acl-a11y__panel:focus{ outline: none; }

.acl-a11y__head{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.acl-a11y__title{
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.25rem; line-height: 1.25;
  color: var(--blue-900, #0E3B54);
}
.acl-a11y__intro{
  margin: 0 0 14px;
  font-size: 0.875rem;
  color: var(--ink-soft, #3F5457);
}
.acl-a11y__group-label{
  display: block;
  margin: 14px 0 8px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--green-800, #456B1E);
}

/* ---------- Buttons inside the panel ---------- */
.acl-a11y__btn{
  appearance: none;
  min-height: 44px; min-width: 44px;
  padding: 8px 14px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  color: var(--blue-900, #0E3B54);
  background: #fff;
  border: 2px solid var(--blue-700, #14567D);
  border-radius: 12px;
  cursor: pointer;
}
.acl-a11y__btn:hover{ background: var(--blue-100, #E3F0F7); }
.acl-a11y__btn[aria-disabled="true"]{ opacity: 0.55; cursor: not-allowed; }
.acl-a11y__close{ padding: 8px; display: grid; place-items: center; }
.acl-a11y__close svg{ width: 20px; height: 20px; display: block; }

.acl-a11y__size{ display: flex; align-items: center; gap: 8px; }
.acl-a11y__size-value{
  flex: 1; text-align: center;
  font-weight: 700; font-size: 1rem;
  color: var(--blue-900, #0E3B54);
}

.acl-a11y__list{ list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acl-a11y__toggle{
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left;
}
.acl-a11y__state{
  flex-shrink: 0;
  min-width: 3.1em; padding: 2px 10px;
  text-align: center;
  font-size: 0.8rem; font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 100px;
}
.acl-a11y__toggle[aria-pressed="true"]{
  background: var(--blue-900, #0E3B54);
  color: #fff;
  border-color: var(--blue-900, #0E3B54);
}
.acl-a11y__toggle[aria-pressed="true"]:hover{ background: var(--blue-700, #14567D); }

.acl-a11y__reset{
  width: 100%; margin-top: 16px;
  color: #fff; background: var(--blue-700, #14567D);
}
.acl-a11y__reset:hover{ background: var(--blue-900, #0E3B54); }

/* Focus ring for everything in the widget (works on light and dark) */
.acl-a11y :focus-visible{
  outline: 3px solid #0E3B54;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff;
  border-radius: 12px;
}
.acl-a11y__fab:focus-visible{ border-radius: 50%; }

@media (max-width: 420px){
  .acl-a11y__panel{ padding: 14px; }
}

@media (prefers-reduced-motion: no-preference){
  .acl-a11y__fab{ transition: background 0.2s ease; }
}

/* ==========================================================================
   User-selected modes. All are applied as classes on <html> by the script.
   ========================================================================== */

/* --- Larger text: the site is built in rem, so the script scales the root
       font size. These rules stop fixed-width pieces from overflowing. --- */
html.acl-resized .btn,
html.acl-spacing .btn{ white-space: normal; text-align: center; }
html.acl-resized .site-header .wrap{ flex-wrap: wrap; row-gap: 8px; }
html.acl-resized .main-nav{ flex-wrap: wrap; row-gap: 4px; }
html.acl-resized .hero-trust li,
html.acl-resized .footer-contact li{ min-width: 0; }
html.acl-resized body{ overflow-wrap: anywhere; }

/* --- Readable font --- */
html.acl-font body,
html.acl-font body *:not(svg):not(svg *){
  font-family: Verdana, Tahoma, Arial, sans-serif !important;
  font-style: normal !important;
}

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

/* --- Underline links --- */
html.acl-links a{
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 0.2em !important;
}

/* --- Strong keyboard focus --- */
html.acl-focus :focus,
html.acl-focus :focus-visible{
  outline: 4px solid #FFBF00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 8px #000 !important;
  border-radius: 4px;
}

/* --- Stop animation --- */
html.acl-nomotion,
html.acl-nomotion *,
html.acl-nomotion *::before,
html.acl-nomotion *::after{
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.acl-nomotion .reveal{ opacity: 1 !important; transform: none !important; }

/* --- Inverted colours (images, video and maps are flipped back) --- */
html.acl-contrast-invert{ filter: invert(1) hue-rotate(180deg); }
html.acl-contrast-invert img,
html.acl-contrast-invert video,
html.acl-contrast-invert iframe,
html.acl-contrast-invert picture{ filter: invert(1) hue-rotate(180deg); }

/* --- High contrast: black background, white text, yellow links --- */
html.acl-contrast-high,
html.acl-contrast-high body{ background: #000 !important; color: #fff !important; }
html.acl-contrast-high *:not(svg):not(svg *){
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.acl-contrast-high svg{ color: #fff !important; }
html.acl-contrast-high a,
html.acl-contrast-high a *:not(svg):not(svg *){
  color: #FFEA00 !important;
  text-decoration: underline !important;
}
html.acl-contrast-high .btn,
html.acl-contrast-high button,
html.acl-contrast-high input,
html.acl-contrast-high select,
html.acl-contrast-high textarea{ border: 2px solid #fff !important; }
html.acl-contrast-high img{ opacity: 1 !important; }
html.acl-contrast-high .reveal{ opacity: 1 !important; }
html.acl-contrast-high :focus-visible{
  outline: 4px solid #FFEA00 !important;
  outline-offset: 3px !important;
}
/* Widget: keep the "on" state obvious without relying on colour alone */
html.acl-contrast-high .acl-a11y__toggle[aria-pressed="true"]{
  border: 4px solid #FFEA00 !important;
}
html.acl-contrast-high .acl-a11y__state{ border: 2px solid #fff !important; }

/* --- Windows High Contrast / forced colors: let the system take over --- */
@media (forced-colors: active){
  .acl-a11y__fab, .acl-a11y__btn, .acl-a11y__panel{ border: 2px solid ButtonText; }
  .acl-a11y__toggle[aria-pressed="true"]{ border: 4px solid Highlight; }
}

@media print{
  .acl-a11y{ display: none !important; }
}
