/* Eturnal Rest -- directory page extras. Small additions only; layout, cards,
   chips, buttons, photo cards (.cem-card) and reveal motion come from base.css. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dir-hero {
  padding-bottom: var(--space-5);
}
.dir-hero__sub {
  max-width: 60ch;
}

/* ---- persistent search box ---- */
.dir-search {
  display: flex;
  gap: var(--space-3);
  max-width: 640px;
  margin-top: var(--space-5);
}
.dir-search__input {
  flex: 1 1 auto;
}
.dir-search__btn {
  flex: 0 0 auto;
}

/* ---- near-me tools row ---- */
.dir-hero__tools {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.dir-near {
  padding: 10px 18px;
}
.near-me__icon {
  flex: 0 0 auto;
  color: var(--blue-600);
}
.dir-near:hover .near-me__icon {
  color: var(--blue-700);
}
.dir-near.is-loading {
  opacity: 0.7;
  cursor: progress;
}
.dir-near.is-loading .near-me__icon {
  animation: near-pulse 1s var(--ease) infinite;
}
@keyframes near-pulse {
  50% {
    opacity: 0.35;
  }
}
.dir-near__status {
  font-size: 0.92rem;
}
.dir-near__status.is-err {
  color: var(--danger);
}

.dir-back {
  margin-top: var(--space-4);
  margin-bottom: 0;
  font-weight: 500;
}
.dir-section-head {
  margin-bottom: var(--space-2);
}

/* ---- top states (premium cards w/ count-up) ---- */
.top-states {
  margin-top: var(--space-5);
}
.state-card {
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.state-card:hover {
  text-decoration: none;
}
/* a soft brand wash sweeps in on hover */
.state-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    transparent 55%,
    rgba(70, 124, 153, 0.06)
  );
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
  pointer-events: none;
}
.state-card:hover::after {
  opacity: 1;
}
.state-card .card__body {
  position: relative;
  z-index: 1;
}
.state-card__code {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: var(--space-3);
}
.state-card .card__title {
  margin-bottom: 0.25em;
}
.state-card__count {
  color: var(--ink-2);
  font-size: 0.95rem;
}
.state-card__num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--blue-700);
}
.state-card__plots {
  margin-top: 0.5em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-700);
}
.state-card__plots--none {
  color: var(--ink-3);
  font-weight: 500;
}

/* ---- full state list (chips) ---- */
.state-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.state-chip__count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
}
.state-chip:hover .state-chip__count {
  color: var(--blue-600);
}

/* ---- results grid (real-photo cemetery cards) ---- */
.cem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 980px) {
  .cem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .cem-grid {
    grid-template-columns: 1fr;
  }
}

.result-count {
  margin-bottom: var(--space-5);
  min-height: 1.6em;
}
.result-count strong {
  color: var(--ink);
}
.results-empty {
  max-width: 52ch;
  margin: var(--space-6) auto;
  text-align: center;
}
.results-empty__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.results-status {
  text-align: center;
  color: var(--danger);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .dir-search {
    flex-direction: column;
  }
  .dir-search__btn {
    width: 100%;
    justify-content: center;
  }
  .dir-hero__tools {
    align-items: flex-start;
  }
}
