/* Directory listing page styles. Extracted from web/directory.php so brand
   colors land on tokens (--theme-color) instead of hardcoded hex literals.
   White-label overrides in home.php cascade here automatically. */

.nice-select:after {
  border-bottom: none;
  border-right: none;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.dir-hero {
  text-align: center;
  padding: 120px 16px 24px;
  background: #fff;
}
.dir-hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin: 0 0 16px;
}
.dir-hero p {
  font-size: 1.05rem;
  color: #666;
  margin: 0 0 28px;
}

/* ── Category tabs (mirrors membership-type-tabs) ──────────────────────── */
.dir-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.dir-category-tab {
  padding: 8px 22px;
  border-radius: 999px;
  border: 1.5px solid #d9dfeb;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  transition: 0.18s ease;
  background: #fff;
}
.dir-category-tab:hover,
.dir-category-tab.active {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: var(--theme-on-primary);
  text-decoration: none;
}

/* ── Search + filter bar ───────────────────────────────────────────────── */
.dir-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 16px 32px;
  background: #fff;
}
.dir-controls .nice-select {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  border: 1.5px solid #dde1e7 !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  color: #333 !important;
  height: 44px !important;
  line-height: 42px !important;
  padding: 0 40px 0 16px !important;
  float: none !important;
}
.dir-controls .nice-select .current {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  line-height: 42px !important;
}
.dir-controls .nice-select:hover,
.dir-controls .nice-select.open {
  border-color: var(--theme-color) !important;
}
.dir-controls .nice-select .list {
  width: 100% !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  margin-top: 2px !important;
}
.dir-controls .nice-select .option {
  font-size: 14px !important;
  line-height: 1.4 !important;
  min-height: 36px !important;
  padding: 8px 16px !important;
  white-space: normal !important;
  word-break: break-word !important;
}
.dir-controls .nice-select .option.selected,
.dir-controls .nice-select .option:hover {
  color: var(--theme-color) !important;
  background: #f0f3f8 !important;
  font-weight: 500 !important;
}

.dir-search-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
}
.dir-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  pointer-events: none;
}
.dir-search {
  width: 100%;
  padding: 11px 16px 11px 42px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.dir-search:focus {
  border-color: var(--theme-color);
}

.dir-category {
  padding: 11px 40px 11px 16px;
  border: 1.5px solid #dde1e7;
  border-radius: 8px;
  font-size: 15px;
  color: #333;
  outline: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.15s;
}
.dir-category.open {
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6l5-5 5 5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 14px center;
}
.dir-category:focus {
  border-color: var(--theme-color);
}

/* ── Card grid ─────────────────────────────────────────────────────────── */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Row gap matches the 3.5rem total spacing the Bootstrap-row listing
     pages give. CSS Grid's `gap` measures edge-to-edge while Bootstrap's
     gutter system uses col padding + row negative margin (and the listing
     pages also have card box-shadow that bleeds out). So pure 56px here
     reads as ~half the breathing room of an events page. Bumping to 88px
     evens the visual feel across all listing surfaces. */
  row-gap: 88px;
  column-gap: 24px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 12px 60px;
}

/* ── Card link wrapper ─────────────────────────────────────────────────── */
.dir-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  background: #fff;
  position: relative;
}
.dir-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  text-decoration: none;
  color: inherit;
}

/* ── Card image / initials ─────────────────────────────────────────────── */
.dir-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.dir-card-initials {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 16px;
  line-height: 1.3;
  word-break: break-word;
}

/* ── Card body ─────────────────────────────────────────────────────────── */
.dir-card-body {
  background: var(--theme-color);
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dir-card-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-align: center;
  margin: 0 0 2px;
}
.dir-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0 0 4px;
  line-height: 1.3;
}
.dir-card-address {
  font-size: 12px;
  color: #fff;
  text-align: center;
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}
.dir-card-phone {
  font-size: 13px;
  color: #fff;
  text-align: center;
  margin: 4px 0 0;
}

/* ── Featured badge ────────────────────────────────────────────────────── */
.dir-card-featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--theme-color);
  color: var(--theme-on-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  z-index: 2;
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.dir-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 15px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .dir-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .dir-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 40px 14px;
  }
  .dir-card-name {
    font-size: 13px;
  }
  .dir-card-address {
    font-size: 11px;
  }
  .dir-card-phone {
    font-size: 12px;
  }
}
