/* Find-a-lawyer search page */

.search-bar { background: #fff; border-bottom: 1px solid var(--rule); padding: 28px 0 24px; }
.search-bar__title { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; margin: 0 0 18px; color: var(--ink); }

.search-mode { display: flex; gap: 24px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.search-mode__tab {
    padding: 0 0 10px; margin-bottom: -1px;
    font: 600 15px var(--sans); color: var(--slate); text-decoration: none;
    border-bottom: 3px solid transparent;
}
.search-mode__tab:hover { color: var(--ink); }
.search-mode__tab.is-active { color: var(--ink); border-bottom-color: var(--binding); }

.search-bar__fields {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 14px; align-items: end;
}
.search-bar__submit { height: 46px; padding: 0 28px; }
.search-bar__type { margin-top: 16px; border: 0; }

/* ---------- Layout ---------- */
.search-layout {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px;
    padding-top: 32px; padding-bottom: 80px; align-items: start;
}

/* ---------- Filters ---------- */
.filters { position: sticky; top: 92px; align-self: start; }
.filters__panel { background: #fff; border: 1px solid var(--rule); border-radius: 20px; box-shadow: 0 18px 40px -32px rgba(24, 58, 51, .45); overflow: hidden; }
.filters__summary { display: flex; align-items: center; gap: 10px; padding: 16px 18px; list-style: none; cursor: default; border-bottom: 1px solid #EEF1EF; background: linear-gradient(180deg, #FAFCFB, #fff); }
.filters__summary::-webkit-details-marker { display: none; }
.filters__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #183A33; color: #E9D7A8; font-size: 17px; flex-shrink: 0; }
.filters__summary h2 { font: 700 16px var(--sans); margin: 0; color: var(--ink); }
.filters__count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--action); color: #fff; font: 700 12px var(--sans); }
.filters__body { display: flex; flex-direction: column; gap: 20px; padding: 18px; }
.fx { border: 0; margin: 0; padding: 0; min-width: 0; }
.fx__label { display: block; padding: 0; margin: 0 0 10px; font: 700 13.5px var(--sans); color: var(--ink); }

/* Sort: 2×2 segmented choice */
.fx-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: #F2F5F3; }
.fx-seg label, .fx-stars label { position: relative; cursor: pointer; }
.fx-seg input, .fx-stars input { position: absolute; opacity: 0; pointer-events: none; }
.fx-seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 8px; border-radius: 10px; font: 600 13px var(--sans); color: #4D5753; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.fx-seg span i { font-size: 15px; }
.fx-seg label:hover span { color: var(--ink); }
.fx-seg input:checked + span { background: #fff; color: #183A33; box-shadow: 0 2px 8px -3px rgba(24, 58, 51, .35); }
.fx-seg input:checked + span i { color: var(--action); }
.fx-seg input:focus-visible + span, .fx-stars input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 1px; }

/* Rating chips */
.fx-stars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.fx-stars span { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; padding: 0 4px; border: 1.5px solid var(--rule); border-radius: 999px; font: 600 13px var(--sans); color: #4D5753; transition: border-color .15s, background .15s; }
.fx-stars span i { color: #F2A93B; font-size: 12px; }
@media (max-width: 900px) { .fx-stars { grid-template-columns: repeat(5, minmax(0, 72px)); } .fx-seg { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .fx-seg { grid-template-columns: 1fr 1fr; } .fx-stars { grid-template-columns: repeat(5, 1fr); } }
.fx-stars label:hover span { border-color: #B9C8C0; }
.fx-stars input:checked + span { border-color: #183A33; background: #183A33; color: #fff; }
.fx-stars input:checked + span i { color: #E9D7A8; }

/* Toggle rows */
.fx-toggles { display: grid; gap: 6px; }
.fx-toggle { position: relative; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 1px solid #EEF1EF; border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.fx-toggle:hover { border-color: #D3DDD8; background: #FAFCFB; }
.fx-toggle__ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #F2F5F3; color: #5B6661; font-size: 16px; transition: background .15s, color .15s; }
.fx-toggle__text { font: 600 13.5px/1.3 var(--sans); color: var(--ink); }
.fx-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.fx-switch { width: 36px; height: 20px; border-radius: 999px; background: #CBD5D0; position: relative; transition: background .15s; }
.fx-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.fx-toggle:has(input:checked) { border-color: #BFD9CC; background: #F1F8F4; }
.fx-toggle:has(input:checked) .fx-toggle__ico { background: var(--action); color: #fff; }
.fx-toggle input:checked ~ .fx-switch { background: var(--action); }
.fx-toggle input:checked ~ .fx-switch::after { transform: translateX(16px); }
.fx-toggle:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 2px; }

/* Language */
.fx-lang { position: relative; }
.fx-lang > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8A9590; font-size: 17px; pointer-events: none; }
.fx-lang input { width: 100%; height: 42px; padding: 0 36px 0 38px; border: 1.5px solid var(--rule); border-radius: 12px; font: 500 14px var(--sans); background: #fff; color: var(--ink); box-sizing: border-box; }
.fx-lang input:focus { outline: 0; border-color: var(--action); box-shadow: 0 0 0 3px rgba(30, 107, 82, .14); }
.fx-lang__x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #6B7570; text-decoration: none; }
.fx-lang__x:hover { background: #F2F5F3; color: var(--ink); }
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fx-chips button { height: 28px; padding: 0 10px; border: 1px dashed #C4D0CA; border-radius: 999px; background: #fff; font: 600 12.5px var(--sans); color: #4D5753; cursor: pointer; }
.fx-chips button:hover { border-style: solid; border-color: var(--action); color: var(--action); }
.fx-chips button.is-on { border-style: solid; border-color: var(--action); background: #EEF7F2; color: #14533F; }

.filters__actions { display: flex; flex-direction: column; gap: 10px; align-items: center; padding-top: 4px; border-top: 1px solid #EEF1EF; padding-top: 16px; }
.filters__actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.filters__clear { display: inline-flex; align-items: center; gap: 6px; font: 600 13.5px var(--sans); color: #A3402A; text-decoration: none; }
.filters__clear:hover { text-decoration: underline; }

/* Desktop: the panel stays open (see script in find-lawyers view). */
@media (min-width: 901px) {
    .filters__summary { pointer-events: none; }
}

/* ---------- Results ---------- */
.results__title { font: 600 22px/1.3 var(--heading); margin: 0 0 18px; color: var(--ink); }
.results__hint { color: var(--slate); margin: -8px 0 28px; max-width: 60ch; }
.results__subhead { font: 700 16px var(--sans); margin: 0 0 12px; }
.results__list { display: flex; flex-direction: column; gap: 14px; }
.results__tips { padding-left: 1.2em; color: var(--ink); line-height: 1.8; }

.state-index {
    list-style: none; margin: 0; padding: 0;
    columns: 3; column-gap: 28px;
}
.state-index li { padding: 6px 0; break-inside: avoid; }
.state-index a { color: var(--ink); text-decoration: none; }
.state-index a:hover { color: var(--action); text-decoration: underline; }

/* ---------- Lawyer card ---------- */
.lawyer-card {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) 200px; gap: 20px;
    padding: 22px; background: #fff; border: 1px solid var(--rule); border-radius: 12px;
}
.lawyer-card:hover { border-color: #B9C4BF; }
.lawyer-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lawyer-card__name { font: 600 21px/1.25 var(--heading); margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lawyer-card__name a { color: var(--ink); text-decoration: none; }
.lawyer-card__name a:hover { color: var(--action); text-decoration: underline; text-underline-offset: 4px; }
.lawyer-card__meta { margin: 0; color: var(--slate); font-size: 15px; }
.lawyer-card__areas { margin: 2px 0 0; font-size: 15px; font-weight: 500; color: var(--binding); }
.lawyer-card__summary { margin: 4px 0 0; color: var(--ink); font-size: 15px; line-height: 1.55; }
.lawyer-card__facts { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; color: var(--slate); }
.lawyer-card__facts li::before { content: "✓"; color: var(--action); margin-right: 6px; font-weight: 700; }
.lawyer-card__actions { display: flex; flex-direction: column; gap: 8px; }
.lawyer-card__actions .btn { width: 100%; font-size: 14px; }

/* ---------- Sponsored listings ---------- */
.results__list--sponsored { margin-bottom: 14px; padding-bottom: 18px; border-bottom: 1px dashed var(--rule); }
.lawyer-card--sponsored { position: relative; border-color: #E2CF9F; background: linear-gradient(180deg, #FFFCF3 0, #fff 120px); }
.lawyer-card--sponsored:hover { border-color: #C9A85A; }
.lawyer-card__ad {
    position: absolute; top: -10px; left: 20px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px; background: #F6EBCB; color: #6B5317;
    font-size: 12px; font-weight: 600; line-height: 18px; border: 1px solid #E2CF9F; cursor: help;
}
.lawyer-card__ad i { font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .lawyer-card { grid-template-columns: 64px minmax(0, 1fr); }
    .lawyer-card__actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
    .lawyer-card__actions .btn { width: auto; }
}
@media (max-width: 900px) {
    .search-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
    .filters { position: static; }
    .filters__summary { cursor: pointer; }
    .filters__summary::after { content: "Show"; margin-left: auto; font-size: 14px; color: var(--action); font-weight: 600; }
    .filters__panel[open] .filters__summary::after { content: "Hide"; }
    .search-bar__fields { grid-template-columns: 1fr; }
    .search-bar__submit { width: 100%; }
    .state-index { columns: 2; }
}
@media (max-width: 560px) {
    .lawyer-card { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 18px; }
    .lawyer-card__photo { --avatar-size: 52px; width: 52px; height: 52px; }
    .lawyer-card__actions { grid-column: 1 / -1; flex-direction: column; }
    .lawyer-card__actions .btn { width: 100%; }
}

/* Paid featured spot (state searches) */
.results__list--featured { margin-bottom: 18px; }
.lawyer-card--featured { position: relative; border: 1.5px solid #D8B867; background: linear-gradient(180deg, #FFF9EA 0, #fff 140px); box-shadow: 0 18px 36px -28px rgba(122, 84, 20, .55); }
.lawyer-card--featured:hover { border-color: #B8922F; }
.lawyer-card__feat { background: linear-gradient(120deg, #EEDDB0, #E2C98B); color: #3B2A08; border-color: #D8B867; font-weight: 700; }
.lawyer-card__feat i { color: #8A6418; }
