/*
 * Grammar guides and topic phrase pages (LibraryGuidePages: /grammar/…, /phrases/…).
 *
 * Built from the library's tokens only (library.css section 1), so it turns dark with the
 * rest. The lesson itself uses the classes it already has elsewhere — .reference and
 * .ref-example from a chapter's grammar page, .crash-* from the crash course — so this
 * file holds only what is new: the lists of guides, the "where it is taught" box, the
 * previous/next pager and the hub tile row.
 */

.guide-wrap { max-width: 46rem; }
.guide-title { font-size: clamp(1.7rem, 4vw, 2.4rem); overflow-wrap: anywhere; }
.guide-point { margin-bottom: 2rem; }
.guide-point .reference__p em { font-style: italic; }

/* ── lists of guides ── */
.guide-langs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.guide-card,
.guide-card:hover {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.guide-card:hover { border-color: var(--accent); }
.guide-card__title { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; }
.guide-card__meta { font-size: 0.85rem; color: var(--ink-2); }

.guide-chapter { border-bottom: 1px solid var(--rule); }
.guide-chapter[open] { padding-bottom: 0.9rem; }
.guide-chapter__head { padding: 0.75rem 0; font-family: var(--serif); font-size: 1.12rem; font-weight: 500; line-height: 1.35; cursor: pointer; }
.guide-chapter__count { margin-left: 0.35rem; font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3); }
.guide-list__chapter { font-size: 0.9rem; }
.guide-list { display: grid; gap: 0; margin: 0; padding-left: 1.2rem; }
.guide-list li { line-height: 1.45; }
/* A thumb's target: every link in a list of guides, and the "all guides" link, is at least
   44px tall (check:site-basics measured them at 20). */
.guide-list a,
.guide-all a,
.guide-more a,
.guide-where__list a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0.25rem; }
@media (min-width: 40rem) {
  .guide-list--cols { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
}

/* ── where it is taught ── */
.guide-where {
  margin: 0 0 1.75rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--surface);
}
.guide-where__title,
.guide-others__title { margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.guide-where__list { display: grid; gap: 0.45rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
.guide-where__list li { line-height: 1.45; }
.guide-where__label { display: inline-block; min-width: 3.6rem; font-size: 0.8rem; color: var(--ink-3); }
.guide-where__here { font-weight: 600; }
.guide-where__sub { margin: 1rem 0 0.4rem; font-size: 0.95rem; font-weight: 600; }

/* ── previous / next ── */
.guide-pager { display: grid; gap: 0.75rem; margin: 0 0 1rem; }
@media (min-width: 40rem) {
  .guide-pager { grid-template-columns: 1fr 1fr; }
  .guide-pager__prev { grid-column: 1; }
  .guide-pager__next { grid-column: 2; text-align: right; }
}
.guide-pager a,
.guide-pager a:hover {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.guide-pager a:hover { border-color: var(--accent); }
.guide-pager span { display: block; font-size: 0.78rem; color: var(--ink-3); }
.guide-all { margin: 0; }

/* ── topic phrase pages ── */
.guide-more { font-size: 0.95rem; }
.guide-course {
  margin: 2rem 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  background: var(--surface);
}
.guide-others { margin-top: 1.5rem; }
