/* Resident school and business directories. Scoped to avoid altering existing pages. */
.resident-directory {
  --rd-navy: #153b52;
  --rd-green: #386552;
  --rd-gold: #b78d50;
  --rd-paper: #f7f5ef;
  color: #263946;
}
.resident-directory * { box-sizing: border-box; }
.rd-breadcrumb { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 24px; font-size: .92rem; }
.rd-breadcrumb a { color: var(--rd-navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.rd-breadcrumb [aria-current] { color: #586873; }
.rd-introduction {
  background: white;
  border: 1px solid #dfe6e7;
  border-top: 4px solid var(--rd-gold);
  border-radius: 14px;
  padding: clamp(22px,4vw,42px);
  margin: 0 0 40px;
  box-shadow: 0 8px 28px rgba(21,59,82,.055);
}
.rd-introduction-with-image { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: clamp(20px,4vw,42px); align-items: center; }
.rd-introduction-copy { min-width: 0; }
.rd-introduction h2,.rd-section-heading h2,.rd-directory-note h2 { color: var(--rd-navy); font-size: clamp(1.35rem,2.4vw,1.85rem); margin: 10px 0 14px; line-height: 1.25; }
.rd-introduction p,.rd-directory-note p { line-height: 1.7; }
.rd-hero-image { min-width: 0; overflow: hidden; background: var(--rd-paper); border-radius: 10px; }
.rd-hero-image img { display: block; width: 100%; max-height: 320px; height: auto; object-fit: contain; margin: auto; }
.rd-primary-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 12px 17px; background: var(--rd-navy); color: white !important;
  border-radius: 6px; font-weight: 700; line-height: 1.45; text-decoration: none;
}
.rd-primary-link:hover { background: #224e67; }
.rd-section-heading { margin-bottom: 22px; }
.rd-section-heading p { color: #53636d; margin: 0; }
.rd-filters {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  border: 1px solid #dfe6e7; border-radius: 10px; background: white; padding: 18px;
}
.rd-filters > div { flex: 1 1 210px; min-width: 0; }
.rd-filters label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .9rem; color: var(--rd-navy); }
.rd-filters input,.rd-filters select { width: 100%; min-height: 44px; font: inherit; color: #263946; background: white; border: 1px solid #a7b7bd; border-radius: 6px; padding: 9px 12px; }
.rd-filters button { min-height: 44px; padding: 10px 19px; border: 0; border-radius: 6px; background: var(--rd-green); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.rd-reset { min-height: 44px; display: inline-flex; align-items: center; color: var(--rd-navy); text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }
.rd-results { color: #53636d; font-size: .9rem; margin: 14px 0 20px; }
.rd-group { margin: 0 0 35px; }
.rd-group > h3 { border-bottom: 2px solid #d8e0df; color: var(--rd-navy); margin: 0 0 17px; padding: 0 0 10px; font-size: 1.2rem; }
.rd-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; align-items: stretch; }
.rd-card { display: flex; flex-direction: column; min-width: 0; background: white; border: 1px solid #dfe6e7; border-radius: 11px; overflow: hidden; box-shadow: 0 5px 18px rgba(21,59,82,.045); }
.rd-card-photo { width: 100%; aspect-ratio: 16/10; background: var(--rd-paper); }
.rd-card-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rd-card-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 23px; min-width: 0; }
.rd-icon { display: grid; place-items: center; background: #eef3f0; color: var(--rd-green); border-radius: 10px; width: 49px; height: 49px; margin-bottom: 14px; }
.rd-icon svg { width: 29px; height: 29px; }
.rd-card h4 { margin: 0 0 11px; color: var(--rd-navy); font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.rd-description { line-height: 1.65; color: #43545d; margin: 0 0 14px; overflow-wrap: anywhere; }
.rd-description p { margin: 0 0 8px; }
.rd-contact { width: 100%; margin: 0 0 17px; padding: 12px 0 0; border-top: 1px solid #e6eaea; font-size: .92rem; }
.rd-contact > div { margin-bottom: 9px; }
.rd-contact dt { font-weight: 700; color: var(--rd-navy); margin-bottom: 2px; }
.rd-contact dd { margin: 0; color: #455762; overflow-wrap: anywhere; line-height: 1.5; }
.rd-listing-link { display: inline-flex; gap: 8px; align-items: center; color: var(--rd-green); font-weight: 750; margin-top: auto; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; }
.rd-empty,.rd-directory-note { background: var(--rd-paper); border: 1px solid #dedbd0; border-radius: 12px; padding: 26px; }
.rd-empty a { color: var(--rd-navy); text-decoration: underline; }
.rd-directory-note { margin-top: 36px; border-left: 4px solid var(--rd-gold); }
.rd-directory-note h2 { margin-top: 0; }
.resident-directory :is(a,button,input,select):focus-visible { outline: 3px solid #8f652b; outline-offset: 3px; }
#directory-heading { scroll-margin-top: 24px; }
@media(max-width: 950px) { .rd-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 650px) {
  .rd-grid,.rd-introduction-with-image { grid-template-columns: minmax(0,1fr); }
  .rd-filters { align-items: stretch; }
  .rd-filters > div { flex-basis: 100%; }
  .rd-filters button { flex: 1 1 100%; }
  .rd-card-body { padding: 20px; }
  .rd-introduction,.rd-directory-note { padding: 22px; }
}
