/**
 * WCAG 2.2 AA helpers that keep the existing visual design.
 * Loaded last so these rules win over page-specific sheets.
 */

/* 2.5.8 Target Size (Minimum): 24px hit area, same type size. */
.site-header #navigation > a,
.footer-group a,
.footer-group summary,
.footer-text,
.contact-line a,
nav.breadcrumbs > a,
.back-projects,
.directory-page nav.breadcrumbs > a,
.dz-flexi nav.breadcrumbs > a {
  min-height: 1.5rem;
  min-width: 1.5rem;
}

.site-header #navigation > a,
.footer-group a,
.footer-text,
.contact-line a,
nav.breadcrumbs > a,
.back-projects {
  display: inline-flex;
  align-items: center;
}

.footer-group summary {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
}

.footer-bottom > div {
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 640px) {
  .footer-bottom > div {
    align-items: normal;
  }
}

nav.breadcrumbs {
  gap: 0.5rem 0.75rem;
}

/* Map pins must themselves be 24px (pseudo hit-areas are ignored by auditors). */
.map-pin {
  min-width: 1.5rem;
  min-height: 1.5rem;
  width: 44px;
  height: 55px;
}

@media (max-width: 540px) {
  .map-pin {
    width: 36px;
    height: 45px;
  }
}

/* 1.4.3: muted grey on mint/gold heroes falls below 4.5:1. Use forest instead. */
.flex-hero nav.breadcrumbs > span,
.directory-intro nav.breadcrumbs > span,
.directory-page .flex-hero nav.breadcrumbs > span,
.dz-flexi nav.breadcrumbs > span,
.pathway-hero nav.breadcrumbs > span,
.detail-hero nav.breadcrumbs > span,
.flex-hero .flex-eyebrow,
.directory-intro .filter-row > p {
  color: var(--forest, #203129);
}

.animated-gradient,
.flex-hero,
.directory-intro,
.pathway-hero,
.detail-hero,
.community-hero,
.about {
  color: var(--forest, #203129);
}

/* Carousel is advanced with buttons, not drag. */
.track,
.dz-home .track,
.track.dragging,
.dz-home .track.dragging {
  cursor: auto;
}

/* Sitemap + search share Information Hub type. */
.sitemap-page .sitemap-search,
.search-results-page .sitemap-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  margin-top: 1.5rem;
  max-width: 36rem;
}

.sitemap-page .sitemap-search label,
.search-results-page .sitemap-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.sitemap-page .sitemap-search input,
.search-results-page .sitemap-search input {
  flex: 1;
  min-width: 12rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid #20312940;
  border-radius: 0.35rem;
  font: inherit;
}

.sitemap-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
  padding-block: 2rem 4rem;
}

.sitemap-groups h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.sitemap-groups ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sitemap-groups a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  color: var(--forest, #203129);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 2rem 0 4rem;
  display: grid;
  gap: 1.25rem;
}

.search-results-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0;
  border-bottom: 1px solid #20312918;
}

.search-results-list a:hover {
  color: var(--green, #1b853f);
}

.search-results-list p {
  margin: 0.35rem 0 0;
  color: #3d4a42;
}

@media (max-width: 800px) {
  .sitemap-groups {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding-block: 1.5rem 3rem;
  }
}

/* Map mega-menu: CTA under the intro paragraph. */
@media (min-width: 951px) {
  .mega-intro-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    min-height: 2.375rem;
    padding: 0.375rem 1rem;
    border: 0.125rem solid var(--dz-forest, var(--forest, #203129));
    border-radius: 0.25rem;
    background: var(--dz-forest, var(--forest, #203129));
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.3;
    text-decoration: none;
  }
  .mega-intro-cta:hover,
  .mega-intro-cta:focus-visible {
    background: #125332;
    border-color: #125332;
    color: #fff;
  }
  .mega-intro-cta[hidden] {
    display: none !important;
  }
}

/* Five mega-menu items: keep the last link in the right column. */
@media (min-width: 951px) {
  .mega-items--3-2 {
    grid-auto-flow: row;
    grid-template-rows: none;
  }
  .mega-items--3-2 > li:last-child {
    grid-column: 2;
  }
}

/* 1.4.3: category chips use white type unless the fill is too light. */
.category-filter,
.directory-category {
  color: var(--chip-fg, #fff);
}

/* Map pin hover: a small zoom from the pin point. */
.map-pin {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.map-pin:hover,
.map-pin:focus-visible {
  transform: translate(-50%, -100%) scale(calc(var(--pin-scale, 1) * 1.22));
  z-index: 4;
}
.map-pin[aria-pressed="true"] {
  transform: translate(-50%, -100%) scale(calc(var(--pin-scale, 1) * 1.12));
}
.map-pin[aria-pressed="true"]:hover,
.map-pin[aria-pressed="true"]:focus-visible {
  transform: translate(-50%, -100%) scale(calc(var(--pin-scale, 1) * 1.22));
}
@media (prefers-reduced-motion: reduce) {
  .map-pin {
    transition: none;
  }
  .map-pin:hover,
  .map-pin:focus-visible,
  .map-pin[aria-pressed="true"],
  .map-pin[aria-pressed="true"]:hover,
  .map-pin[aria-pressed="true"]:focus-visible {
    transform: translate(-50%, -100%) scale(var(--pin-scale, 1));
  }
}

.footer-bottom a.footer-credit {
  color: #8fdd9b;
  text-decoration: none;
  font-weight: 600;
}
.footer-bottom a.footer-credit:hover,
.footer-bottom a.footer-credit:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* One logo in the open mobile menu (dark + light variants must not stack). */
@media (max-width: 950px) {
  body.mobile-menu-open .logo .logo-dark {
    display: none !important;
    content: none !important;
  }
  body.mobile-menu-open .logo .logo-light {
    display: block !important;
    width: 11.875rem;
    height: 2.5rem;
  }
}
