.gyms-directory {
  max-width: 1400px;
  padding-bottom: 88px;
}

.gyms-hero {
  margin-bottom: 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.hero-meta li {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.hero-meta strong {
  color: var(--text-main);
}

.directory-controls {
  margin-bottom: 20px;
}

.filters-card,
.directory-map-block,
.directory-results-block,
.empty-state,
.load-error,
.map-fallback {
  background: var(--bg-dark);
  border-radius: 16px;
}

.filters-card {
  padding: 28px;
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) repeat(2, minmax(180px, 0.7fr)) auto;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(24, 21, 16, 0.1);
  border-radius: 12px;
  background: #fffaf2;
  color: var(--text-main);
  font: inherit;
  outline: none;
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:focus,
.field select:focus {
  border-color: rgba(245, 196, 0, 0.4);
}

.directory-reset {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--text-main);
  color: var(--bg-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.directory-reset:hover {
  background: var(--primary);
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

.directory-map-block {
  position: sticky;
  top: 112px;
  padding: 24px;
}

.directory-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.directory-map-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.directory-map-tag,
.pill,
.location-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 21, 16, 0.05);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.directory-map-frame {
  overflow: hidden;
  border-radius: 16px;
}

#directory-map {
  min-height: min(72vh, 760px);
  background: #efe8da;
}

.directory-results-block {
  padding: 28px;
}

.directory-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.directory-results-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.results-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.location-card {
  padding: 32px;
}

.location-card.is-active {
  background: rgba(245, 196, 0, 0.08);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill--official {
  background: rgba(102, 204, 170, 0.12);
  color: #3b7563;
}

.status-pill--program {
  background: rgba(245, 196, 0, 0.12);
  color: #8d6d00;
}

.status-pill--hold {
  background: rgba(214, 88, 66, 0.12);
  color: #9d4538;
}

.location-summary {
  margin: 12px 0 18px;
  color: var(--text-muted);
}

.chip-row,
.highlight-row,
.station-row,
.card-actions,
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row {
  margin-bottom: 18px;
}

.highlight-row {
  margin-bottom: 18px;
}

.location-chip--coverage {
  background: rgba(245, 196, 0, 0.12);
  color: #8d6d00;
}

.location-chip--classification {
  color: var(--text-main);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  margin: 0 0 18px;
}

.meta-item dt {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-item dd {
  margin: 0;
  color: var(--text-main);
  line-height: 1.7;
}

.card-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(24, 21, 16, 0.04);
  color: var(--text-body);
  line-height: 1.75;
}

.card-actions {
  margin-top: 18px;
}

.location-details {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(24, 21, 16, 0.08);
}

.location-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.location-details summary::-webkit-details-marker {
  display: none;
}

.location-details summary::after {
  content: "+";
  font-size: 16px;
  line-height: 1;
}

.location-details[open] summary::after {
  content: "−";
}

.location-details-body {
  padding-top: 16px;
}

.directory-link,
.text-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(24, 21, 16, 0.1);
  border-radius: 999px;
  background: #fffaf2;
  color: var(--text-main);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.directory-link:hover,
.text-link-button:hover {
  opacity: 1;
  background: rgba(245, 196, 0, 0.12);
  border-color: rgba(245, 196, 0, 0.35);
}

.directory-link--primary {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg-dark);
}

.directory-link--primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-main);
}

.source-details {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(24, 21, 16, 0.08);
}

.source-details summary {
  cursor: pointer;
  color: var(--text-main);
  font-weight: 700;
}

.source-list {
  margin-top: 12px;
}

.source-list a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.status-card {
  min-height: 0;
}

.status-card h3 {
  margin-top: 14px;
}

.status-card p {
  margin-bottom: 16px;
}

.empty-state,
.load-error,
.map-fallback {
  padding: 22px;
  color: var(--text-body);
  line-height: 1.75;
}

.map-fallback.is-hidden,
.empty-state.is-hidden,
.load-error.is-hidden {
  display: none;
}

.leaflet-container {
  font: inherit;
}

.leaflet-control-attribution {
  background: rgba(247, 244, 236, 0.9) !important;
  color: var(--text-muted);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fffaf2;
  color: var(--text-main);
}

.leaflet-popup-content {
  margin: 14px 16px;
  line-height: 1.6;
}

.leaflet-popup-content a {
  color: var(--primary);
}

.directory-marker-wrapper {
  background: transparent;
  border: 0;
}

.directory-marker {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fffaf2;
}

.directory-marker.is-active {
  width: 20px;
  height: 20px;
  margin: -2px;
}

@media (max-width: 1120px) {
  .directory-layout {
    grid-template-columns: 1fr;
  }

  .directory-map-block {
    position: static;
  }
}

@media (max-width: 860px) {
  .filters-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .directory-reset {
    width: 100%;
  }

  #directory-map {
    min-height: 380px;
  }
}

@media (max-width: 768px) {
  .filters-card,
  .directory-map-block,
  .directory-results-block,
  .location-card {
    padding: 24px;
  }

  .directory-results-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-topline {
    flex-direction: column;
    align-items: flex-start;
  }
}
