/* ============================================================
   KRYPTO-BOKEN – läs-sidor
   Bygger på gemensamma temat (theme.css), lägger bok-layout.
============================================================ */

.book-main {
  max-width: var(--content-default);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* --- Framsida / hero --- */
.book-hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.book-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin: 0;
  color: var(--color-text);
}

.book-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  margin: 0.25rem 0 1.75rem;
}

.book-intro {
  max-width: 46rem;
  margin: 0 auto 1rem;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.download-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2.25rem 0 0;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid var(--color-primary);
  transition: background var(--transition), color var(--transition);
}

.btn:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

/* --- Kapitelöversikt --- */
.chapters-section {
  margin-top: 3rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin: 0 0 1.5rem;
  color: var(--color-text);
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.chapter-card {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
}

.chapter-card a {
  text-decoration: none;
  color: inherit;
}

.chapter-num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.chapter-name {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
}

.chapter-card a:hover .chapter-name {
  text-decoration: underline;
}

.chapter-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0.6rem 0 0;
  flex: 1;
}

.risk-note {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface-offset);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* --- Om boken (baksidestext) --- */
.backcover-section {
  margin-top: 3rem;
}

.backcover-section p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 46rem;
}

/* --- Kapitelsidor --- */
.book-chapter {
  max-width: 46rem;
  margin: 0 auto;
}

.chapter-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 2rem 0 0.5rem;
  text-align: center;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  text-align: center;
  margin: 0 0 2.5rem;
  color: var(--color-text);
}

.book-chapter p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
  margin: 0 0 1.15rem;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-divider);
}

.page-nav a {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  transition: background var(--transition), border-color var(--transition);
}

.page-nav a:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}

/* --- Tabeller --- */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.book-chapter table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.book-chapter caption {
  caption-side: top;
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-divider);
}

.book-chapter th {
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--color-surface-offset);
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  white-space: nowrap;
}

.book-chapter td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  vertical-align: top;
  min-width: 8rem;
}

.book-chapter tbody tr:last-child td {
  border-bottom: none;
}

/* --- Ordlista --- */
.glossary {
  margin: 2rem 0 0;
}

.glossary dt {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-primary);
  margin-top: 1.4rem;
}

.glossary dd {
  margin: 0.35rem 0 0;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .btn, .page-nav a {
    transition: none;
  }
}
