/* Standalone directory styles: no changes to the shared legacy templates. */
.directory {
    --paper: #ffffff;
    --background: #ffffff;
    --ink: #203b50;
    --muted: #616b7b;
    --accent: #075b8f;
    --border: #dce1e9;
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font: 16px/1.5 "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.directory *, .directory *::before, .directory *::after { box-sizing: border-box; }
.directory a { color: inherit; }
.directory a:hover { color: var(--accent); }
.directory a:focus-visible, .directory button:focus-visible,
.directory input:focus-visible, .directory select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
.directory-container { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.directory-header { background: var(--paper); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 98px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 18px; text-decoration: none; font-size: 15px; font-weight: 600; }
.brand img { object-fit: contain; }
.brand span { border-left: 1px solid var(--border); padding-left: 18px; }
.magazine-link { font-size: 14px; text-underline-offset: 4px; }
.magazine-link span { margin-left: 6px; }
.directory-intro { padding: 46px 0 30px; max-width: 800px; }
.directory-intro h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.18; letter-spacing: -1.1px; margin: 0 0 14px; font-weight: 700; }
.directory-intro p { margin: 0; color: var(--muted); font-size: 17px; }
.search-panel { background: var(--paper); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 6px; padding: 24px 28px 18px; }
.search-panel h2 { font-size: 18px; margin: 0 0 20px; font-weight: 650; }
.directory-filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: 18px; align-items: end; }
.filter-field { min-width: 0; }
.filter-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.filter-field input, .filter-field select { width: 100%; height: 48px; border: 1px solid #b9c2d0; border-radius: 4px; background: var(--paper); color: var(--ink); padding: 0 12px; font: inherit; font-size: 14px; }
.filter-field input::placeholder { color: var(--muted); opacity: 1; }
.search-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 24px; background: var(--accent); border: 1px solid var(--accent); border-radius: 4px; color: #fff !important; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; }
.search-button:hover { background: #06466d; }
.filter-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); padding-top: 4px; }
.filter-footer a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }
.search-error { color: #8a2323; background: #fff0f0; padding: 12px; margin-bottom: 16px; }
.directory-results { padding: 36px 0 48px; scroll-margin-top: 20px; }
/* Pagination targets this region; keep focus outlines on its interactive controls. */
.directory-results:focus { outline: none; }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.results-heading h2 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.4px; }
.results-heading p { color: var(--muted); font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.results-order { color: var(--muted); font-size: 13px; white-space: nowrap; }
.provider-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.provider-card { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--paper); }
.provider-card-body { display: flex; flex-direction: column; flex: 1; padding: 24px; min-width: 0; }
.provider-logo { display: flex; align-items: center; justify-content: center; height: 210px; padding: 20px; border-bottom: 1px solid var(--border); }
.provider-logo img { width: 100%; height: 170px; object-fit: contain; }
.provider-card-body h3 { font-size: 18px; line-height: 1.4; margin: 0 0 22px; overflow-wrap: anywhere; }
.provider-card-body h3 a { text-decoration: none; }
.provider-contact { margin: 0 0 24px; }
.provider-contact > div + div { margin-top: 15px; }
.provider-contact dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.provider-contact dt .contact-icon { width: 32px; height: 32px; padding: 7px; flex-shrink: 0; border-radius: 10px; }
.provider-contact .contact-icon-phone { color: #177452; background: #d9f3e8; }
.provider-contact .contact-icon-mail { color: #1668ab; background: #e0efff; }
.provider-details .details-icon { flex-shrink: 0; color: #ffdb7a; }
.provider-contact dd { margin: 3px 0 0 40px; font-size: 14px; overflow-wrap: anywhere; }
.provider-contact a { text-decoration: underline; text-decoration-color: #bdc3cd; text-underline-offset: 4px; }
.unavailable { color: var(--muted); }
.provider-details { display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 12px 16px; border: 1px solid var(--accent); border-radius: 8px; margin-top: auto; background: var(--accent); font-size: 14px; color: #fff !important; font-weight: 600; text-decoration: none; text-align: center; }
.provider-details:hover { background: #06466d; border-color: #06466d; }
.directory-empty { grid-column: 1 / -1; text-align: center; border: 1px dashed #b9c2d0; border-radius: 6px; padding: 48px 24px; }
.directory-empty > svg { color: var(--accent); }
.directory-empty h3 { font-size: 23px; margin: 16px 0 8px; }
.directory-empty p { color: var(--muted); margin: 0 0 24px; }
.directory-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--muted); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: #fff; z-index: 10; }
.skip-link:focus { top: 12px; }
@media (max-width: 1050px) {
    .directory-filters { grid-template-columns: 1fr 1fr; }
    .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .directory-container { width: calc(100% - 32px); }
    .header-inner { min-height: 84px; gap: 12px; }
    .brand { gap: 10px; }
    .brand img { width: 48px; height: 48px; }
    .brand span { max-width: 115px; padding-left: 10px; font-size: 12px; }
    .magazine-link { max-width: 100px; font-size: 12px; }
    .directory-intro { padding: 30px 0 24px; }
    .directory-intro h1 { letter-spacing: -.6px; }
    .directory-intro p { font-size: 15px; }
    .search-panel { padding: 20px 18px; }
    .directory-filters { grid-template-columns: 1fr; gap: 16px; }
    .filter-field input, .filter-field select { font-size: 16px; }
    .filter-footer { flex-direction: column; gap: 12px; }
    .filter-footer a { align-self: flex-start; padding: 6px 0; }
    .results-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .results-heading h2 { font-size: 21px; }
    .provider-grid { grid-template-columns: 1fr; gap: 16px; }
    .provider-card-body { padding: 22px; }
}

/* Reference palette and header shared by the directory and provider profile. */
.header-inner { min-height: 142px; gap: 48px; }
.brand { flex: 0 0 170px; }
.brand img { width: 170px; height: 116px; object-fit: contain; }
.header-search { display: flex; flex: 0 1 650px; min-width: 0; border: 1px solid #588397; border-radius: 18px; background: #fff; }
.header-search input { min-width: 0; width: 100%; border: 0; border-radius: 18px 0 0 18px; padding: 16px 22px; font: inherit; color: var(--ink); background: transparent; }
.header-search input::placeholder { color: var(--muted); opacity: 1; }
.header-search button { flex-shrink: 0; min-height: 54px; padding: 14px 30px; border: 0; border-radius: 0 17px 17px 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.header-search button:hover { background: #06466d; }
.directory-nav { display: flex; justify-content: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px 12px 0 0; padding: 0 16px; }
.directory-nav a { padding: 16px 24px; color: var(--accent); text-decoration: none; font-weight: 700; border-radius: 24px; }
.directory-nav .nav-current { background: #fbeaf2; color: #a82360; }
.directory-nav a:hover { background: #edf7fb; }
.directory-intro { margin: 34px 0 28px; padding: 0 0 0 18px; border-left: 4px solid #5bb698; }
.directory-intro h1 { font-size: clamp(28px, 3.2vw, 36px); }
.search-panel { border-top-color: #5bb698; border-radius: 12px; background: #f3fbf8; }
.provider-card { border-radius: 14px; border-top: 4px solid #5bb698; background: #f2fbf7; box-shadow: 0 5px 18px rgba(32,59,80,.04); }
.provider-card:nth-child(4n+2) { border-top-color: #e8b158; background: #fffbf2; }
.provider-card:nth-child(4n+3) { border-top-color: #dc82ac; background: #fff6fa; }
.provider-card:nth-child(4n+4) { border-top-color: #6aa6d8; background: #f3f8ff; }
.provider-logo { background: #fff; border-radius: 10px 10px 0 0; }
.directory-footer { width: 100%; padding: 26px max(24px, calc((100% - 1176px) / 2)); background: #0591b3; color: #fff; border: 0; }
@media (max-width: 760px) {
    .header-inner { flex-direction: column; align-items: stretch; gap: 18px; padding: 18px 0 22px; }
    .brand { flex: none; align-self: center; }
    .brand img { width: 150px; height: 102px; }
    .header-search { flex: auto; width: 100%; }
    .header-search input { font-size: 16px; padding: 14px; }
    .header-search button { padding: 14px 20px; }
    .directory-nav { gap: 4px; padding: 0 6px; }
    .directory-nav a { padding: 14px 12px; font-size: 14px; }
    .directory-intro { margin: 26px 0; }
}

.directory-pagination { margin-top: 32px; text-align: center; }
.directory-pagination p { color: var(--muted); font-size: 14px; }
.directory-pagination ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.directory-pagination a, .directory-pagination li > span { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; background: #fff; font-size: 14px; }
.directory-pagination a:hover { background: #edf7fb; border-color: var(--accent); }
.directory-pagination .pagination-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.directory-pagination [aria-disabled="true"] { color: var(--muted); background: #f6f7fa; }
@media (max-width: 640px) {
    .directory-pagination .pagination-number { display: none; }
}
