/**
 * Styles for the parts of the static build that have no WordPress equivalent:
 * the rebuilt schools map (replacing MapSVG) and small additions to the
 * client-side facet UI. Colours are taken from the Gesso design tokens
 * already used in styles.css.
 */

:root {
  --shpep-yellow: #ffd200;
  --shpep-green: #446459;
  --shpep-green-light: #849f96;
  --shpep-green-dark: #304840;
  --shpep-ink: #212121;
  --shpep-grey: #d6d7d9;
  --shpep-grey-mid: #aeb0b5;
}

/* ---------------------------------------------------------------- Schools map */

.schools-map {
  margin: 0 0 3rem;
}

.schools-map__svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}

.schools-map__state {
  fill: var(--shpep-grey);
  stroke: #fff;
  stroke-width: 1;
  transition: fill 0.15s ease-in-out;
}

/* States with at least one SHPEP program site. */
.schools-map__state.is-active {
  fill: var(--shpep-green-light);
}

.schools-map__marker {
  fill: var(--shpep-yellow);
  stroke: var(--shpep-green-dark);
  stroke-width: 2;
  transition: r 0.15s ease-in-out, fill 0.15s ease-in-out;
}

.schools-map__pin {
  cursor: pointer;
}

.schools-map__pin:hover .schools-map__marker,
.schools-map__pin:focus .schools-map__marker {
  fill: #fff;
  r: 9;
}

.schools-map__pin:focus-visible {
  outline: 3px solid var(--shpep-green-dark);
  outline-offset: 2px;
}

/* The same schools as text: keyboard and screen-reader accessible, and the
   only view that works if SVG fails to render. */
.schools-map__list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem 2rem;
}

.schools-map__item {
  border-top: 2px solid var(--shpep-yellow);
  padding-top: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.schools-map__item a {
  font-weight: 700;
  color: var(--shpep-green);
  text-decoration: none;
}

.schools-map__item a:hover,
.schools-map__item a:focus {
  text-decoration: underline;
}

.schools-map__meta {
  display: block;
  margin-top: 0.25rem;
  color: #5b616b;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .schools-map__list {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------- Facets */

/* An option that no longer matches anything under the other active filters. */
.facetwp-checkbox.disabled {
  opacity: 0.45;
}

.facetwp-checkbox.disabled label {
  cursor: default;
}

.facetwp-selections ul {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.facetwp-selection-value,
.facetwp-selection-clear {
  background: var(--shpep-grey);
  border-radius: 2px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}

.facetwp-selection-value::after {
  content: " ✕";
}

.facetwp-selection-value:hover,
.facetwp-selection-clear:hover,
.facetwp-selection-value:focus-visible,
.facetwp-selection-clear:focus-visible {
  background: var(--shpep-yellow);
}

.facetwp-results {
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--shpep-green);
}

.facetwp-type-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 2rem 0;
}

.facetwp-page {
  display: inline-block;
  min-width: 2.25rem;
  padding: 0.4rem 0.6rem;
  text-align: center;
  text-decoration: none;
  color: var(--shpep-ink);
  border: 1px solid var(--shpep-grey-mid);
  border-radius: 2px;
}

.facetwp-page:hover,
.facetwp-page:focus-visible {
  background: var(--shpep-yellow);
}

.facetwp-page.active {
  background: var(--shpep-green);
  border-color: var(--shpep-green);
  color: #fff;
  font-weight: 700;
}

.facet-empty {
  margin: 2rem 0;
}

/* --------------------------------------------------------------- Search page */

.site-search__form {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 2rem;
  max-width: 34rem;
}

.site-search__input {
  flex: 1 1 auto;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--shpep-grey-mid);
  border-radius: 2px;
  font-size: 1rem;
}

.site-search__results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-search__result {
  border-top: 1px solid var(--shpep-grey);
  padding: 1.1rem 0;
}

.site-search__result h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.site-search__result a {
  color: var(--shpep-green);
  text-decoration: none;
}

.site-search__result a:hover,
.site-search__result a:focus {
  text-decoration: underline;
}

.site-search__type {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b616b;
}

.site-search__excerpt {
  margin: 0.25rem 0 0;
  color: #5b616b;
  font-size: 0.92rem;
  line-height: 1.5;
}

.site-search__result mark {
  background: var(--shpep-yellow);
  color: inherit;
}
