@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
  color: #1a1a1a;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 200;
}

/* ── Book container ── */
.book {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
}

/* ── Pages (spreads) ── */
.spread {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  flex-direction: row;
}

.spread.active {
  display: flex;
}

/* ── Left & right panels ── */
.panel {
  width: 50%;
  height: 100%;
  position: relative;
}

.panel-left  { border-right: 0.5px solid rgba(0, 0, 0, 0.15); }

/* ── Page number ── */
.page-number {
  display: none;
}

/* ── Page counter (current / total) ── */
.page-counter {
  position: absolute;
  bottom: 36px;
  left: 32px;
  font-weight: 200;
  color: #999;
  pointer-events: none;
  z-index: 10;
}

/* ── Inner content areas ── */
.panel-content {
  padding: 14vh 17%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Left panel titles: one line above body text ── */
.panel-left .panel-grid > .wg-label,
.panel-left .panel-grid > .g-full {
  margin-top: -1.6em;
}

/* ── Cover ── */
.cover-right {
  justify-content: center;
  align-items: flex-start;
}

.cover-title {
  font-size: clamp(28px, 3.5vw, 52px);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ── Index page ── */
.index-label {
  font-weight: 200;
}

.toc-num {
  font-weight: 200;
  letter-spacing: 0.04em;
  color: #888;
}

.toc-title {
  font-weight: 300;
  margin-bottom: 10px;
  display: block;
}

.toc-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-item {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 0 8px;
  font-weight: 200;
  line-height: 1.2;
  color: #555;
}

.toc-link {
  pointer-events: auto;
  cursor: pointer;
}
.toc-link:hover {
  font-style: italic;
}

nav a:hover {
  font-style: italic;
}

.toc-item-page {
  color: #888;
  text-align: right;
  padding-top: 2px;
  align-self: start;
}

.toc-desc {
  font-weight: 200;
  line-height: 1.6;
  color: #555;
  margin-top: 4px;
}

/* ── 6-column grid system ──────────────────────────────────────────────────
   Agregar .panel-grid a cualquier .panel-content para activar el grid.
   Las páginas existentes (cover, index) no se ven afectadas.

   2 columnas → .g-half   (cada una span 3)
   3 columnas → .g-third  (cada una span 2)
   Ancho completo → .g-full (span 6)
   Asimétrico 2/3 + 1/3 → .g-two-thirds + .g-third
────────────────────────────────────────────────────────────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 32px;
  row-gap: 32px;
  align-content: start;
}

.g-full       { grid-column: span 6; }
.g-half       { grid-column: span 3; }
.g-two-thirds { grid-column: span 4; }
.g-third      { grid-column: span 2; }
.g-sixth      { grid-column: span 1; }

/* ── Content typography ── */
.wg-label {
  font-weight: 200;
  color: #1a1a1a;
  line-height: 1.6;
}

div:has(> .wg-img) .wg-label {
  font-size: 10px;
  color: #999;
}

.wg-section {
  font-weight: 200;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.wg-title {
  font-weight: 200;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #1a1a1a;
}

.wg-body {
  font-weight: 200;
  line-height: 1.6;
  color: #1a1a1a;
  text-align: justify;
  hyphens: none;
  text-indent: 1.5em;
  text-wrap: pretty;
  letter-spacing: 0.005em;
}

.wg-body + .wg-body {
  text-indent: 0;
}

#spread-obs2 .wg-body,
#spread-obs3 .wg-body {
  text-align: left;
  hyphens: none;
}

#spread-obs2-img .wg-body {
  hyphens: auto;
}

.wg-caption {
  font-weight: 200;
  font-size: 11px;
  line-height: 1.5;
  color: #999;
  margin-top: 10px;
}

/* ── Image placeholders ── */
.wg-img {
  width: 100%;
  background: #e8e8e8;
  display: block;
}

.wg-img--portrait   { aspect-ratio: 3 / 4; }
.wg-img--landscape  { aspect-ratio: 4 / 3; }
.wg-img--square     { aspect-ratio: 1 / 1; }
.wg-img--wide       { aspect-ratio: 16 / 9; }

/* ── Grid demo (página de referencia visual) ── */
.grid-demo-box {
  background: #f5f5f5;
  border: 0.5px solid rgba(0, 0, 0, 0.18);
  min-height: 14vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
}

.grid-demo-label {
  font-weight: 200;
  color: #999;
  letter-spacing: 0.04em;
}

.grid-section-title {
  grid-column: span 6;
  font-weight: 200;
  letter-spacing: 0.08em;
  color: #bbb;
  padding-bottom: 8px;
  border-bottom: 0.5px solid #e8e8e8;
  margin-top: 8px;
}
