/* ==========================================================================
   Clients & Families: the guided flow (Dec 2026); script js/clients-guide.js.
   Layout only. The parts are the site's own: the cover (.hero.cl-cover) and
   guide cards (css/clients.css), the option cards, steps, office card and
   answers (css/case-help.css), the county search (css/fypd-search.css) and
   the shared .btn. Site tokens and the one rem spacing scale; no new colors.
   Markup: main.cg
     section.cg-cover#help   who needs help, two answers (.cg-open)
     .cl-ledge               Client Support (css/clients.css)
     section#start           at rest: the right to a lawyer + the finder
     section.cg-out#cgOut    the conclusion (.cg-out-grid > main + aside, .cg-out-foot)
     section#guides          .cg-tabs + one .cl-series at a time
     section.cg-more         two links: the stages, the FAQ
   dialog.cg-dlg#cgDlg       "What's your situation?" (.cg-doors), one more
                             question (.cg-asks), or one answer
   ========================================================================== */

.cg, .cg-dlg { --case-ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* One button system: the shared .btn, flat and 44px tall here, as in the case
   tool (css/case-help.css ".case-flow .btn"). An adapter, not a new system. */
.cg-out .btn:not(.fs-go), .cg-dlg .btn { min-height: var(--tap); padding: 0 1.375rem; font-size: var(--t-fine); font-weight: 700; transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out); }
.cg-out .btn:hover, .cg-out .btn:active, .cg-dlg .btn:hover, .cg-dlg .btn:active { transform: none; }
.cg-out .btn-primary:not(.fs-go) { background: var(--primary); }
.cg-out .btn-primary:not(.fs-go)::before { display: none; }
.cg-out .btn-primary:not(.fs-go):hover { background: var(--primary-text); box-shadow: var(--shadow-btn); }
.cg-out .btn-outline, .cg-out .btn-outline:hover, .cg-dlg .btn-outline, .cg-dlg .btn-outline:hover { box-shadow: none; }
.cg-out .btn svg, .cg-dlg .btn svg { width: 16px; height: 16px; }
.cg .btn:focus-visible, .cg-dlg .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cg-out .case-flow-skip:focus-visible, .cg-out .case-plan-qbtn:focus-visible, .cg-out a:focus-visible,
.cg-dlg .case-flow-skip:focus-visible, .cg-dlg .case-flow-card:focus-visible, .cg-dlg .case-flow-back:focus-visible, .cg-dlg a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.cg-dlg .case-flow-card:focus-visible { border-radius: 16px; }

/* ---------- The cover: who needs help ---------- */
.cg-cover .hero-title { max-width: 46rem; }
/* The photo: two people walking a tree-lined path. Held right of center, so on a phone both stay in the frame. */
.cg-cover .hero-bg img { object-position: 62% center; }
.cg-cover-lede {
    max-width: 34rem; margin: 1.25rem 0 0; font-size: 1.1875rem; line-height: 1.55;
    opacity: 0; animation: fadeSlideUp 0.8s var(--ease-out) 0.55s forwards;
}
.cg-open { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; opacity: 0; animation: fadeSlideUp 0.8s var(--ease-out) 0.7s forwards; }
/* The surface token, not .btn-light's fixed white: in the dark theme its --text-dark label was white on white. */
.cg-open .btn { background: var(--bg-white); min-height: 3.5rem; padding: 0 1.75rem; gap: 0.75rem; font-size: 1.0625rem; font-weight: 700; }
.cg-open .btn svg { width: 18px; height: 18px; color: var(--primary); }
.cg-open .btn:focus-visible { outline-color: currentColor; outline-offset: 3px; }
/* Shorter than the shared cover, so Client Support's ledge stays in the first screen. */
.cg-cover.hero.cl-cover { min-height: 64vh; min-height: 64svh; scroll-margin-top: var(--nav-h); }   /* #help lands under the menu, not behind it */
.cg-cover .hero-content { padding-top: 4rem; padding-bottom: 4rem; }

/* A short laptop screen: less air in the cover, so Client Support's number still shows without scrolling. */
@media (min-width: 641px) and (max-height: 800px) { .cg-cover .hero-content { padding-top: 2rem; padding-bottom: 2.5rem; } }

/* ---------- The dialog ---------- */
.cg-dlg {
    width: min(46rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
    margin: auto; padding: 0; border: 0; border-radius: 20px; overflow: auto; overscroll-behavior: contain;
    background: var(--bg-white); color: var(--text-dark); box-shadow: var(--shadow-lg);
}
/* The page dims behind it: a flat scrim, no blur. */
.cg-dlg::backdrop { background: color-mix(in srgb, var(--island-bg) 55%, transparent); }
.cg-dlg[open] { animation: cgDlgIn 0.35s var(--case-ease, cubic-bezier(0.22, 1, 0.36, 1)) both; }
.cg-dlg[open]::backdrop { animation: cgFade 0.3s ease both; }
@keyframes cgDlgIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes cgFade { from { opacity: 0; } to { opacity: 1; } }
.cg-dlg-top { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); padding: 0.75rem 0.75rem 0 1.75rem; }
.cg-dlg-x {
    width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
    background: none; color: var(--text-medium); transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.cg-dlg-x svg { width: 20px; height: 20px; }
.cg-dlg-x:hover { background: var(--bg-light); color: var(--text-dark); }
.cg-dlg-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cg-dlg-body { padding: 0.25rem 2.25rem 2.25rem; }
.cg-dlg .case-flow-q { font-size: clamp(1.625rem, 2.4vw, 2rem); }
.cg-dlg .case-flow-hint { margin-bottom: 1.5rem; }

/* The four doors: the case tool's option cards, with a small icon plate. */
.cg-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.cg-door { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 0.875rem; padding: 1.25rem 1.125rem 1.25rem 1.25rem; min-height: 6.5rem; }
.cg-door-i { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--bg-light); color: var(--primary); }
.cg-door-i svg { width: 18px; height: 18px; }
.cg-door .case-ns-opt-b { gap: 0.25rem; padding-top: 0.125rem; }
.cg-door .case-ns-opt-t { font-family: 'Ubuntu', sans-serif; font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.cg-door .case-ns-opt-s { font-size: var(--t-fine); color: var(--text-medium); }
.cg-door .case-ns-go { align-self: center; }
.cg-asks .case-flow-card { min-height: 3.75rem; }
.cg-dlg .case-flow-card { animation: cgIn 0.5s var(--case-ease, ease) both; animation-delay: calc(var(--c, 0) * 60ms + 60ms); }
.cg-dlg-foot { margin: 1.25rem 0 0; }
.cg-dlg-foot .case-flow-skip { display: inline-flex; align-items: center; min-height: var(--tap); }
.cg-dlg-acts { margin-top: 1.75rem; }
@keyframes cgIn { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }

/* ---------- The conclusion ---------- */
.cg-out-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 3.5rem; align-items: start; }
.cg-out.is-in .cg-out-main > *, .cg-out.is-in .cg-out-side, .cg-out.is-in .cg-out-foot { animation: cgIn 0.55s var(--case-ease) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.cg-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; margin: 0 0 1rem; font-size: var(--t-fine); font-weight: 600; color: var(--text-light); }
.cg-trail-i:not(:last-of-type)::after { content: "·"; margin-left: 0.5rem; }   /* trails the item, so a wrapped line never starts with it */
.cg-trail .case-flow-skip { display: inline-flex; align-items: center; min-height: var(--tap); margin-left: 0.5rem; color: var(--primary-text); }
.cg-out-h {
    max-width: 38rem; margin: 0; font-family: 'Ubuntu', sans-serif; font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 500;
    line-height: 1.15; letter-spacing: -0.02em; color: var(--text-dark); text-wrap: balance;
}
.cg-out-h:focus { outline: none; }
.cg-out-lede { max-width: 36rem; margin: 1rem 0 0; font-size: 1.1875rem; line-height: 1.6; color: var(--text-medium); }
.cg-out-lede a, .cg-out .case-plan-step-t a, .cg-tips a, .cg-call a { color: var(--primary-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cg-out-lede a:hover, .cg-out .case-plan-step-t a:hover, .cg-tips a:hover, .cg-call a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The rise-in animation makes every block here its own layer, so the steps
   after the finder would paint over its results list; lift the finder above them. */
.cg-find { position: relative; z-index: 2; margin-top: 1.75rem; }
.cg-find .cl-find { max-width: none; }
.cg-find--after { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border-light); }
.cg-sub { margin: 0 0 1rem; font-family: 'Ubuntu', sans-serif; font-size: var(--h-sub); font-weight: 500; line-height: 1.3; color: var(--text-dark); }
.cg-office:not(:empty) { margin-top: 1.25rem; }
.cg-office-card { animation: cgIn 0.5s var(--case-ease) both; }
.cg-lab { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.cg-out .case-plan-steps li { font-size: 1.0625rem; }
/* The two GPDC programs on the coming-home conclusions: the office card, twice. */
.cg-progs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.cg-prog { padding: 1.25rem; }
.cg-prog .case-plan-name { font-size: 1.125rem; }
.cg-prog .case-plan-addr { margin-top: 0.5rem; }
.cg-prog-how { margin-top: 0.5rem; }
.cg-prog-how a { font-weight: 600; white-space: nowrap; }
.cg-prog-how a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Beside it: what to keep in mind and the questions people ask. */
.cg-out-side { padding: 1.75rem; border-radius: 16px; background: var(--bg-light); }
.cg-out-side .case-plan-lab { margin: 0 0 0.75rem; }
.cg-tips { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.75rem; }
.cg-tips li { display: grid; grid-template-columns: 0.375rem minmax(0, 1fr); gap: 0.875rem; font-size: var(--t-sm); line-height: 1.6; color: var(--text-medium); }
.cg-tips li::before { content: ""; width: 0.375rem; height: 0.375rem; margin-top: 0.6rem; border-radius: 50%; background: var(--primary); }
.cg-qs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-light); }
.cg-qs li { border-bottom: 1px solid var(--border-light); }
.cg-qs li:last-child { border-bottom: 0; }
.cg-qs .case-plan-qbtn { font-size: 1rem; }
.cg-guide {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: var(--tap); padding: 0.875rem 0;
    font: 500 1rem/1.35 'Ubuntu', sans-serif; color: var(--text-dark); text-decoration: none; transition: color 0.25s var(--ease-out);
}
.cg-guide svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--primary); }
.cg-guide:hover { color: var(--primary-text); }

.cg-out-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.cg-out-foot .case-flow-skip { display: inline-flex; align-items: center; min-height: var(--tap); }
.cg-call { margin: 0 0 0 auto; font-size: var(--t-fine); color: var(--text-medium); }

/* ---------- Guides: one series at a time ---------- */
.cg-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: -0.75rem 0 2rem; }
.cg-tab {
    min-height: var(--tap); padding: 0 1.125rem; border: 1px solid var(--border-light); border-radius: var(--radius-control-pill); cursor: pointer;
    background: var(--bg-white); font: 600 var(--t-fine) 'Manrope', sans-serif; color: var(--text-medium);
    transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.cg-tab:hover { color: var(--text-dark); border-color: var(--primary); }
.cg-tab[aria-selected="true"] { background: var(--text-dark); border-color: var(--text-dark); color: var(--bg-white); }
.cg-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cg .cl-series[hidden] { display: none; }
.cg .cl-series + .cl-series { margin-top: 0; }

/* ---------- The rest: two links ---------- */
.cg-more { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.cg-more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.cg-more-list li { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
.cg-more-card {
    display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; height: 100%; padding: 1.5rem 1.75rem;
    border: 1px solid var(--border-light); border-radius: 16px; background: var(--bg-white); box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none; transition: box-shadow 0.45s var(--ease-out), border-color 0.3s var(--ease-out);
}
.cg-more-b { display: grid; gap: 0.25rem; }
.cg-more-t { font-family: 'Ubuntu', sans-serif; font-size: var(--h-sub); font-weight: 500; line-height: 1.3; color: var(--text-dark); transition: color 0.3s var(--ease-out); }
.cg-more-x { font-size: var(--t-sm); line-height: 1.55; color: var(--text-medium); }
.cg-more-card svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--primary); transition: transform 0.3s var(--ease-out); }
@media (hover: hover) {
    .cg-more-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; }
    .cg-more-card:hover .cg-more-t { color: var(--primary-text); }
    .cg-more-card:hover svg { transform: translateX(3px); }
}

/* ---------- Narrower ---------- */
@media (max-width: 960px) {
    .cg-out-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
}
@media (max-width: 640px) {
    .cg-cover .hero-content { padding-bottom: 2.5rem; }
    .cg-cover .hero-title { font-size: 2.25rem; }
    .cg-cover .hero-label { margin-bottom: 0.75rem; }
    .cg-cover-lede { font-size: 1.0625rem; margin-top: 1rem; }
    .cg-open { flex-direction: column; margin-top: 1.5rem; }
    .cg-open .btn { width: 100%; justify-content: space-between; }
    .cg-dlg { width: calc(100vw - 1.5rem); max-height: calc(100dvh - 1.5rem); border-radius: 16px; }
    .cg-dlg-top { padding: 0.5rem 0.5rem 0 1.25rem; }
    .cg-dlg-body { padding: 0 1.25rem 1.25rem; }
    .cg-dlg .case-flow-q { font-size: 1.5rem; }
    .cg-dlg .case-flow-hint { margin-bottom: 1.25rem; font-size: var(--t-sm); }
    .cg-doors { grid-template-columns: minmax(0, 1fr); gap: 0.625rem; }
    .cg-door { min-height: 0; padding: 0.875rem 1rem; align-items: center; }
    .cg-door .case-ns-opt-t { font-size: 1.0625rem; }
    .cg-dlg-foot { margin-top: 0.75rem; }
    .cg-dlg-acts .btn { width: 100%; min-height: 48px; }
    .cg-out-h { font-size: 1.75rem; }
    .cg-out-lede { font-size: 1.0625rem; }
    .cg-trail { margin-bottom: 0.5rem; }
    .cg-find { margin-top: 1.5rem; }
    .cg-lab { margin-top: 2rem; }
    .cg-out-side { padding: 1.25rem; }
    .cg-progs { grid-template-columns: minmax(0, 1fr); }
    .cg-prog .case-plan-name { display: inline-flex; align-items: center; min-height: var(--tap); }
    /* Links inside a sentence: the touch area grows, the line does not. */
    .cg-out-lede a, .cg-out .case-plan-step-t a, .cg-tips a { display: inline-block; padding: 0.75rem 0; margin: -0.75rem 0; }
    .cg-out .case-plan-acts .btn { width: 100%; min-height: 48px; justify-content: center; }
    .cg-out-foot { flex-direction: column; align-items: stretch; gap: 0.5rem; margin-top: 2rem; }
    .cg-out-foot .btn { min-height: 48px; }
    .cg-out-foot .case-flow-skip { justify-content: center; }
    .cg-call { margin: 0.5rem 0 0; text-align: center; }
    .cg-call a { display: inline-block; padding: 0.75rem 0; margin: -0.75rem 0; }
    .cg-tabs { margin: -0.5rem 0 1.5rem; }
    .cg-tab { padding: 0 1rem; }
    .cg-more { padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .cg-more-list { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
    .cg-more-card { padding: 1.125rem 1.25rem; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .cg-cover-lede, .cg-open { opacity: 1; animation: none; }
    .cg-dlg[open], .cg-dlg[open]::backdrop, .cg-dlg .case-flow-card, .cg-office-card,
    .cg-out.is-in .cg-out-main > *, .cg-out.is-in .cg-out-side, .cg-out.is-in .cg-out-foot { animation: none; }
    .cg-tab, .cg-more-card, .cg-more-card svg, .cg-more-t, .cg-guide, .cg-dlg-x { transition: none; }
}
