/*
 * PRTPO accessibility remediation: Custom CSS layer.
 * Where it goes: Squarespace > Design > Custom CSS, replacing the current
 * contents (the Google Translate rules are retired with the widget).
 *
 * Keeps the Brine template and PRTPO's palette. Each rule names the WCAG 2.1
 * success criterion it serves. PRTPO green #85ab3f measures 2.38:1 on the
 * #f2f2f2 page, so text and buttons use the same hue deepened to #577029
 * (5.0:1 on the page; white on it 5.6:1). The bright green stays on the logo,
 * rules and graphics.
 */

:root {
  --prtpo-canvas: #f2f2f2;
  --prtpo-green: #85ab3f;
  --prtpo-green-ink: #577029;
  --prtpo-teal: #054f66;
  --prtpo-navy: #081b33;
  --prtpo-text: #3e3e3e;
  --accent-50: oklch(0.97 0.03 126.3);
  --accent-100: oklch(0.93 0.06 126.3);
  --accent-200: oklch(0.86 0.1 126.3);
  --accent-300: oklch(0.79 0.13 126.3);
  --accent-400: oklch(0.74 0.14 126.3);
  --accent-500: oklch(0.691 0.142 126.3);
  --accent-600: oklch(0.6 0.12 126.3);
  --accent-700: oklch(0.509 0.102 126.2);
  --accent-800: oklch(0.42 0.085 126.2);
  --accent-900: oklch(0.32 0.065 126.2);
}

/* 2.4.1 Bypass Blocks: the skip link the footer code injection adds. */
.prtpo-skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10001;
  padding: 12px 18px;
  background: #fff;
  color: var(--prtpo-navy);
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
}
.prtpo-skip-link:focus {
  top: 8px;
}
/* On a phone the skip link appears beside the Menu button; its ring sits
   inside its own white box so it cannot spill onto the button. */
html body .prtpo-skip-link:focus-visible {
  outline-offset: -5px !important;
  box-shadow: none !important;
}

/* 2.4.7 Focus Visible: no focus indicator survives the template today. A navy
   ring with a white halo reads on the page canvas and on dark surfaces. */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body summary:focus-visible,
html body [tabindex]:focus-visible,
html body label:focus-within {
  outline: 3px solid var(--prtpo-navy) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff !important;
}
html body main:focus,
html body #page:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* 1.4.3 Contrast (Minimum): headings, navigation state and buttons. */
h2:not(.index-item-title),
h3,
.quote-block .source {
  color: var(--prtpo-green-ink);
}
.primary-nav-wrapper nav a:hover,
.primary-nav-wrapper nav a:active,
.primary-nav-wrapper nav .active > a,
.secondary-nav-wrapper nav a:link,
.secondary-nav-wrapper nav a:visited,
.mobile-secondary-nav-links a {
  color: var(--prtpo-green-ink);
}
/* 1.4.1 Use of Color: the current page is underlined, not only colored. */
.primary-nav-wrapper nav .active > a,
.mobile-primary-nav-links .active > a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}
html body .sqs-block-button .sqs-block-button-element--small,
html body .sqs-block-button .sqs-block-button-element {
  background-color: var(--prtpo-green-ink);
  border-color: var(--prtpo-green-ink);
  color: #fff;
}
html body .sqs-block-button .sqs-block-button-element--small:hover,
html body .sqs-block-button .sqs-block-button-element:hover {
  background-color: var(--prtpo-navy);
  border-color: var(--prtpo-navy);
  color: #fff;
}

/* 1.4.1 Use of Color: links inside text are underlined, and hover keeps
   4.5:1 (the old hover green measured 2.38:1). */
.sqs-block-html a,
.sqs-block-markdown a,
.sqs-block-code a,
.sqs-html-content a,
.site-footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
p a:hover,
li a:hover,
.sqs-html-content a:hover {
  color: var(--prtpo-green-ink);
  text-decoration-thickness: 2px;
}

/* The page's visible title becomes its level-one heading (code injection);
   it keeps the page description's look. */
html body .page-description h1.prtpo-page-heading {
  margin: 0 !important;
  font: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
}

/* Shared visually hidden helper for labels and file details. */
.prtpo-visually-hidden {
  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;
}

/* File links say what they open: "(PDF, 1.2 MB, 35 pages)". The details are
   typed as plain text at the end of the link. */
.prtpo-file-meta {
  font-weight: 400;
  font-style: normal;
}

/* 1.4.10 Reflow and 1.4.12 Text Spacing: long headings break into even lines
   instead of leaving one word stranded. */
h1,
h2,
h3,
.page-description p {
  text-wrap: balance;
}

/* 1.4.10 Reflow: on phones the page title steps down a size, so a long title
   breaks into two or three lines instead of a column of single words. */
@media screen and (max-width: 640px) {
  html body .page-text-wrapper .page-description {
    font-size: 32px !important;
  }
}

/* 1.4.3 Contrast (Minimum): the contact form's "(required)" notes measured
   2.99:1 (#868d96 on the page). */
html body .sqs-block.sqs-block-form .form-wrapper .field-list .description {
  color: #58626e;
  opacity: 1;
}

/* Image card titles set their own font size from a much larger wrapper; the
   wrapper's fixed line height left two-line titles crowded. */
.image-title-wrapper,
.image-subtitle-wrapper,
.image-title,
.image-subtitle {
  line-height: 1.25;
}

/* 2.1.1 Keyboard: the mobile menu toggle. The code injection replaces the
   template's checkbox label with a real button; without scripts the checkbox
   itself stays reachable instead of display:none. */
.mobile-nav-toggle-box.hidden {
  display: block !important;
  position: absolute !important;
  opacity: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  right: 16px;
  top: 16px;
  z-index: 10;
}
/* 2.4.3 Focus Order and 1.3.2: the closed menu sits off screen; hidden, its
   links leave the Tab order and the accessibility tree. */
body:not(.mobile-menu-open) #mobileNavToggle:not(:checked) ~ .overlay-nav-container {
  visibility: hidden;
}
#mobileNavToggle:checked ~ .overlay-nav-container {
  overflow-y: scroll;
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  width: 100%;
  left: 0;
}
#mobileNavToggle:checked ~ .overlay-nav-container .overlay-nav-wrapper {
  opacity: 1;
}
.prtpo-menu-button {
  align-self: center;
  margin: 0 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 2px solid var(--prtpo-teal);
  border-radius: 4px;
  background: #fff;
  color: var(--prtpo-teal);
  font: 500 16px/1 futura-pt, Jost, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}
.prtpo-menu-button__glyph,
.prtpo-menu-button__glyph::before,
.prtpo-menu-button__glyph::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
}
.prtpo-menu-button__glyph {
  position: relative;
}
.prtpo-menu-button__glyph::before {
  position: absolute;
  top: -6px;
}
.prtpo-menu-button__glyph::after {
  position: absolute;
  top: 6px;
}
.prtpo-menu-button[aria-expanded="true"] .prtpo-menu-button__glyph {
  background: transparent;
}
.prtpo-menu-button[aria-expanded="true"] .prtpo-menu-button__glyph::before {
  top: 0;
  transform: rotate(45deg);
}
.prtpo-menu-button[aria-expanded="true"] .prtpo-menu-button__glyph::after {
  top: 0;
  transform: rotate(-45deg);
}

/* 1.4.10 Reflow: long links and file names wrap at 320px instead of forcing a
   sideways scroll. */
.sqs-html-content,
.sqs-block-content {
  overflow-wrap: anywhere;
}

/* The hairline: PRTPO's own 1px green rule, the line its pages already draw
   between sections, carried onto the content the remediation adds: above the
   map reading on the home page and between the links of the page-not-found
   page. */
.prtpo-hairline-rule {
  border-top: 1px solid var(--prtpo-green);
  padding-top: 12px;
}
.prtpo-hairline-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.prtpo-hairline-list li {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--prtpo-green);
}
.prtpo-hairline-list li:last-child {
  border-bottom: 1px solid var(--prtpo-green);
}
.prtpo-hairline-list a:hover {
  text-decoration-thickness: 2px;
}

/* "Read the map": the region map's text reading under the home page map. */
.prtpo-map-reading {
  margin: 12px 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--prtpo-text);
}
.prtpo-map-reading summary {
  cursor: pointer;
  min-height: 44px;
  display: list-item;
  padding: 10px 0;
  color: var(--prtpo-teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.prtpo-map-reading h2,
.prtpo-map-reading h3,
.prtpo-map-reading h4 {
  margin: 18px 0 6px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prtpo-map-reading ul {
  margin: 0 0 8px;
  padding-left: 1.25em;
}

/* Archived pages carry a plain notice and the way to ask for another format. */
.prtpo-archive-note {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-left: 4px solid var(--prtpo-green);
  background: #fff;
  color: var(--prtpo-text);
  font-size: 16px;
  line-height: 1.55;
}

/* Printing a meeting schedule or a list of documents prints the page's
   content: the header, menus and phone bar stay off the paper. The footer
   stays, so a printout keeps PRTPO's contact details. */
@media print {
  header,
  .mobile-bar-wrapper,
  .overlay-nav-container,
  .prtpo-skip-link {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
