/* Page-level styles: generic stacks, agenda, glossary, settings, details. */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  min-width: 0;
}

.section-heading__title--lg { font-size: var(--fs-20); }
.section-head-row__title { font-size: var(--fs-20); font-weight: 700; }
.banner-slot:empty { display: none; }

/* Responsive helpers (toggled in responsive.css) */
.only-mobile { display: none; }

/* ---- Roadmap agenda ------------------------------------------------------------ */
.grid-agenda {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--sp-4);
}

.agenda .today-header { flex-wrap: wrap; }
.agenda .today-header__title { font-size: var(--fs-17); }

/* ---- Lesson page ------------------------------------------------------------------ */
.outline { position: sticky; top: 16px; }
.outline__summary { display: none; }

.reveal {
  border-radius: var(--r-lg);
  background: var(--surface-row);
  border: 1px solid var(--border-row);
  overflow: hidden;
}

.reveal + .reveal { margin-top: 8px; }

.reveal > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--accent-text);
}

.reveal > summary::-webkit-details-marker { display: none; }

.reveal > summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur-fast) ease;
}

.reveal[open] > summary::after { transform: rotate(225deg); }
.reveal > summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.qa .reveal > summary { color: var(--text-strong); }
.reveal__body { padding: 0 14px 14px; font-size: var(--fs-13); color: var(--text-list); line-height: 1.6; }

.flow-block { display: flex; flex-direction: column; gap: 8px; }
.flow-block__title { font-size: var(--fs-11); font-weight: 600; color: var(--cyan); letter-spacing: 0.02em; text-transform: uppercase; }
.recap__label { font-size: var(--fs-10); font-weight: 600; letter-spacing: 0.02em; color: var(--accent-text); }
.recap .prose-list { max-width: none; }

/* ---- Resources ---------------------------------------------------------------------- */
.grid-resources .resource-card { height: 100%; }

/* ---- Glossary ------------------------------------------------------------------------ */
.search-row { position: relative; max-width: 640px; }
.search-row__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-dim); display: grid; pointer-events: none; }
.search-row__icon svg { width: 16px; height: 16px; }
.search-input--lg { max-width: none; padding: 12px 14px 12px 40px; border-radius: var(--r-pill); font-size: var(--fs-13); }
.glossary-count { font-size: var(--fs-11); color: var(--text-dim); }

.glossary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin: 0;
}

.glossary-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r-xl);
  background: var(--surface-card);
  border: 1px solid var(--border-card);
}

.glossary-item dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.glossary-item__term { font-size: var(--fs-17); font-weight: 700; color: var(--text-title); }
.glossary-item__exp { font-size: var(--fs-11); color: var(--text-dim); }
.glossary-item dd { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-12); color: var(--text-list); line-height: 1.6; }
.glossary-item__related { font-size: var(--fs-11); color: var(--text-dim); }
mark { background: color-mix(in srgb, var(--amber) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.link-btn {
  display: inline;
  margin-right: 8px;
  color: var(--cyan);
  font-size: var(--fs-11);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 4px;
}

.link-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---- Settings -------------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-4); align-items: start; }
.settings-card { gap: var(--sp-3); }
.settings-card--danger { border-color: var(--callout-danger-border); }
.file-btn { cursor: pointer; }
.file-btn:hover { filter: brightness(1.14); }
.file-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.kv-list { grid-template-columns: max-content minmax(0, 1fr); }

/* ---- Body helpers --------------------------------------------------------------------------- */
body.has-modal { overflow: hidden; }
