/* Percentages preserve browser font preferences and zoom. No inline styles are
   needed on account pages with a restrictive Content Security Policy. */
html[data-ppp-text-size="0.8"] { font-size: 80%; }
html[data-ppp-text-size="0.9"] { font-size: 90%; }
html[data-ppp-text-size="1"] { font-size: 100%; }
html[data-ppp-text-size="1.1"] { font-size: 110%; }
html[data-ppp-text-size="1.25"] { font-size: 125%; }
html[data-ppp-text-size="1.5"] { font-size: 150%; }
html[data-ppp-text-size="1.75"] { font-size: 175%; }
html[data-ppp-text-size="2"] { font-size: 200%; }

.ppp-accessibility {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1100;
  font: 1rem/1.5 "DM Sans", "Segoe UI", sans-serif;
  text-align: left;
  color: #102a35;
}

.ppp-accessibility *,
.ppp-accessibility *::before,
.ppp-accessibility *::after { box-sizing: border-box; }

.ppp-accessibility [hidden] { display: none; }

.ppp-a11y-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #075a60;
  color: #fff;
  box-shadow: 0 3px 14px rgba(8, 47, 60, .25);
  cursor: pointer;
}

.ppp-a11y-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ppp-a11y-panel {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px);
  width: auto;
  max-width: 22rem;
  margin-left: auto;
  max-height: calc(100vh - 96px - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid #b8cecc;
  border-radius: 16px;
  background: #fffefb;
  box-shadow: 0 8px 32px rgba(8, 47, 60, .2);
}

.ppp-a11y-panel h2 {
  margin: 0 0 .5rem;
  font: 700 1.2rem/1.25 "DM Sans", "Segoe UI", sans-serif;
  color: #102a35;
}

.ppp-a11y-panel p { margin: 0 0 .75rem; overflow-wrap: anywhere; }

.ppp-a11y-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ppp-a11y-button {
  flex: 1 1 6rem;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #075a60;
  border-radius: 8px;
  background: #fff;
  color: #075a60;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
}

.ppp-a11y-button:hover:not(:disabled) { background: #e9f8f4; }
.ppp-a11y-button:disabled { opacity: .55; cursor: default; }
.ppp-a11y-save-note { margin-top: .75rem !important; }

.ppp-accessibility button:focus-visible {
  outline: 3px solid #b36b00;
  outline-offset: 3px;
}

/* Let enlarged brand text wrap rather than pushing the menu off screen. The
   attribute also keeps this effective when shared header CSS loads later. */
@media (max-width: 620px) {
  html[data-ppp-text-size] .site-header .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  html[data-ppp-text-size] .site-header .brand span {
    min-width: 0;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[data-ppp-text-size] .site-header .brand img,
  html[data-ppp-text-size] .site-header .menu-button {
    flex-shrink: 0;
  }
}

/* Enlarged words and link labels must not become a grid track's minimum size. */
@media (max-width: 760px) {
  /* Inherited wrapping also reduces grid min-content widths for enlarged
     headings, cards, and footer links without clipping their text. */
  html[data-ppp-text-size] body {
    overflow-wrap: anywhere;
  }

  html[data-ppp-text-size] .audience-heading,
  html[data-ppp-text-size] .resource-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-ppp-text-size] .audience-heading > *,
  html[data-ppp-text-size] .resource-preview-grid > * {
    min-width: 0;
  }

  html[data-ppp-text-size] .audience-heading h2,
  html[data-ppp-text-size] .resource-preview h2 {
    overflow-wrap: anywhere;
  }

  html[data-ppp-text-size] .resource-preview .button {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
}

@media print {
  .ppp-accessibility { display: none !important; }
}

