/* ============================================================
   Directory archives, the filter panel's own additions (classes prefixed cdf-ff-).
   Loaded after the theme's pages.css, so it only refines what is there: nothing here
   changes which markup the panel has, and the map-view bar (.layout.map-mode) keeps its own rules.
   ============================================================ */

/* ---- the panel ---- */
.filters {
  border-radius: calc(var(--r) + 4px);
  box-shadow: 0 1px 2px var(--tc-filters-1418280a,rgba(20, 24, 40, .04)), 0 10px 30px -12px var(--tc-filters-1418281f,rgba(20, 24, 40, .12));
  scrollbar-width: thin;
}
.filters .fhead { gap: 10px; background: linear-gradient(180deg, var(--coral-soft), transparent 140%); }
.filters .fhead .cdf-filter-title { margin-right: auto; }
.filters .fhead .clear { padding: 6px 11px; border-radius: var(--pill); transition: background .15s; }
.filters .fhead .clear:hover { background: var(--coral-soft); }

/* how many choices are switched on */
.cdf-ff-badge {
  display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; margin-left: 2px;
  border-radius: var(--pill); background: var(--coral); color: var(--tc-filters-ffffff,#fff); font-size: 12px; font-weight: 700; line-height: 1;
}
.cdf-ff-close { display: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--sand); color: var(--ink); cursor: pointer; place-items: center; }
.cdf-ff-close:hover { background: var(--coral-soft); color: var(--coral-deep); }

/* ---- groups that fold ---- */
.fgroup > .cdf-filter-label[data-cdf-fold] {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; user-select: none; border-radius: 8px;
}
.fgroup > .cdf-filter-label[data-cdf-fold]::after {
  content: ""; width: 8px; height: 8px; flex-shrink: 0; margin-right: 3px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.fgroup > .cdf-filter-label[data-cdf-fold]:hover { color: var(--coral); }
.fgroup > .cdf-filter-label[data-cdf-fold]:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
.layout:not(.map-mode) .fgroup.cdf-ff-shut > .cdf-filter-label[data-cdf-fold] { margin-bottom: 0; }
.layout:not(.map-mode) .fgroup.cdf-ff-shut > .cdf-filter-label[data-cdf-fold]::after { transform: rotate(-45deg); }
.layout:not(.map-mode) .fgroup.cdf-ff-shut > .fbody { display: none; }
/* a folded group that has a choice in it says so */
.fgroup.cdf-ff-shut.cdf-ff-has > .cdf-filter-label[data-cdf-fold] > span::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--coral); vertical-align: middle;
}

/* ---- one-tap filters ---- */
.cdf-ff-quick .chips { gap: 8px; }
.cdf-ff-quick .chip-sel { display: inline-flex; align-items: center; gap: 6px; }
.chip-sel.on .cdf-ff-n { opacity: .9; }
.cdf-ff-n { font-weight: 700; }
.chip-sel { transition: background .15s, border-color .15s, color .15s, transform .1s; }
.chip-sel:active { transform: scale(.97); }

/* ---- long lists: the first few, then "Show more" ---- */
.cdf-ff-more { display: none !important; }
.cdf-ff-expanded .cdf-ff-more { display: flex !important; }
.cdf-ff-toggle {
  margin-top: 6px; padding: 6px 0; border: 0; background: none; color: var(--coral); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.cdf-ff-toggle:hover { color: var(--coral-deep); text-decoration: underline; }
.cdf-ff-find { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 12px; background: var(--sand); border: 1px solid var(--line); border-radius: 10px; }
.cdf-ff-find svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.cdf-ff-find input { width: 100%; border: 0; background: none; outline: none; box-shadow: none; font: inherit; font-size: 14px; }
.cdf-ff-find:focus-within { border-color: var(--coral); }
.cdf-ff-nomatch { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---- price: two thumbs on one track ---- */
.cdf-ff-range { position: relative; height: 26px; margin: 2px 4px 12px; }
.cdf-ff-track { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 4px; background: var(--line-strong);
  background: linear-gradient(to right, var(--line-strong) var(--lo, 0%), var(--coral) var(--lo, 0%), var(--coral) var(--hi, 100%), var(--line-strong) var(--hi, 100%)); }
.cdf-ff-range input[type=range] {
  position: absolute; left: 0; width: 100%; top: 0; height: 26px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none;
  pointer-events: none; appearance: none; -webkit-appearance: none; outline: none;
}
.cdf-ff-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.cdf-ff-range input[type=range]::-moz-range-track { background: transparent; height: 26px; }
.cdf-ff-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--tc-filters-ffffff,#fff); border: 2px solid var(--coral); box-shadow: 0 2px 6px var(--tc-filters-14182838,rgba(20, 24, 40, .22)); cursor: grab;
}
.cdf-ff-range input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--tc-filters-ffffff,#fff); border: 2px solid var(--coral); box-shadow: 0 2px 6px var(--tc-filters-14182838,rgba(20, 24, 40, .22)); cursor: grab;
}
.cdf-ff-range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--coral-deep); outline-offset: 2px; }
.cdf-ff-range input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; }

/* ---- the foot: the count follows the choices ---- */
.filters-foot .btn { transition: opacity .15s; }
.filters-foot .btn.cdf-ff-wait { opacity: .6; }
.filters-foot .btn.cdf-ff-fresh { animation: cdf-ff-pop .35s ease; }
@keyframes cdf-ff-pop { 0% { transform: scale(.97); } 60% { transform: scale(1.015); } 100% { transform: none; } }

/* ---- the chips above the results ---- */
.cdf-ff-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.cdf-ff-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 7px 10px 7px 14px; border-radius: var(--pill);
  background: var(--coral-soft); border: 1.5px solid var(--coral); color: var(--coral-deep); font-size: 13.5px; font-weight: 600; line-height: 1.2; transition: background .15s, color .15s;
}
.cdf-ff-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdf-ff-chip svg { flex-shrink: 0; opacity: .75; }
.cdf-ff-chip:hover { background: var(--coral); color: var(--tc-filters-ffffff,#fff); }
.cdf-ff-chip:hover svg { opacity: 1; }
.cdf-ff-clear { padding: 7px 6px; font-size: 13.5px; font-weight: 700; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cdf-ff-clear:hover { color: var(--coral); }

/* ---- phones: the panel is a drawer ---- */
@media (max-width: 980px) {
  .cdf-ff-close { display: inline-grid; }
  .filters { border-radius: 0; }
  .filters .fhead { padding: 14px 16px; }
  .fgroup { padding: 16px; }
  .check { padding: 10px 0; }
  .chip-sel { padding: 10px 15px; }
  .filters-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}

/* the bar of the map view keeps its pills: nothing of the above folds there */
.layout.map-mode .filters .fhead .cdf-ff-close { display: none; }
@media (min-width: 981px) {
  .layout.map-mode .filters .fgroup > .cdf-filter-label[data-cdf-fold]::after { margin: 0 0 0 1px; }
  .layout.map-mode .filters .fhead .cdf-filter-title { margin-right: 0; }
  .layout.map-mode .filters .fhead { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  .filters-foot .btn.cdf-ff-fresh { animation: none; }
}

/* ---- under the results: what the page is about, areas, questions (classes prefixed cdf-ab-) ---- */
.cdf-ab { display: grid; gap: clamp(20px, 3vw, 32px); max-width: 860px; margin: 0 auto; }
.cdf-ab h2 { margin: 0 0 12px; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; color: var(--ink); }
.cdf-ab-text p { margin: 0 0 12px; color: var(--ink); line-height: 1.7; }
.cdf-ab-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cdf-ab-chips a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--pill);
  background: var(--sand); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, color .15s;
}
.cdf-ab-chips a:hover { background: var(--coral-soft); color: var(--coral-deep); }
.cdf-ab-chips a span { color: var(--muted); font-weight: 500; font-size: 13px; }
.cdf-ab-faq details { border-bottom: 1px solid var(--line, rgba(20, 24, 40, .12)); padding: 2px 0; }
.cdf-ab-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; cursor: pointer;
  font-weight: 600; color: var(--ink); list-style: none;
}
.cdf-ab-faq summary::-webkit-details-marker { display: none; }
.cdf-ab-faq summary::after {
  content: ""; width: 8px; height: 8px; flex-shrink: 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s;
}
.cdf-ab-faq details[open] summary::after { transform: rotate(-135deg); }
.cdf-ab-faq summary:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.cdf-ab-faq p { margin: 0 0 14px; color: var(--muted); line-height: 1.7; }

/* The filter search wrapper owns the border, including its keyboard focus ring. */
.cdf-ff-find:focus-within{border-color:var(--coral-deep);box-shadow:0 0 0 3px var(--coral-soft)}
.cdf-ff-find input,.cdf-ff-find input:focus,.cdf-ff-find input:focus-visible{min-width:0;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;padding:0!important}

/* All listings page: the column count chosen in Admin (grid view only) */
.results[data-cols="2"]:not(.list){grid-template-columns:repeat(2,minmax(0,1fr))}
.results[data-cols="4"]:not(.list){grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1100px){.results[data-cols="4"]:not(.list){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.results[data-cols]:not(.list){grid-template-columns:minmax(0,1fr)}}
