/* ==========================================================================
   GPDC — Find Your Public Defender: the one search (js/fypd-search.js)
   Live copy (Nov 16) of the V2 prototype's component; today only the Home
   cover mounts it.
   One field at three sizes, one results list, one no-match message, and the
   phone search sheet. Site tokens only; the pill is the site's search pill.
     .fs--hero    Home cover, FYPD page (button + "Use my location")
     .fs--bar     header, 34px, as the live command bar
     .fs--inline  Clients & Families note card, the phone sheet
   ========================================================================== */
.fs { position: relative; text-align: left; }
.fs-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fs-box { position: relative; }

/* ---------- The field ---------- */
.fs-field {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 50px;
    transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.fs-field:focus-within { border-color: var(--primary); box-shadow: var(--control-focus-ring), var(--shadow-md); }
.fs-icon { width: 18px; height: 18px; color: var(--text-light); flex-shrink: 0; }
.fs-input {
    flex: 1; min-width: 0; height: var(--tap); border: 0; outline: 0; background: transparent;
    font: 500 var(--t-body) 'Manrope', sans-serif; color: var(--text-dark);
}
.fs-input::placeholder { color: var(--text-light); }

/* Rolling example in an empty field: "Search Fulton County", the county slides up to the next */
.fs-slot { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.fs-slot .fs-input { width: 100%; }
.fs-rolls .fs-input::placeholder { color: transparent; }
.fs-hint {
    position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none;
    display: flex; align-items: baseline; gap: 0.3em; white-space: nowrap; overflow: hidden;
    font: 500 var(--t-body) 'Manrope', sans-serif; color: var(--text-light); transition: opacity 0.15s var(--ease-out);
}
.fs-rolls.has-value .fs-hint { opacity: 0; visibility: hidden; }
.fs-roll { position: relative; display: inline-grid; overflow: hidden; height: 1.5em; line-height: 1.5em; color: var(--text-medium); }
.fs-roll > span { grid-area: 1 / 1; }
.fs-roll > .is-in { animation: fsRollIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fs-roll > .is-out { animation: fsRollOut 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fsRollIn { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fsRollOut { to { transform: translateY(-100%); opacity: 0; } }
.fs--inline .fs-hint { font-size: var(--t-fine); }

/* Hero */
.fs--hero .fs-field { padding: 0.375rem 0.375rem 0.375rem 1.25rem; box-shadow: var(--shadow-md); }
.fs--hero .fs-go { flex-shrink: 0; white-space: nowrap; min-height: var(--tap); padding: 0.75rem 1.5rem; font-size: var(--t-fine); }
.fs-geo {
    display: inline-flex; align-items: center; gap: 0.375rem; flex-shrink: 0; min-height: var(--tap); padding: 0 0.75rem;
    border: 0; border-radius: 50px; background: transparent; cursor: pointer; white-space: nowrap;
    font: 700 var(--t-meta) 'Manrope', sans-serif; color: var(--primary-text);
    transition: background 0.25s var(--ease-out);
}
.fs-geo svg { width: 16px; height: 16px; flex-shrink: 0; }
.fs-geo:hover { background: var(--primary-subtle); }
.fs-geo-note { margin-top: 0.625rem; padding-left: 1.25rem; font-size: var(--t-meta); line-height: 1.5; color: var(--text-light); }

/* Bar (header) */
.fs--bar .fs-field { height: 34px; padding: 0 0.75rem; gap: 0.4rem; }
.fs--bar .fs-field:focus-within { box-shadow: var(--control-focus-ring); }
.fs--bar .fs-icon { width: 14px; height: 14px; }
.fs--bar .fs-input { height: 32px; font-size: 0.775rem; }

/* Inline */
.fs--inline .fs-field { min-height: 46px; padding: 0 1rem; gap: 0.6rem; border-width: 1.5px; }
.fs--inline .fs-field:focus-within { box-shadow: none; }
.fs--inline .fs-icon { width: 16px; height: 16px; }
.fs--inline .fs-input { font-size: var(--t-fine); }

/* ---------- Results ---------- */
.fs-pop {
    position: absolute; left: 0; right: 0; top: calc(100% + 0.5rem); z-index: 40;
    padding: 0.375rem; max-height: min(420px, 70vh); overflow: auto; overscroll-behavior: contain;
    background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 16px; box-shadow: var(--shadow-lg);
    color: var(--text-dark);
}
.fs-pop[hidden] { display: none; }
.fs--bar .fs-pop { left: auto; right: 0; width: 400px; max-height: calc(100vh - 96px); top: calc(100% + 6px); }
.fs-list { list-style: none; margin: 0; padding: 0; }
.fs-opt {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.125rem 1rem; min-height: var(--tap);
    padding: 0.625rem 0.875rem; border-radius: 10px; cursor: pointer;
}
.fs-opt[aria-selected="true"] { background: var(--primary-subtle); }
.fs-opt-main { flex: 1 1 12rem; min-width: 0; }
.fs-opt-main b { display: block; font-size: var(--t-fine); font-weight: 600; color: var(--text-dark); }
.fs-opt[aria-selected="true"] .fs-opt-main b { color: var(--primary-text); }
.fs-opt-main small { display: block; margin-top: 0.125rem; font-size: var(--t-meta); line-height: 1.45; color: var(--text-light); }
.fs-tag {
    display: inline-block; margin-right: 0.375rem; padding: 0.05rem 0.5rem; border-radius: 50px; vertical-align: 1px;
    background: var(--primary-subtle); color: var(--primary-text);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.fs-opt[aria-selected="true"] .fs-tag { background: var(--bg-white); }
.fs-tel {
    flex-shrink: 0; margin-left: auto; padding: 0.25rem 0; white-space: nowrap; text-decoration: none;
    font: 500 var(--t-fine) 'Ubuntu', sans-serif; color: var(--primary-text);
}
.fs-tel:hover { text-decoration: underline; }
.fs-msg { padding: 0.75rem 0.875rem; font-size: var(--t-fine); line-height: 1.6; color: var(--text-medium); }
.fs-msg[hidden] { display: none; }
.fs-msg b { color: var(--text-dark); font-weight: 600; }
.fs-msg a, .fs-suggest { color: var(--primary-text); font-weight: 700; text-decoration: none; }
.fs-msg a { white-space: nowrap; }
.fs-msg a:hover, .fs-suggest:hover { text-decoration: underline; }
.fs-suggest { border: 0; padding: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; }
.fs-foot[hidden] { display: none; }
.fs-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem;
    margin-top: 0.375rem; padding: 0.5rem 0.875rem; border-radius: 10px; background: var(--bg-light);
    font-size: var(--t-meta); color: var(--text-light);
}
.fs-foot a { color: var(--primary-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
@media (hover: none) { .fs-keys { display: none; } }

/* Focus states the site's buttons don't carry on their own. */
.fs-geo:focus-visible, .fs-go:focus-visible, .fs-suggest:focus-visible, .fs-msg a:focus-visible, .fs-foot a:focus-visible,
.fs-sheet-close:focus-visible, .fs-az a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Phone: the hero field stays one line. Its button keeps its name for screen
   readers and shows only the arrow, a round var(--tap) target at the field's end. */
@media (max-width: 640px) {
    .fs--hero .fs-field { border-radius: 20px; padding: 0.5rem; }
    .fs--hero .fs-icon { margin-left: 0.5rem; }
    .fs--hero .fs-input, .fs--hero .fs-hint { font-size: 16px; }
    .fs--hero .fs-go { width: var(--tap); height: var(--tap); padding: 0; gap: 0; }
    .fs--hero .fs-go span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .fs--hero .fs-go svg { width: 18px; height: 18px; }
    .fs-geo-note { padding-left: 0.5rem; }
}
/* iOS zooms inputs under 16px on focus. */
@media (max-width: 1024px) { .fs-input, .fs-hint { font-size: 16px; } }

/* ---------- Phone search sheet ----------
   Nov 17: it drops down from the top bar, under the magnifier that opened it.
   --fs-top is the bar's bottom edge, set by openSheet(); the bar stays in
   view and the scrim covers only the page below it. */
.fs-scrim {
    position: fixed; inset: var(--fs-top, 0px) 0 0 0; z-index: 1400; background: rgba(15, 15, 15, 0.4);
    opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}
.fs-scrim.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease-out); }
.fs-sheet {
    position: fixed; left: 0; right: 0; top: var(--fs-top, 0px); z-index: 1401; max-width: 640px; margin: 0 auto;
    max-height: calc(100vh - var(--fs-top, 0px) - 1rem); max-height: calc(100dvh - var(--fs-top, 0px) - 1rem);
    overflow: auto; overscroll-behavior: contain;
    padding: 0 1.25rem 1.5rem;
    background: var(--bg-white); border-radius: 0 0 20px 20px; box-shadow: var(--shadow-lg);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path 0.34s var(--ease-out), visibility 0s linear 0.34s;
}
.fs-sheet.is-open { clip-path: inset(0 0 -40px 0); visibility: visible; transition: clip-path 0.34s var(--ease-out); }
/* The title and the field stay at the top while the A to Z list scrolls under them. */
.fs-sheet-top {
    position: sticky; top: 0; z-index: 2; margin: 0 -1.25rem; padding: 1rem 1.25rem 1rem;
    background: var(--bg-white); border-bottom: 1px solid transparent; transition: border-color 0.2s var(--ease-out);
}
.fs-sheet-top.is-scrolled { border-bottom-color: var(--border-light); }
.fs-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.fs-sheet-head h2 { font: 500 1.25rem 'Ubuntu', sans-serif; color: var(--text-dark); }
.fs-sheet-close {
    width: var(--tap); height: var(--tap); margin-right: -0.5rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: transparent; color: var(--text-light); cursor: pointer;
}
.fs-sheet-close:hover { background: var(--bg-light); color: var(--text-dark); }
.fs-sheet-close svg { width: 16px; height: 16px; }
.fs-sheet .fs-pop { max-height: 52vh; }
.fs-sheet-call { font-size: var(--t-fine); line-height: 1.5; color: var(--text-medium); }
.fs-sheet-call a { color: var(--primary-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
.fs-nw { white-space: nowrap; }
.fs-sheet-sub {
    margin: 1.5rem 0 0; font: 600 0.7rem 'Manrope', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-light);
}
.fs-az { list-style: none; margin: 0; padding: 0; }
.fs-az-letter {
    margin: 1.25rem 0 0.25rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--border-light);
    font: 500 1rem 'Ubuntu', sans-serif; color: var(--primary);
}
.fs-az a {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--tap);
    padding: 0.625rem 0.5rem; margin: 0 -0.5rem; border-radius: 10px; text-decoration: none; color: var(--text-dark);
}
.fs-az-where { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.fs-az-where b { font-size: var(--t-fine); font-weight: 600; }
.fs-az-where span { font-size: var(--t-meta); color: var(--text-light); }
.fs-az-tel { flex: none; font-size: var(--t-meta); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary-text); }
.fs-az a:hover { background: var(--primary-subtle); }
/* Desktop Chrome: one nudge when a wheel push starts at the end of the list
   (fypd-search.js endBounce). Phones and Safari use their own bounce. */
@keyframes fsEndNudge {
    0% { transform: none; animation-timing-function: cubic-bezier(0.3, 0, 0.6, 1); }
    30% { transform: translateY(-22px); animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
    100% { transform: none; }
}
.fs-sheet-body.is-nudge { animation: fsEndNudge 0.6s; }
html.fs-locked, html.fs-locked body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .fs-sheet, .fs-scrim { transition: none; animation: none; } .fs-sheet-body.is-nudge { animation: none; } }

/* ---------- "Moved here" tooltip (Home, Nov 18; js/fypd-moved.js) ----------
   The county search left the header and the top of the phone menu for the
   Home cover. Once per browser, a small bubble points at the field from
   beside it. Wide screens only: phones and tablets keep a header search icon,
   so js/fypd-moved.js skips them. Temporary: remove this block with it. */
.fs-moved-tip {
    position: absolute; left: 0; bottom: calc(100% + 0.75rem); z-index: 30;
    display: flex; align-items: center; gap: 0.25rem; width: max-content; max-width: min(18rem, 100%); padding: 0.5rem 0.25rem 0.5rem 1rem;
    background: var(--bg-white); color: var(--text-dark); border-radius: 12px; box-shadow: var(--shadow-lg);
    opacity: 0; animation: fadeSlideUp 0.5s var(--ease-out) 1.4s forwards;
    transition: opacity 0.2s var(--ease-out);
}
.fs-moved-tip.is-off { opacity: 0 !important; animation: none; }
/* Not while the holiday island is open over it (it opens by itself for a few
   seconds on the first page of a visit); the tip shows once it folds. */
body:has(.gi.is-open) .fs-moved-tip { opacity: 0 !important; visibility: hidden; }
.fs-moved-tip p { margin: 0; font-size: var(--t-fine); font-weight: 600; line-height: 1.4; }
/* The pointer: a turned square under the bubble, over the field's magnifier. */
.fs-moved-tip::after {
    content: ''; position: absolute; left: 1.375rem; top: 100%; width: 12px; height: 12px;
    background: var(--bg-white); transform: translateY(-6px) rotate(45deg); border-radius: 0 0 2px 0;
}
.fs-moved-tip-x {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text-light); cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.fs-moved-tip-x svg { width: 16px; height: 16px; }
.fs-moved-tip-x:hover { background: var(--bg-light); color: var(--text-dark); }
.fs-moved-tip-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Wide screens: beside the field, pointing left at it. */
@media (min-width: 1151px) {
    .fs-moved-tip { max-width: 15rem; left: calc(100% + 1rem); bottom: auto; top: 29px; transform: translateY(-50%); animation-name: fsMovedTipIn; }
    .fs-moved-tip::after { left: 0; top: 50%; transform: translate(-6px, -50%) rotate(45deg); border-radius: 0 0 0 2px; }
}
@keyframes fsMovedTipIn { from { opacity: 0; translate: -8px 0; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .fs-moved-tip { animation: none; opacity: 1; } }
