/* Port Fairy accessibility panel */
:root {
  --pfa-olive: #afad72;
  --pfa-chesnut: #673c33;
  --pfa-deep: #2b1a16;
  --pfa-beige: #ede8d0;
  --pfa-sun: #ffeda8;
  --pfa-head: 'Antonio', 'Arial Narrow', sans-serif;
  --pfa-body: 'Work Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Widget ---------- */
.pfa-root, .pfa-root * { box-sizing: border-box; }
.pfa-root {
  font-family: var(--pfa-body);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  color: var(--pfa-deep);
}
.pfa-root svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; display: block; }
.pfa-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.pfa-trigger {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 9990;
  width: 52px; height: 52px;
  padding: 0; margin: 0;
  display: grid; place-items: center;
  border: 2px solid var(--pfa-beige);
  border-radius: 50%;
  background: var(--pfa-deep);
  color: var(--pfa-beige);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(43, 26, 22, .35);
  transition: transform .15s ease, background-color .15s ease;
}
.pfa-trigger svg { width: 28px; height: 28px; }
.pfa-trigger:hover { background: var(--pfa-chesnut); transform: scale(1.05); }
.pfa-trigger:focus-visible,
.pfa-root button:focus-visible,
.pfa-title:focus-visible {
  outline: 3px solid var(--pfa-olive);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--pfa-deep);
}
.pfa-title:focus:not(:focus-visible) { outline: none; }
.pfa-dot {
  position: absolute; top: 1px; right: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pfa-olive); border: 2px solid var(--pfa-deep);
  display: none;
}
.pfa-active .pfa-dot { display: block; }

.pfa-panel {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
  z-index: 9991;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  display: flex; flex-direction: column;
  background: var(--pfa-beige);
  color: var(--pfa-deep);
  border: 2px solid var(--pfa-deep);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(43, 26, 22, .35);
  overflow: hidden;
  font-size: 16px;
  animation: pfa-in .18s ease-out;
}
.pfa-panel[hidden] { display: none; }
@keyframes pfa-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pfa-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 10px 20px;
  background: var(--pfa-deep);
  color: var(--pfa-beige);
}
.pfa-title {
  margin: 0; padding: 0;
  font-family: var(--pfa-head) !important;
  font-weight: 700; font-size: 26px; line-height: 1.1;
  text-transform: uppercase; letter-spacing: .02em;
  color: var(--pfa-beige) !important;
}
.pfa-close {
  width: 44px; height: 44px; padding: 0; margin: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--pfa-beige);
  cursor: pointer;
}
.pfa-close svg { width: 24px; height: 24px; }
.pfa-close:hover { background: var(--pfa-chesnut); }
.pfa-desc {
  margin: 0; padding: 0 20px 14px;
  background: var(--pfa-deep); color: var(--pfa-beige);
  font-size: 14px; line-height: 1.45;
}

.pfa-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }

.pfa-size {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 14px; margin-bottom: 12px;
  background: #fff; border: 1px solid rgba(43, 26, 22, .18); border-radius: 10px;
}
.pfa-size-label { font-weight: 600; font-size: 16px; }
.pfa-stepper { display: flex; align-items: center; gap: 6px; }
.pfa-step {
  width: 44px; height: 44px; padding: 0; margin: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--pfa-chesnut); color: #fff;
  cursor: pointer;
}
.pfa-step:hover { background: var(--pfa-deep); }
.pfa-step[aria-disabled="true"] { background: #b9aea6; color: #fff; cursor: not-allowed; }
.pfa-size-value { min-width: 3.4em; text-align: center; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

.pfa-grid {
  list-style: none !important; margin: 0 !important; padding: 0 !important;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.pfa-grid li { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.pfa-grid li::before, .pfa-grid li::marker { content: none !important; }
.pfa-tile {
  position: relative;
  width: 100%; height: 100%; min-height: 96px;
  margin: 0; padding: 14px 10px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: var(--pfa-deep);
  border: 2px solid rgba(43, 26, 22, .18); border-radius: 10px;
  font: 500 14px/1.25 var(--pfa-body);
  text-align: center; text-transform: none; letter-spacing: normal;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.pfa-tile:hover { border-color: var(--pfa-chesnut); }
.pfa-tile-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pfa-beige); color: var(--pfa-chesnut);
}
.pfa-tile-icon svg { width: 24px; height: 24px; }
.pfa-tile-state {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(43, 26, 22, .35); background: #fff;
}
.pfa-tile[aria-pressed="true"] { background: var(--pfa-olive); border-color: var(--pfa-deep); font-weight: 700; }
.pfa-tile[aria-pressed="true"] .pfa-tile-icon { background: var(--pfa-deep); color: var(--pfa-beige); }
.pfa-tile[aria-pressed="true"] .pfa-tile-state {
  border-color: var(--pfa-deep); background: var(--pfa-deep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ede8d0' d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6L20.1 8.4 18.7 7z'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}

.pfa-foot { padding: 0 16px 16px; }
.pfa-reset {
  width: 100%; min-height: 48px; margin: 0; padding: 10px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px;
  background: var(--pfa-chesnut); color: #fff;
  font: 600 15px/1 var(--pfa-body); text-transform: uppercase; letter-spacing: .06em;
  cursor: pointer;
}
.pfa-reset:hover { background: var(--pfa-deep); }
.pfa-hint { margin: 10px 0 0; font-size: 13px; line-height: 1.4; text-align: center; color: #4a3530; }
.pfa-hint kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  border: 1px solid rgba(43, 26, 22, .35); background: #fff;
  font: 600 12px/1.4 var(--pfa-body); color: var(--pfa-deep);
}

/* Phones: bottom sheet */
@media (max-width: 560px) {
  .pfa-trigger { width: 48px; height: 48px; }
  .pfa-trigger svg { width: 26px; height: 26px; }
  .pfa-panel {
    left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 100%;
    max-height: 88vh; max-height: 88dvh;
    border-radius: 16px 16px 0 0; border-width: 2px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .pfa-root.pfa-open .pfa-trigger { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .pfa-panel { animation: none; }
  .pfa-trigger, .pfa-tile { transition: none; }
}
@media print { .pfa-root { display: none !important; } }

/* =========================================================
   Page adjustments. Everything below leaves the panel alone.
   ========================================================= */

/* Bigger text: the site sizes text in rem, so scaling the root scales it all. */
html.pfa-text-1 { font-size: 115% !important; }
html.pfa-text-2 { font-size: 130% !important; }
html.pfa-text-3 { font-size: 150% !important; }
html[class*="pfa-text-"] body { overflow-wrap: break-word; }

/* High contrast: dark background, light text, yellow links. */
html.pfa-contrast body,
html.pfa-contrast body :where(:not(#pfa-root):not(#pfa-root *):not(svg *)) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.pfa-contrast body :is(a, a *):where(:not(#pfa-root *)) { color: var(--pfa-sun) !important; text-decoration: underline !important; }
html.pfa-contrast body :is(button, .btn, input, select, textarea):where(:not(#pfa-root *)) {
  border: 2px solid #fff !important;
}
html.pfa-contrast body :is(input, select, textarea):where(:not(#pfa-root *))::placeholder { color: #ccc !important; opacity: 1; }
html.pfa-contrast body :focus-visible:where(:not(#pfa-root *)) { outline: 3px solid var(--pfa-sun) !important; outline-offset: 2px !important; }
html.pfa-contrast body svg:where(:not(#pfa-root *)) :where([fill]:not([fill="none"])) { fill: currentColor; }
html.pfa-contrast .pfa-trigger { border-color: var(--pfa-sun); }

/* Highlight links */
html.pfa-links body a:where(:not(#pfa-root *)) {
  background-color: var(--pfa-sun) !important;
  color: var(--pfa-deep) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px solid var(--pfa-deep) !important;
  outline-offset: 1px;
}
html.pfa-links body a:where(:not(#pfa-root *)) * { color: var(--pfa-deep) !important; }
html.pfa-links body a:where(:not(#pfa-root *)):hover,
html.pfa-links body a:where(:not(#pfa-root *)):focus-visible { background-color: var(--pfa-olive) !important; }

/* Text spacing (WCAG 1.4.12 values) */
html.pfa-spacing body :where(:not(#pfa-root):not(#pfa-root *)) {
  line-height: 1.5 !important;
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
}
html.pfa-spacing body :is(p, li, dd, blockquote):where(:not(#pfa-root *)) { margin-bottom: 1em !important; }
html.pfa-spacing body p:where(:not(#pfa-root *)) { margin-bottom: 2em !important; }

/* Dyslexia-friendly font: plain, wide sans-serif letters, no all-caps, no italics. */
html.pfa-readable body :where(:not(#pfa-root):not(#pfa-root *)) {
  font-family: Verdana, Tahoma, 'Trebuchet MS', 'Segoe UI', sans-serif !important;
  font-style: normal !important;
  text-transform: none !important;
}
html.pfa-readable body :is(p, li, dd, td, label):where(:not(#pfa-root *)) {
  font-weight: 400 !important;
  letter-spacing: .04em;
  word-spacing: .1em;
}

/* Pause animations */
html.pfa-pause *,
html.pfa-pause *::before,
html.pfa-pause *::after {
  animation-play-state: paused !important;
  animation-delay: -1ms !important;
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html.pfa-pause { scroll-behavior: auto !important; }

/* Hide images. Keeps the layout, removes the pictures. */
html.pfa-noimg body :is(img, picture, video, iframe[src*="youtube"], iframe[src*="vimeo"], canvas):where(:not(#pfa-root *)) {
  visibility: hidden !important;
}
html.pfa-noimg body :where(:not(#pfa-root):not(#pfa-root *)) { background-image: none !important; }
html.pfa-noimg body :is(figure, .wp-block-image, .wp-block-cover, picture):where(:not(#pfa-root *)) { background-color: rgba(43, 26, 22, .08) !important; }
