/* /ai-hub/ — the Digital & AI Literacy Modular Book Series: master hub,
 * 6 persona landings, 50 tri-lingual chapters.
 *
 * Rules live HERE, never inline in HTML: Check 92 scans static-site/{css,js}
 * only, so an inline `var(--...)` is invisible to the phantom-token guard —
 * the #9317 -> #14368 -> #15616 -> #17166 recurrence class.
 *
 * Every token below is verified present in variables.css (same vocabulary as
 * css/learn-to-learn.css). Do not introduce one without checking:
 *   grep -oE '^\s*--[a-z0-9-]+' css/variables.css | tr -d ' ' | sort -u
 *
 * CACHE STAMP: /css/* is served at max-age=604800 (7 days) while HTML is
 * max-age=3600. If you change a rule here, bump `?v=` in the same commit
 * (#15980 / #17166).
 */

.aih-wrap {
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.aih-breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.aih-breadcrumb a { color: var(--color-text-secondary); }

.aih-langs {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 1rem;
}

/* ---------- landing at-a-glance strip ------------------------------ */

.aih-glance {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0;
  margin: 0 0 1.5rem;
}

.aih-glance li {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.85rem;
}

/* ---------- body typography ---------------------------------------- */

.aih-body {
  line-height: 1.75;
  color: var(--color-text-primary);
}

.aih-body h1 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin: 0.5rem 0 1rem;
}

.aih-body h2 {
  font-size: 1.4rem;
  margin: 2.25rem 0 0.75rem;
}

.aih-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

.aih-body h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.aih-body p,
.aih-body li {
  color: var(--color-text-secondary);
}

.aih-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1rem 0 0.25rem;
}

.aih-body blockquote {
  border-left: 3px solid var(--color-primary);
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--color-text-secondary);
}

.aih-body pre {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

.aih-body code {
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.3rem;
}

.aih-body pre code {
  background: none;
  padding: 0;
}

.aih-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Wide tables scroll inside their own box — the page body must never
 * scroll horizontally on a 390px phone (acceptance gate 6). */
.aih-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.aih-scroll table {
  border-collapse: collapse;
  min-width: 100%;
}

.aih-scroll th,
.aih-scroll td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.aih-scroll th {
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* ---------- callouts (GitHub-style, 5 kinds) ------------------------ */

.aih-callout {
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}

.aih-callout > :last-child { margin-bottom: 0; }

.aih-callout-label {
  font-size: 0.78rem;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.35rem;
}

.aih-note      { border-left-color: var(--color-info); }
.aih-note      .aih-callout-label { color: var(--color-info); }
.aih-tip       { border-left-color: var(--color-success); }
.aih-tip       .aih-callout-label { color: var(--color-success); }
.aih-important { border-left-color: var(--color-primary); }
.aih-important .aih-callout-label { color: var(--color-primary); }
.aih-warning   { border-left-color: var(--color-warning); }
.aih-warning   .aih-callout-label { color: var(--color-warning); }
.aih-caution   { border-left-color: var(--color-error); }
.aih-caution   .aih-callout-label { color: var(--color-error); }

/* ---------- video embeds -------------------------------------------- */

.aih-video {
  margin: 1.5rem 0;
}

.aih-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  display: block;
}

.aih-video figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* ---------- prev/next pager ------------------------------------------ */

.aih-pager {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.aih-pager a {
  color: var(--color-text-secondary);
  text-decoration: none;
  max-width: 48%;
}

.aih-pager a:hover { color: var(--color-primary); }

.aih-pager-next { margin-left: auto; text-align: right; }

@media (max-width: 560px) {
  .aih-pager a { max-width: 100%; }
  .aih-pager-next { margin-left: 0; text-align: left; }
}
