/* InsightRPG Brand & Polish
   ==========================
   Cover page, brand identity, sidebar TOC, and visual polish.
   Uses warm amber accent, Newsreader editorial headings.
*/

/* ============================================================
   COVER PAGE
   ============================================================ */
.cover__hero {
  position: relative;
  text-align: center;
  padding: var(--space-16) var(--page-gutter) var(--space-12);
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
}

.cover__text {
  position: relative;
  z-index: 1;
}

.cover__title {
  font-family: var(--font-editorial);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-5xl));
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  position: relative;
}

.cover__subtitle {
  font-family: var(--font-editorial);
  font-size: var(--text-xl);
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.cover__org {
  font-family: var(--font-clear);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.cover__edition {
  font-family: var(--font-clear);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.cover__cta-wrap {
  margin-top: var(--space-8);
}

.cover__cta-wrap--spaced {
  margin-top: var(--space-4);
}

.cover__cta {
  font-family: var(--font-clear);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.cover__cta:hover {
  background: var(--accent);
  color: #F5F5F0;
}

/* --- Cover Table of Contents --- */
.cover__toc {
  padding: var(--rhythm-section) var(--page-gutter) var(--space-16);
  max-width: var(--wide-width);
  margin: 0 auto;
}

.cover__toc-heading {
  font-family: var(--font-clear);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-tertiary);
  margin-bottom: var(--rhythm-block);
  text-align: center;
  border: none;
  padding: 0;
  font-style: normal;
}

.cover__toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-8) var(--space-6);
}

.cover__toc-part-name {
  font-family: var(--font-editorial);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  margin-bottom: var(--space-3);
  padding: 0;
  border: none;
}

.cover__toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cover__toc-list li {
  margin: 0;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--surface-2);
}

.cover__toc-list a {
  font-family: var(--font-clear);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.cover__toc-list a:hover {
  color: var(--accent);
}

/* ============================================================
   SECTION HEADER (with decorative number)
   ============================================================ */
.section-header {
  position: relative;
  margin-bottom: var(--rhythm-subsection);
  padding-bottom: var(--space-4);
  border-bottom: 3px solid var(--accent);
  overflow: hidden;
}

.section-header__number {
  position: absolute;
  top: -0.15em;
  left: -0.02em;
  font-family: var(--font-editorial);
  font-size: var(--text-display-xl);
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

[data-theme="dark"] .section-header__number {
  opacity: 0.1;
}

.section-header__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-editorial);
  font-size: var(--text-4xl);
  font-weight: 300;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

/* ============================================================
   SIDEBAR TOC
   ============================================================ */
.nav-toc__part {
  margin-bottom: var(--space-2);
}

.nav-toc__part-title {
  font-family: var(--font-clear);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  display: block;
  padding-left: var(--space-2);
}

.nav-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-toc__item {
  margin: 0;
}

.nav-toc__link {
  font-family: var(--font-clear);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-left: 2px solid transparent;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.nav-toc__link:hover {
  color: var(--text-primary);
}

.nav-toc__link--active {
  color: var(--text-primary);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-toc__number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  min-width: 2ch;
}

/* ============================================================
   READING FLOW
   ============================================================ */
article > section {
  scroll-margin-top: var(--space-8);
}

article > section + section {
  padding-top: var(--space-4);
}

/* ============================================================
   PART DIVIDERS
   ============================================================ */
.part-divider {
  text-align: center;
  padding: var(--rhythm-part) var(--page-gutter);
  margin: var(--rhythm-section) 0;
}

.part-divider__name {
  font-family: var(--font-editorial);
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: var(--tracking-wide);
  color: var(--text-primary);
}

.part-divider__rule {
  width: 3rem;
  height: 3px;
  background: var(--accent);
  border: none;
  margin: var(--space-4) auto 0;
}

/* ============================================================
   ROLL TABLE ENHANCEMENTS
   ============================================================ */
.roll-table th abbr {
  text-decoration: none;
  border-bottom: 1px dotted var(--surface-3);
}

.roll-table td:not(:first-child):not(:last-child) {
  font-family: var(--font-mono);
  text-align: center;
  white-space: nowrap;
}

.roll-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

/* ============================================================
   CARD GRID INTEGRATION
   ============================================================ */
.card-grid .exercise-card {
  margin: 0;
}

/* ============================================================
   SPREAD (cover-like full sections)
   ============================================================ */
.spread--cover h1 {
  font-size: var(--text-5xl);
  font-weight: 300;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

@media (max-width: 48em) {
  .spread--cover h1 {
    font-size: var(--text-3xl);
  }
}
