/* Expedient Directory front end.
   Follows the theme: fonts, link colours and buttons come from BeTheme (buttons use its "button" and
   "button_theme" classes). The variables below only fill gaps, and fall back to neutral values when the
   theme does not define them. Override in one place, e.g. .exd { --exd-accent: #0b5c7a; } */
.exd {
	--exd-accent: var(--mfn-button-theme-bg, #00678c);
	--exd-ink: #1f2a37;
	--exd-muted: #5b6573;
	--exd-line: #e1e6ec;
	--exd-soft: #f6f8fa;
	--exd-radius: 8px;
	--exd-gap: 16px;
	color: var(--exd-ink);
}
.exd, .exd *, .exd *::before, .exd *::after { box-sizing: border-box; }

/* Lists used for layout: themes add bullets and indents to every list in page content
   (BeTheme: .column_column ul { list-style: disc; margin-left: 30px }). Two classes outrank that. */
.exd .exd-cards, .exd .exd-chips, .exd .exd-index__list, .exd .exd-suggest, .exd .exd-breadcrumbs ol, .exd .exd-pagination ul {
	list-style: none !important; margin-left: 0; padding-left: 0; color: inherit;
}
.exd .exd-cards > li, .exd .exd-chips > li, .exd .exd-index__list > li, .exd .exd-breadcrumbs li, .exd .exd-pagination li {
	list-style: none !important; margin-left: 0; padding-left: 0;
}
.exd :where(li, dd, dt) { color: inherit; }
.exd a { text-decoration: none; }
.exd .exd-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.exd :focus-visible { outline: 2px solid var(--exd-accent); outline-offset: 2px; }
.exd h2[tabindex="-1"]:focus { outline: none; }

/* Headings: the theme's h2 is sized for page heroes; inside listings it is scaled down. */
.exd :where(h2) { font-size: clamp(1.25rem, 1.05rem + .6vw, 1.55rem); line-height: 1.3; margin: var(--exd-section-gap, 32px) 0 12px; }
.exd :where(h3) { font-size: 1.1rem; line-height: 1.35; margin: 20px 0 6px; }

/* breadcrumbs */
.exd .exd-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; font-size: .9em; color: var(--exd-muted); }
.exd .exd-breadcrumbs li + li::before { content: "/"; margin-right: 4px; opacity: .6; }

/* page header */
.exd-page-header { margin: 0 0 20px; }
.exd-page-header h1, .exd-profile__name { margin: 0 0 6px; line-height: 1.15; }
.exd .exd-page-header h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem); }
.exd .exd-profile__name { font-size: clamp(1.75rem, 1.25rem + 1.6vw, 2.4rem); }
.exd-lead { font-size: 1.05em; color: var(--exd-muted); margin: 0 0 12px; }
.exd-rich { margin: 0 0 16px; }
.exd-rich > :last-child { margin-bottom: 0; }

/* ---------- filters ---------- */
.exd-filters { margin: 0 0 20px; }
.exd-filters__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.exd-field--search { flex: 1 1 320px; min-width: 0; }
.exd-field--sort { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.exd-field--sort label { margin: 0; font-size: .9em; color: var(--exd-muted); white-space: nowrap; }
.exd .exd-field label, .exd .exd-field legend { font-size: .85em; font-weight: 600; margin: 0 0 4px; padding: 0; display: block; }
.exd .exd-field--sort label { display: inline; margin: 0; font-weight: 400; }

.exd .exd-filters input[type="search"], .exd .exd-filters select {
	width: 100%; height: 42px; margin: 0; padding: 0 12px; font: inherit; font-size: .95rem; line-height: 40px; color: var(--exd-ink);
	background-color: #fff; border: 1px solid #cfd6de; border-radius: 6px; box-shadow: none;
}
.exd .exd-filters input[type="search"] {
	padding-left: 38px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%235b6573' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%235b6573' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 13px center;
}
.exd .exd-filters select {
	-webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer; text-overflow: ellipsis;
	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 1.5l5 5 5-5' fill='none' stroke='%235b6573' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.exd .exd-filters input[type="search"]:focus, .exd .exd-filters select:focus { border-color: var(--exd-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--exd-accent) 18%, transparent); }
.exd .exd-field--sort select { width: auto; min-width: 170px; }

/* The toggle is a plain outline control, not a theme button. Two classes outrank the theme's button rules. */
.exd .exd-filters__toggle {
	display: inline-flex; align-items: center; gap: 8px; height: 42px; margin: 0; padding: 0 14px; font: inherit; font-size: .95rem;
	color: var(--exd-ink); background: #fff; border: 1px solid #cfd6de; border-radius: 6px; box-shadow: none; cursor: pointer;
}
.exd .exd-filters__toggle:hover, .exd .exd-filters__toggle[aria-expanded="true"] { border-color: var(--exd-accent); color: var(--exd-ink); background: #fff; }
.exd .exd-filters__toggle::before { display: none; }
.exd-filters__count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
	border-radius: 10px; font-size: .75rem; font-weight: 600; color: #fff; background: var(--exd-accent); }

.exd-filters__panel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-top: 10px; padding: 14px 16px;
	background: var(--exd-soft); border: 1px solid var(--exd-line); border-radius: var(--exd-radius); }
.exd-filters__panel[hidden] { display: none; }
.exd-filters__panel .exd-field--specialty, .exd-filters__panel .exd-field--county { flex: 1 1 220px; max-width: 320px; }
.exd .exd-field--availability { border: 0; padding: 0; margin: 0; min-width: 0; flex: 2 1 320px; }
.exd-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; min-height: 42px; align-items: center; }
.exd .exd-field .exd-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .95rem; font-weight: 400; cursor: pointer; }
.exd .exd-field .exd-check input { width: 16px; height: 16px; margin: 0; padding: 0; position: static; accent-color: var(--exd-accent); }
.exd-filters__apply { flex: 0 0 auto; }
.exd-filters--js .exd-filters__apply { display: none; }

/* search suggestions */
.exd-combobox { position: relative; }
.exd .exd-suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0;
	background: #fff; border: 1px solid #cfd6de; border-radius: 6px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); max-height: 320px; overflow: auto; }
.exd-suggest__item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.exd-suggest__item[aria-selected="true"], .exd-suggest__item:hover { background: var(--exd-soft); }
.exd-suggest__type { font-size: .8em; color: var(--exd-muted); }

/* ---------- buttons ----------
   Colours, font and radius come from the theme's "button" / "button_theme" classes. These rules only
   size them for cards and supply a fallback when the theme has no button styles (zero specificity). */
.exd .exd-actions .button, .exd .exd-filters .button { margin: 0; }
:where(.exd-btn) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 1px solid var(--exd-accent);
	border-radius: 6px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; }
:where(.exd-btn--primary) { background: var(--exd-accent); color: #fff; }
:where(.exd-btn--secondary) { background: #fff; color: var(--exd-accent); }
.exd-filemeta { font-weight: 400; opacity: .75; font-size: .85em; }
.exd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ---------- results ---------- */
.exd-results[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.exd-results__head { display: flex; align-items: baseline; gap: 16px; margin: 0 0 12px; }
.exd .exd-results__count { font-size: 1rem; font-weight: 600; margin: 0; color: var(--exd-muted); }
.exd-clear { font-size: .9em; }
.exd .exd-group-heading { font-size: 1.05rem; font-weight: 600; margin: 24px 0 10px; }
.exd .exd-group-heading:first-of-type { margin-top: 0; }

/* cards */
.exd .exd-cards { display: grid; gap: var(--exd-card-gap, 12px); margin: 0 0 20px; }
.exd .exd-cards > li { margin: 0; padding: 0; }
.exd-card__inner { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; padding: var(--exd-card-pad, 16px); margin: 0;
	background: #fff; border: 1px solid var(--exd-line); border-radius: var(--exd-radius); transition: border-color .15s, box-shadow .15s; }
.exd-card__inner:hover { border-color: #cfd6de; box-shadow: 0 4px 16px rgba(15, 23, 42, .06); }
.exd-card--paused .exd-card__inner { background: var(--exd-soft); }
.exd-card__media { display: block; line-height: 0; }
.exd .exd-card__photo { width: 120px; height: 120px; max-width: none; object-fit: cover; object-position: top center; border-radius: 6px; display: block; }
.exd .exd-card__name { margin: 0 0 2px; font-size: 1.3rem; font-weight: 600; line-height: 1.3; }
.exd .exd-card__name a { color: var(--exd-ink); }
.exd .exd-card__name a:hover { color: var(--exd-accent); }
.exd-card__specialties { margin: 0 0 4px; font-size: .95em; }
.exd-area { margin: 0 0 8px; font-size: .9em; color: var(--exd-muted); }
.exd-area__label { font-weight: 600; color: var(--exd-ink); }
.exd-sep { opacity: .6; }
.exd-card__summary { margin: 0; line-height: 1.55; }
.exd-status { display: inline-block; margin: 0 0 8px; font-size: .85em; color: var(--exd-muted); }

/* compact cards ("Other experts") */
.exd .exd-cards--compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.exd-card--compact .exd-card__inner { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: center; }
.exd .exd-card--compact .exd-card__photo { width: 64px; height: 64px; }
.exd .exd-card--compact .exd-card__name { font-size: 1.05rem; }
.exd-card--compact .exd-card__specialties { margin: 0; font-size: .9em; }

/* pagination: neutral squares; the current page takes the theme colour */
.exd .exd-pagination ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 24px; }
.exd .exd-pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px;
	border: 1px solid var(--exd-line); border-radius: 6px; color: var(--exd-ink); background: #fff; font-size: .95em; }
.exd .exd-pagination a:hover { border-color: var(--exd-accent); }
.exd .exd-pagination a[aria-current="page"] { background: var(--exd-accent); border-color: var(--exd-accent); color: #fff; font-weight: 600; }
.exd-pagination__gap { align-self: center; padding: 0 2px; color: var(--exd-muted); }

/* ---------- profile ---------- */
.exd-profile__header { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 28px; margin-bottom: 28px; align-items: start; }
.exd-profile__photo img { width: 100%; height: auto; border-radius: var(--exd-radius); display: block; }
.exd-profile__credentials { color: var(--exd-muted); margin: 0 0 6px; font-size: .95em; }
.exd-profile__summary { font-size: 1.05em; margin: 10px 0 0; }
.exd-profile__section { margin: 0 0 24px; }
.exd-profile__section .exd-area { font-size: 1em; color: var(--exd-ink); }
.exd-profile__reviewed { color: var(--exd-muted); font-size: .9em; }
.exd-related { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--exd-line); }

/* ---------- FAQs, chips, back links ---------- */
.exd-faqs { margin: var(--exd-section-gap, 32px) 0 24px; }
.exd .exd-faq h3 { margin: 16px 0 4px; font-size: 1.05rem; font-weight: 600; }
.exd-faq p { margin: 0 0 8px; }
.exd .exd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.exd .exd-chips a { display: inline-flex; align-items: center; padding: 5px 12px; font-size: .9em; color: var(--exd-ink);
	background: #fff; border: 1px solid var(--exd-line); border-radius: 999px; transition: border-color .15s, color .15s; }
.exd .exd-chips a:hover { border-color: var(--exd-accent); color: var(--exd-accent); }
.exd-back { margin: 20px 0; font-size: .95em; }
.exd-footer-content { margin: var(--exd-section-gap, 32px) 0 0; }
.exd-footer-content > :first-child { margin-top: 0; }
.exd-rich ol { margin: 0 0 12px 1.2em; padding: 0; }
.exd-rich li { margin: 0 0 6px; }
.exd-note { font-size: .85em; color: var(--exd-muted); line-height: 1.5; }

/* ---------- index pages ([exd_specialty_index], [exd_location_index]) ---------- */
.exd-index__group { margin: 0 0 24px; }
.exd .exd-index__title { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--exd-muted);
	margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px solid var(--exd-line); }
.exd .exd-index__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 24px; margin: 0; }
.exd .exd-index__list > li { margin: 0; padding: 4px 0; line-height: 1.4; }
.exd-count { margin-left: 4px; font-size: .8em; color: var(--exd-muted); }

@media (max-width: 640px) {
	.exd-filters__bar { gap: 8px; }
	.exd-field--search { flex-basis: 100%; }
	.exd-field--sort { flex: 1 1 auto; }
	.exd .exd-field--sort select { width: 100%; min-width: 0; }
	.exd-filters__panel .exd-field--specialty, .exd-filters__panel .exd-field--county { max-width: none; flex-basis: 100%; }
	.exd .exd-card__name { font-size: 1.15rem; }
	.exd-profile__header { grid-template-columns: 1fr; gap: 16px; }
	.exd-profile__photo { max-width: 220px; }
}
@media (prefers-reduced-motion: reduce) { .exd * { transition: none !important; } }
@media (forced-colors: active) { .exd-btn, .exd .exd-pagination a, .exd .exd-filters__toggle { border: 1px solid CanvasText; } }
@media print { .exd-filters, .exd-pagination, .exd-actions { display: none; } }
