/* The Help page (src/pages/help.js): the contents, "Start here" with its four reading routes,
   the features (what / why / how / an example, live samples and the designer's picture places),
   the A-to-Z words, and the closing chat band. Tokens only (site.css); the shared parts (card,
   pair, gap-note, badge, cta-band) keep their own look from parts.css. */

.help-head { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
/* site.css sets the display face only up to h3; this page's h4s (a route, a feature) take it too */
.help-route .card__title, .help-feature__title {
  font-family: var(--font-display); font-weight: 560; line-height: 1.15; letter-spacing: -0.01em; margin: 0; overflow-wrap: break-word;
}

/* ---------- on this page */
.help-toc {
  margin-top: 1.8rem; padding: 1rem 1.6rem 1.1rem 1.3rem; width: fit-content; max-width: 100%;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--wobble); box-shadow: 4px 5px 0 var(--rule);
}
.help-toc__title { font-size: 1.15rem; margin-bottom: 0.5rem; }
.help-toc__list { margin: 0; padding-left: 1.4em; display: grid; gap: 0.3rem; font-size: 1.05rem; }

/* ---------- start here */
.help-start__what { max-width: 42rem; display: grid; gap: 0.7rem; font-size: 1.15rem; line-height: 1.6; }
.help-start__routes-title { font-size: clamp(min(1.45rem, 7.2vw), 2.6vw, 1.9rem); margin: 2.6rem 0 0.6rem; }
.help-routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.help-route__steps { margin: 0.4rem 0 0; padding-left: 1.4em; display: grid; gap: 0.55rem; }
.help-route__steps a { overflow-wrap: anywhere; }

/* ---------- how to use this site */
/* each group folded under its title (a <details>), its features' titles as the summary's second line */
.help-group { margin-top: 1rem; max-width: 52rem; padding: 0.9rem 1.1rem; background: var(--card); border: 2px solid var(--ink); border-radius: var(--wobble); box-shadow: 4px 5px 0 var(--rule); }
.help-group__summary { cursor: pointer; list-style: none; }
.help-group__summary::-webkit-details-marker { display: none; }
.help-group__summary::before { content: "+"; float: right; font-weight: 700; font-size: 1.4rem; line-height: 1; color: var(--gold-deep); }
.help-group[open] > .help-group__summary::before { content: "−"; }
.help-group__title { display: inline; font-size: clamp(min(1.3rem, 6.4vw), 2.4vw, 1.6rem); }
.help-group__items { display: block; margin-top: 0.3rem; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }
.help-group[open] .help-group__items { display: none; }
.help-group .help-feature { box-shadow: none; }
/* the A to Z list, folded under one line; a search opens it */
.help-words__fold { margin-top: 1.2rem; }
.help-words__summary { cursor: pointer; font-weight: 700; font-size: 1.15rem; min-height: 2.75rem; padding-block: 0.5rem; } /* a 44 px target */
.help-feature {
  max-width: 50rem; margin-top: 1.4rem; padding: 1.3rem 1.4rem 1.4rem;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--wobble); box-shadow: 4px 5px 0 var(--rule);
}
/* shrinks with a narrow window, so a long word ("Comprobaciones") still fits at large text sizes */
.help-feature__title { font-size: min(1.32rem, 6.4vw); margin-bottom: 0.8rem; }
.help-route .card__title { margin-bottom: 0.55rem; }
.help-feature__parts { margin: 0; display: grid; grid-template-columns: minmax(8.5rem, max-content) minmax(0, 1fr); gap: 0.55rem 1.2rem; }
.help-feature__parts dt { font-weight: 700; color: var(--gold-deep); font-size: 0.95rem; padding-top: 0.12rem; }
.help-feature__parts dd { margin: 0; min-width: 0; }
.help-feature__steps { margin: 0.6rem 0 0; padding-left: 1.4em; display: grid; gap: 0.4rem; }

/* live samples: the site's own parts, shown small inside an example */
.help-sample { margin-top: 0.7rem; }
/* a badge never wraps elsewhere; here, alone on its line, it may, or a phone page would scroll sideways */
.help-sample .badge { white-space: normal; max-width: 100%; }
.help-feature .gap-note { margin-block: 0.8rem 0; }
.help-quote {
  margin: 0.8rem 0 0; padding: 0.7rem 1rem 0.8rem;
  border-left: 3px solid var(--sea); background: color-mix(in srgb, var(--sea) 7%, var(--paper));
  border-radius: 2px 10px 4px 12px;
}
.help-quote__from, .help-word__from { font-weight: 650; color: var(--ink-soft); }
.help-pair { margin-top: 1.6rem; gap: 2rem 1.4rem; }
.help-pair .pair__dream, .help-pair .pair__print { padding: 2rem 1.1rem 1.1rem; }
.help-pair .pair__label { font-size: 1.45rem; }

/* the designer's picture place: a dashed frame and its caption, until the drawing arrives */
.help-figure { margin: 1.2rem 0 0; max-width: 34rem; }
.help-figure__img { display: block; max-width: 100%; height: auto; }
.help-figure__caption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- words, A to Z */
.help-az { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.6rem; }
.help-az__link {
  display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.4rem;
  font-weight: 700; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: var(--wobble); background: var(--card);
}
.help-az__link:hover { background: var(--ink); color: var(--paper); }
.help-letter { margin-top: 1.8rem; max-width: 50rem; }
.help-letter__title {
  font-size: 2rem; width: 3rem; height: 3rem; display: grid; place-items: center; margin-bottom: 0.6rem;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
}
.help-word__list { margin: 0; border-top: 1.5px dashed var(--rule); }
.help-word__term { font-family: var(--font-display); font-weight: 600; font-size: min(1.25rem, 6.2vw); padding-top: 0.9rem; overflow-wrap: break-word; }
.help-word__def { margin: 0.3rem 0 0; padding-bottom: 0.9rem; border-bottom: 1.5px dashed var(--rule); display: grid; gap: 0.45rem; }
.help-word__plain { font-size: 1.08rem; }
.help-word__verified { color: var(--ink-soft); padding-left: 0.9rem; border-left: 3px solid var(--sea); }
.help-word__see { font-size: 0.95rem; color: var(--ink-soft); }
.help-word__label { font-weight: 650; }
.help-letter__back { margin-top: 0.6rem; font-size: 0.92rem; }
/* touch targets of at least 44 px (2.75rem at the default size) */
.help-letter__back a, .help-back__link { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* find a word (help.js shows it; without JavaScript the A to Z stays as it is) */
.help-find {
  max-width: 34rem; margin: 0 0 1.4rem; padding: 1rem 1.1rem 0.9rem;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--wobble);
}
.help-find__label { display: block; font-family: var(--font-display); font-weight: 600; font-size: min(1.2rem, 6vw); }
.help-find__hint { margin: 0.2rem 0 0.6rem; font-size: 0.95rem; color: var(--ink-soft); }
.help-find__input {
  display: block; width: 100%; min-height: 2.75rem; padding: 0.45rem 0.7rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 6px;
}
.help-find__input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.help-find__status { margin-top: 0.5rem; font-size: 0.95rem; font-weight: 600; }
/* what the box filters out (the attribute must win over the list's own display rules) */
.help-word__list [hidden], .help-letter[hidden], .help-az__link[hidden], .help-find[hidden], .help-back[hidden] { display: none !important; }

/* back to where you were (help.js places it where the reader landed) */
.help-back { margin: 0.6rem 0 0.8rem; font-weight: 650; }
.help-back__link::before { content: "← "; }

/* a jump to a word or a feature lights it up for a moment */
.help-word__term:target, .help-feature:target { background: color-mix(in srgb, var(--gold-light) 40%, var(--card)); }
.help-word__term:target { outline: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 4px; border-radius: 4px; }

/* ---------- smaller screens */
@media (max-width: 62rem) {
  .help-routes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 48rem) {
  /* the floating chat button sits at the screen's bottom right: the search field stops short of it, so the two
     never overlap (at 390 px in Spanish the field ran under it), and the button waits while the field is in use */
  .help-find__input { width: calc(100% - 3.6rem); }
  .page--help:has(.help-find__input:focus) .chat-fab { display: none; }
  /* the diagrams use the full width of their card on a phone (they were drawn 261 px wide at 390 px, their words
     8 to 9 px): the folded group and the feature inside it keep narrower sides, and the picture runs to the
     feature's border */
  .help-group { padding-inline: 0.6rem; }
  .help-feature { padding: 1.1rem 1rem 1.2rem; }
  .help-group .help-feature { padding-inline: 0.75rem; }
  .help-figure { max-width: none; margin-inline: -0.75rem; }
  .help-figure__img { width: 100%; }
  .help-figure__caption { padding-inline: 0.75rem; }
  .help-feature__parts { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .help-feature__parts dd { margin-bottom: 0.6rem; }
  .help-pair .pair__dream, .help-pair .pair__print { padding-inline: 0.9rem; }
}

/* ---------- print: the index of letters, the search box and the way back are of no use on paper */
@media print {
  .help-az, .help-letter__back, .help-find, .help-back { display: none !important; }
  .help-feature { break-inside: avoid; }
}

/* a jump on this very long page is instant: a smooth one glides through up to 100,000 px (site.css makes jumps smooth) */
html:has(> body.page--help) { scroll-behavior: auto; }

/* find a word, at the top: the first matches listed under the box */
.help-head .help-find { margin: 1.2rem 0 0.4rem; }
.help-find__results { margin: 0.6rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.help-find__results a { font-weight: 650; }
.help-find__gist { color: var(--ink-soft); font-size: 0.95rem; }
.help-find__more { margin-top: 0.5rem; font-size: 0.95rem; }
.help-find__more a, .help-find__results a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* the search's notes in the list of words (the filtered note also prints, so paper says it too) */
.help-find__filtered { margin: 0 0 1rem; font-weight: 600; }
.help-find__none-list { margin: 0 0 1rem; }
.help-az[hidden], .help-find__filtered[hidden], .help-find__none-list[hidden], .help-find__results[hidden], .help-find__more[hidden] { display: none !important; }
@media print { .help-find__filtered button { display: none; } }

/* touch areas of at least 44 px for Help's own links: lists of links get a line that tall, and every
   link pads up to it (vertical padding on a link inside a sentence does not move the lines) */
.help-word__see, .help-toc__list, .help-word__from, .help-quote__from { line-height: 2.75rem; }
.page--help main a:not(.help-az__link):not(.btn):not(.chip):not(.help-back__link):not(.cite a) { padding-block: 0.85em; }

