/* guides.css: the Family Help Center (help.html, js/guides.js). Every class starts with gd-.
   Colors come from the tokens in css/pages.css, so light and dark mode follow the site. */

.gd-main { padding-bottom: 8px; }
.gd-intro { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.gd-intro .rp-kicker { font-size: .8125rem; }
.gd-intro h1 { font-size: 2.875rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.gd-lead { font-size: 1.125rem; line-height: 1.55; margin: 0; color: var(--hc-text-2); }
.gd-privacy { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--good); font-size: .875rem; font-weight: 600; }
.gd-privacy svg, .gd-letter-note svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#gd-root { margin-top: 40px; scroll-margin-top: 12px; }
#gd-root:focus { outline: none; }

/* ------------------------------------------------------------ topics: four groups of compact rows
   Each row keeps the .gd-card / .gd-card-link / data-topic hooks that guides.js and sponsors.js use. */
.hc-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hc-group { --g-dot: #2468A8; --g-tint: #E8F0FB; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px 20px 8px; }
.hc-group[data-group="choice"] { --g-dot: #6B3FA0; --g-tint: #F1EAFB; }
.hc-group[data-group="rights"] { --g-dot: #B4441B; --g-tint: #FCEDE6; }
.hc-group[data-group="support"] { --g-dot: #17784A; --g-tint: #E6F4EC; }
[data-theme="dark"] .hc-group { --g-dot: #6CB0F0; --g-tint: rgba(108,160,240,.16); }
[data-theme="dark"] .hc-group[data-group="choice"] { --g-dot: #B99AEE; --g-tint: rgba(170,130,230,.18); }
[data-theme="dark"] .hc-group[data-group="rights"] { --g-dot: #F09A78; --g-tint: rgba(230,120,80,.16); }
[data-theme="dark"] .hc-group[data-group="support"] { --g-dot: #5FD08F; --g-tint: rgba(46,160,96,.18); }
.hc-group-h { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: .9375rem; font-weight: 800; color: var(--hc-text-2);
  text-transform: uppercase; letter-spacing: .06em; }
.hc-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--g-dot); flex: none; }
.gd-cards { list-style: none; margin: 0; padding: 0; }
.gd-card { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px; align-items: center; column-gap: 14px;
  min-height: 44px; padding: 12px 4px; border-top: 1px solid var(--hc-line); }
.gd-card:hover .gd-card-link { text-decoration: underline; }
.gd-card:hover .gd-card-chev { transform: translateX(2px); }
.gd-card-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--g-tint); color: var(--ink); }
.gd-card-icon svg, .gd-guide-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gd-card-icon svg { width: 20px; height: 20px; }
.gd-card-text { min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.gd-card-link { color: var(--ink); font-weight: 700; font-size: 1rem; text-decoration: none; }
.gd-card-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }   /* the whole row is the link */
.gd-card-link:focus-visible { outline: none; }
.gd-card-link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 0; }
.gd-card-line { color: var(--muted); font-size: .875rem; }
.gd-card-more { position: relative; z-index: 1; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.gd-card-more a { display: inline-flex; align-items: center; min-height: 24px; text-decoration: none; }
.gd-card-more a:hover { text-decoration: underline; }
.gd-card-chev { width: 18px; height: 18px; fill: none; stroke: #8796A8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
@media (prefers-reduced-motion: reduce) { .gd-card-chev { transition: none; } }


/* ------------------------------------------------------------ a guide */
.gd-flow { max-width: 820px; }
.gd-topbar { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.gd-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; font-size: .92rem; min-height: 36px; }
.gd-all:hover { text-decoration: underline; }
.gd-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.gd-guide { scroll-margin-top: 12px; }
.gd-guide-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.gd-guide-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: #FFF3D6; color: #14324F; }
[data-theme="dark"] .gd-guide-icon { background: rgba(242,179,61,.15); color: var(--gold); }
.gd-guide-title { margin: 2px 0 4px; font-size: 1.55rem; }
.gd-intro-text { margin: 0; color: var(--muted); }

.gd-trail { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 12px; font-size: .85rem; }
.gd-trail-label { color: var(--muted); font-weight: 600; }
.gd-trail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gd-trail li { padding: 3px 10px; border-radius: 999px; background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text); font-weight: 600; }

.gd-step { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 22px; }
.gd-step-h { margin: 0 0 6px; font-size: 1.3rem; scroll-margin-top: 12px; }
.gd-step-h:focus, .gd-step-h:focus-visible { outline: none; }   /* focused by script so screen readers start here; not a control */
.gd-help { margin: 0 0 6px; font-size: .9rem; }

.gd-options { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.gd-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font-weight: 600; text-decoration: none; }
.gd-option:hover { border-color: var(--accent); background: var(--hover); }
.gd-option .gd-chev { color: var(--accent); }

.gd-result-head { padding-bottom: 6px; }
.gd-result-badge { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; background: var(--good-bg); color: var(--good); }
.gd-summary { margin: 0; font-size: 1.02rem; }

.gd-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.gd-block h4 { margin: 0 0 8px; font-size: 1.02rem; color: var(--ink); }
.gd-block-lead { margin: 0 0 8px; }
.gd-block ul, .gd-block ol { margin: 0; padding-left: 22px; display: grid; gap: 7px; }
.gd-block-urgent { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--warn-border); border-radius: 12px; background: var(--warn-bg); }
.gd-block-urgent h4 { color: var(--warn-text); }
.gd-numbered { counter-reset: gd; list-style: none; padding-left: 0 !important; }
.gd-numbered li { counter-increment: gd; position: relative; padding-left: 34px; }
.gd-numbered li::before { content: counter(gd); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--navy-2); color: #fff; }
.gd-checklist { list-style: none; padding-left: 0 !important; }
.gd-checklist li { position: relative; padding-left: 28px; }
.gd-checklist li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 15px; height: 15px; border-radius: 4px; border: 2px solid var(--accent); }
.gd-block .gd-links { list-style: none; padding-left: 0; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 600; font-size: .92rem; }
.gd-ext { font-weight: 400; color: var(--muted); }

/* who to contact */
.gd-contacts .field.gd-district { max-width: 420px; margin-bottom: 10px; }
.gd-contact-list { list-style: none; padding-left: 0 !important; }
.gd-contact-list a { font-weight: 600; }
.gd-contact-hint { margin: 0; }

/* letter */
.gd-letter { }
.gd-letter-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: .86rem; color: var(--good); font-weight: 600; }
.gd-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.gd-fields .gd-wide { grid-column: 1 / -1; }
.gd-fields textarea { resize: vertical; min-height: 80px; }
.gd-letter-lang { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .88rem; }
.gd-letter-lang legend { float: left; margin-right: 6px; font-weight: 600; padding: 0; }
.gd-letter-lang label { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; cursor: pointer; }
.gd-letter-out { margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.gd-letter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.gd-letter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-letter-actions .btn { padding: 8px 14px; }
.gd-letter-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px 20px; margin: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; font-size: .92rem; line-height: 1.6; color: var(--text); max-height: 520px; overflow: auto; }
.gd-blank { background: var(--warn-bg); color: var(--warn-text); border-radius: 4px; padding: 0 3px; }
.gd-letter-msg { margin: 0; padding: 0 14px 12px; font-size: .84rem; }

/* nav, disclaimer, sources */
.gd-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.gd-nav-gap { flex: 1; }
.gd-nav .btn { padding: 9px 14px; }
.gd-nav .gd-done { border-color: var(--good); color: var(--good); }
.gd-disclaimer { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); border: 1px solid var(--info-border);
  color: var(--info-text); font-size: .86rem; }
.gd-sources { margin-top: 12px; font-size: .88rem; }
.gd-sources summary { cursor: pointer; font-weight: 600; color: var(--ink); min-height: 32px; display: list-item; padding: 4px 0; }
.gd-sources ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 5px; }

/* ------------------------------------------------------------ contacts, dates, about */
.gd-slot-fallback { display: none; margin: 0; }
#dc-slot:empty + .gd-slot-fallback, #dt-slot:empty + .gd-slot-fallback { display: block; }
.gd-about { margin-top: 40px; }
.gd-about ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gd-about li b { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 800; }
.gd-about li span { font-size: .875rem; color: var(--muted); line-height: 1.5; }

/* Labeled sponsored / affiliate cards (js/sponsors.js): a full-width line under the row, above its whole-row link. */
.gd-card-sp { grid-column: 1 / -1; position: relative; z-index: 1; min-width: 0; }
.gd-card-sp .sp-block { margin: 8px 0 0; padding: 8px; }
.gd-card-sp .sp-card { padding: 8px 10px; }
.gd-hub-sp, .gd-sp { margin-top: 14px; min-width: 0; }

@media (max-width: 860px) {
  .hc-groups { grid-template-columns: 1fr; }
  .gd-about ul { grid-template-columns: 1fr; gap: 14px; }
}

/* ------------------------------------------------------------ phones: plain list rows (Phone mockup) */
@media (max-width: 600px) {
  .gd-intro { gap: 12px; }
  .gd-intro .rp-kicker { font-size: .75rem; }
  .gd-intro h1 { font-size: 1.875rem; line-height: 1.15; }
  .gd-lead, .gd-privacy { display: none; }
  #gd-root { margin-top: 16px; }
  .hc-groups { gap: 14px; }
  .hc-group { border-radius: 16px; padding: 12px 14px 4px; }
  .hc-group-h { font-size: .8125rem; gap: 8px; margin-bottom: 4px; }
  .hc-dot { width: 8px; height: 8px; }
  .gd-card { grid-template-columns: minmax(0, 1fr) 16px; column-gap: 10px; padding: 12px 0; }
  .gd-card-icon, .gd-card-line, .gd-card-more { display: none; }
  .gd-card-link { font-size: .9375rem; }
  .gd-card-chev { width: 16px; height: 16px; }
  .gd-step { padding: 16px; border-radius: 14px; }
  .gd-guide-title { font-size: 1.3rem; }
  .gd-guide-icon { width: 40px; height: 40px; }
  .gd-step-h { font-size: 1.15rem; }
  .gd-fields { grid-template-columns: 1fr; }
  .gd-letter-text { padding: 14px; margin: 10px; font-size: .88rem; }
  .gd-nav-gap { display: none; }
  .gd-nav .btn { flex: 1 1 auto; }
}

/* ------------------------------------------------------------ print: the open guide, or just the letter */
@media print {
  /* With a guide open only the guide prints; the topic hub alone prints its cards and sections. */
  .help-page .topbar, .help-page.gd-guide-open .hc-hero, .help-page.gd-guide-open .gd-hub, .help-page.gd-guide-open .hc-panel, .help-page.gd-guide-open .hc-dates, .help-page.gd-guide-open .hc-next,
  .help-page.gd-guide-open .gd-about, .help-page .site-foot, .help-page .skip-link, .gd-nav, .gd-topbar, .gd-letter-form, .gd-letter-bar, .gd-letter-msg, .gd-district { display: none !important; }
  .gd-step { box-shadow: none; border: 0; padding: 0; }
  /* Each block (checklist, contacts, letter…) prints whole, its heading never left at a page bottom. */
  .gd-block, .gd-letter-text { break-inside: avoid; }
  .gd-step h1, .gd-step h2, .gd-step h3 { break-after: avoid; }
  .gd-step li { break-inside: avoid; }
  .gd-option { border: 0; padding: 2px 0; min-height: 0; }
  .gd-letter-out { border: 0; background: none; }
  .gd-letter-text { max-height: none; overflow: visible; border: 0; margin: 0; padding: 0; background: none; font-size: 11pt; }
  .gd-blank { background: none; }
  .gd-sources[open] ul, .gd-sources ul { display: grid; }
  /* The source list (opened for print by guides.js) stays in one piece with the disclaimer above it. */
  .gd-sources { break-inside: avoid; font-size: 9pt; }
  .gd-disclaimer { break-after: avoid; break-inside: avoid; }
  /* "Print letter": everything that is not the chosen letter (or a box around it) is removed from the
     layout, so the letter starts at the top of page 1 and nothing hidden leaves blank pages after it. */
  body.gd-printing-letter *:not(:has(.gd-print-this)):not(.gd-print-this):not(.gd-print-this *),
  body.gd-printing-letter .gd-print-this *:not(:has(.gd-letter-text)):not(.gd-letter-text):not(.gd-letter-text *) { display: none !important; }
  body.gd-printing-letter :has(.gd-print-this), body.gd-printing-letter .gd-print-this, body.gd-printing-letter .gd-print-this :has(.gd-letter-text) { margin: 0 !important; padding: 0 !important; border: 0 !important;
    background: none !important; box-shadow: none !important; min-height: 0 !important; max-width: none !important; }
  body.gd-printing-letter .gd-letter-text { font-size: 11pt; line-height: 1.5; }
}
.gd-pre .gd-block-urgent { margin: 12px 0 16px; }
