/* The split view, map markers, and photo states extend the shared Bootstrap UI. */
.directory-page {
  --directory-header-height: 5rem;
  --directory-top: 14rem;
}

.directory-page>[data-community-header] {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.directory-page [data-community-header] .navbar {
  max-width: none;
  padding-inline: 1.5rem;
}

.directory-toolbar {
  position: sticky;
  top: var(--directory-header-height);
  z-index: 1020;
}

.directory-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.directory-image-fallback {
  background: #efebe4;
}

.directory-image-fallback[data-industry="Healthcare"] {
  background: #e1ece5;
}

.directory-image-fallback[data-industry="Home services"] {
  background: #e3eaf0;
}

.directory-image-fallback[data-industry="Retail & markets"] {
  background: #eee4e6;
}

.directory-image-fallback .identity-logo {
  width: 5.5rem;
  height: 5.5rem;
}

.directory-save {
  width: 2.5rem;
  height: 2.5rem;
  z-index: 2;
}

.directory-save i {
  margin-right: 0 !important;
}

.directory-card {
  scroll-margin-top: calc(var(--directory-top) + 1rem);
}

.directory-card.is-selected {
  outline: 2px solid var(--color-burgundy);
  outline-offset: 5px;
}

.directory-card-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.directory-map-shell {
  height: calc(100dvh - var(--directory-top) - 4rem);
  min-height: 24rem;
  background: #e7eee7;
  isolation: isolate;
}

.directory-map {
  height: 100%;
  width: 100%;
}

.directory-map-search {
  z-index: 500;
}

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

.directory-pin {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  background: white;
  color: #20251f;
  border: 1px solid #dadfd5;
  border-radius: 2rem;
  box-shadow: 0 2px 8px #0002;
  padding: .45rem .75rem;
  font: 600 .8rem var(--app-font-body);
}

.directory-pin.is-active {
  background: var(--color-burgundy);
  color: white;
  border-color: var(--color-burgundy);
}

.directory-popup-photo {
  width: 100%;
  height: 8rem;
  object-fit: cover;
}

.directory-popup {
  width: 13rem;
}

.directory-map-column .leaflet-container {
  font-family: var(--app-font-body);
}

.directory-map-column .leaflet-popup-content {
  margin: 12px;
}

.directory-map-column .leaflet-control-attribution {
  font-size: .65rem;
}

.directory-mobile-toggle {
  z-index: 1025;
}

.directory-sponsored {
  background: #f3f1e7;
}

.directory-filter-dialog {
  width: min(34rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
}

.directory-filter-dialog::backdrop {
  background: #12121280;
}

@media (min-width: 992px) {
  .directory-map-column {
    position: sticky;
    top: var(--directory-top);
  }
}

@media (max-width: 991.98px) {
  .directory-map-view .directory-results-column {
    display: none;
  }

  .directory-map-view .directory-map-column {
    display: block !important;
  }

  .directory-map-view .directory-map-shell {
    height: calc(100dvh - var(--directory-top) - 8rem);
    min-height: 12rem;
  }

  .directory-page #main {
    padding-bottom: 4rem;
  }

  .directory-map-view [data-community-footer] {
    display: none;
  }
}

/* SEPARATE DIRECTORIES — Page owns split layout, filters, list, map, and pagination.
   businessFrag/rentalFrag provide individual directory and map card designs. */
.directory-layout { padding-block: 1.5rem; }
.directory-listing-pane { width: 100%; }
.directory-search-panel { background: #f5f2ed; border: 1px solid #d9cfc1; }
.directory-search-panel .form-control, .directory-search-panel .form-select { border-color: #d5d0c8; }
.directory-result-photo { width: 9rem; height: 9rem; }
.directory-result-title { font-size: 1.3rem; line-height: 1.25; }
.directory-result-card { border-color: var(--bs-border-color); }
.directory-selected .directory-result-card { border-color: var(--color-burgundy); }
.directory-map-pane { width: 100%; }
.directory-preview-map { height: 34rem; min-height: 34rem; background: #f0efeb; }
.directory-map-scene { position: absolute; inset: 0; transform-origin: center; }
.directory-map-drawing { width: 100%; height: 100%; }
.directory-pin-position { position: absolute; transform: translate(-50%,-50%); }
.directory-preview-pin { border: 1px solid #ddd; border-radius: 2rem; background: white; color: #222; font-size: .8rem; font-weight: 600; padding: .45rem .7rem; box-shadow: 0 2px 6px #0002; }
.directory-preview-pin[aria-pressed="true"] { background: #222; color: white; border-color: #222; }
.directory-preview-pin:focus-visible { outline: 2px solid var(--color-burgundy); outline-offset: 3px; }
.directory-map-card-position { position: absolute; bottom: 1.25rem; inset-inline: 1.25rem; }
.directory-map-card-shell { box-shadow: 0 4px 20px #0001; }
.directory-popup-photo { width: 4.5rem; height: 4.5rem; }
.directory-popup-title { font-size: 1.1rem; line-height: 1.25; }
@media (min-width: 992px) {
 .directory-listing-pane { flex: 1 1 55%; width: 55%; }
 .directory-map-pane { flex: 1 1 45%; width: 45%; align-self: flex-start; position: sticky; top: 6rem; }
 .directory-preview-map { height: calc(100dvh - 8rem); min-height: 42rem; }
}
@media (max-width: 575.98px) {
 .directory-result-photo { width: 100%; height: 12rem; margin-bottom: 1rem; }
 .directory-map-card-position { inset-inline: .75rem; bottom: .75rem; }
}

/* LISTING BADGES — Wrappers control flow; badges define appearance only. */
.directory-category-badge { color: #2f4f73; background: #edf2f7; border: 1px solid #d8e2ed; }
.directory-type-badge { color: #2f4f73; background: #edf2f7; border: 1px solid #d8e2ed; }
.directory-status-open { color: #2f6b4f; background: #eaf4ed; border: 1px solid #c9dfd0; }
.directory-status-closed { color: #5c353c; background: #f5edef; border: 1px solid #e5d4d9; }
.directory-category-badge, .directory-type-badge, .directory-status-open, .directory-status-closed { padding: .45em .75em; border-radius: 2rem; font-weight: 500; white-space: normal; text-align: start; }

/* SUGGESTION BADGES — Reusable choice appearance; parent controls wrapping. */
.directory-suggestion[aria-pressed="true"], .directory-filter-toggle[aria-expanded="true"] { color: #fff; background: #2f4f73; border-color: #2f4f73; }
.directory-filter-toggle { border-style: dashed; }
