/* Editorial full book — Bodoni / Inter / Source Serif 4, Vogue-influenced */

:root {
  --ink: #0c0c0c;
  --paper: #faf9f6;
  --paper-cool: #f2f1ed;
  --rule: #0c0c0c;
  --muted: #5c5a57;
  --faint: #b0ada8;
  --display: \"Bodoni Moda\", \"Didot\", \"Bodoni MT\", Georgia, serif;
  --sans: \"Inter\", system-ui, sans-serif;
  --body: \"Source Serif 4\", \"Source Serif Pro\", Georgia, serif;
  --page: 768px;
  --spread-scale: 0.5;
  --accent: #0c0c0c;
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--body);
  background: #d9d6d0;
  color: var(--ink);
  padding: 0 0 120px;
}

.template-section {
  padding: 80px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.t-label {
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #6b6560;
  margin-bottom: 6px;
}

.t-name {
  font-family: var(--display);
  font-size: 20px;
  font-style: italic;
  font-weight: 500;
  color: #2a2826;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.book-page {
  width: var(--page);
  height: var(--page);
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.book-page .page__inner {
  position: absolute;
  inset: 0;
  padding: 48px 52px 44px 56px;
  display: flex;
  flex-direction: column;
}

.spread {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 2px;
  width: max-content;
  max-width: none;
  background: var(--rule);
  transform-origin: top center;
  transform: scale(var(--spread-scale, 0.5));
  margin-bottom: calc(var(--page) * (var(--spread-scale, 0.5) - 1));
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.22));
}

/* When the viewport is narrower than the spread, pan horizontally instead of stacking pages. */
.template-section:has(.spread) {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.page-div {
  width: var(--page);
  margin: 36px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-div::before,
.page-div::after {
  content: \"\";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.18), transparent);
}

.page-div span {
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.kicker {
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.kicker em {
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
  margin: 0 8px;
}

.pen-line {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.rule-h {
  height: 1px;
  background: var(--ink);
  width: 100%;
  margin-bottom: 24px;
}

.display-title {
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 600;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 28px;
  font-variant-numeric: proportional-nums;
}

.display-title--sm {
  font-size: clamp(36px, 5vw, 56px);
}

.cols {
  flex: 1;
  display: flex;
  gap: 28px;
  min-height: 0;
}

.col-main {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.82;
  color: #2a2928;
  overflow: hidden;
}

.col-main--intro {
  margin-top: 12px;
}

.col-main--intro p + p {
  margin-top: 0.95em;
}

.col-rail {
  width: 108px;
  flex-shrink: 0;
  border-left: 1px solid var(--ink);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
}

.rail-label {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
}

.rail-block {
  font-size: 9px;
  line-height: 1.55;
  color: var(--muted);
  font-style: italic;
}

/* Song pages: marginal notes column (not illustration plate) */
.col-rail--notes {
  border-left-color: rgba(12, 12, 12, 0.28);
  padding-left: 18px;
}

.col-rail--notes .rail-label {
  font-family: var(--display);
  font-size: 9px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--muted);
}

.col-rail--notes .rail-block {
  font-family: var(--body);
  font-size: 9.5px;
  font-style: italic;
  line-height: 1.62;
  letter-spacing: 0.01em;
  color: #4a4845;
}

.label {
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 18px 0 6px;
}

.label:first-child { margin-top: 0; }

.pull {
  margin-top: 14px;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--accent);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
}

.folio {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Verso (left page of a spread): running title right, page number outer-left */
.spread > .book-page:first-child .folio {
  flex-direction: row-reverse;
}

.folio-num {
  font-family: var(--display);
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.book-page--bleed {
  padding: 0;
  background: #111;
}

.bleed-frame {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 42%),
    radial-gradient(ellipse at 30% 20%, var(--era-glow-1, rgba(255, 255, 255, 0.06)) 0%, transparent 50%),
    linear-gradient(145deg, #2a2a2a 0%, #121212 100%);
}

.bleed-caption {
  position: absolute;
  left: 28px;
  bottom: 28px;
  right: 28px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.book-page--bleed-right .page__inner {
  background: var(--paper-cool);
}

.chapter-thesis {
  font-size: 13px;
  line-height: 1.75;
  color: #2a2928;
  margin-top: 8px;
  max-width: 36em;
}

.chapter-thesis--intro {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

.album-year-line {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 12px;
}

.intro-word-count {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 24px;
}

.fm-title-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 64px;
  text-align: center;
}

.fm-ghost {
  font-family: var(--display);
  font-size: 120px;
  font-style: italic;
  font-weight: 600;
  line-height: 0.85;
  color: rgba(12, 12, 12, 0.07);
  margin-bottom: 8px;
  user-select: none;
}

.fm-book-title {
  font-family: var(--display);
  font-size: 38px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 16px;
}

.fm-subtitle {
  font-family: var(--body);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 32px;
}

.fm-author {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.fm-folio-row {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  justify-content: center;
  gap: 32px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.fm-ded {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  text-align: center;
}

.fm-ded-tag {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.fm-ded-text {
  font-family: var(--display);
  font-size: 26px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.note-head .label-note {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.note-head h2 {
  font-family: var(--display);
  font-size: 28px;
  font-style: italic;
  font-weight: 600;
  margin-bottom: 8px;
}

.note-body {
  flex: 1;
  padding-top: 12px;
  overflow: hidden;
}

.note-body p {
  font-size: 12px;
  line-height: 1.78;
  color: #2a2928;
  margin-bottom: 14px;
}

.sig {
  padding-top: 24px;
  font-family: var(--display);
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
}

@media (max-width: 820px) {
  :root { --page: min(768px, 94vw); }
}

/* Two-up song halves + MV still (editorial book) */
/* Chapter + album merged opener (one bleed plate per era) */
.bleed-frame--chapter-opener {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.52) 0%, transparent 44%),
    radial-gradient(ellipse at 72% 28%, var(--era-glow-1, rgba(255, 255, 255, 0.08)) 0%, transparent 48%),
    linear-gradient(128deg, #242424 0%, #101010 100%);
}

.bleed-frame--mv {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 35%, var(--era-glow-1, rgba(255, 255, 255, 0.08)) 0%, transparent 55%),
    linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 100%);
}

.book-page--bleed:has(.folio--bleed) .bleed-caption {
  bottom: 52px;
}

.folio--bleed {
  position: absolute;
  right: 28px;
  bottom: 22px;
  left: 28px;
  margin-top: 0;
  padding-top: 0;
  justify-content: space-between;
  flex-direction: row-reverse;
  color: rgba(255, 255, 255, 0.42);
}

.folio--bleed .folio-num {
  color: rgba(255, 255, 255, 0.92);
}

.book-page--spread-song .page__inner {
  padding: 40px 34px 38px 40px;
}

.book-page--spread-song .col-rail {
  width: 72px;
  padding-left: 12px;
}

.book-page--spread-song .col-main {
  font-size: 10.5px;
  line-height: 1.74;
}

.book-page--spread-song .pull {
  font-size: 11px;
  margin-top: 8px;
  padding: 10px 0 10px 14px;
}

.book-page--spread-song .pen-line {
  margin-bottom: 10px;
}

/* Recto (right-hand page): masthead rails right; song titles (h2) stay left-aligned */
.spread > .book-page:nth-child(2) .page__inner > .kicker,
.spread > .book-page:nth-child(2) .page__inner > .pen-line {
  text-align: right;
  width: 100%;
}

.spread > .book-page:nth-child(2):not(.book-page--song) .page__inner > .album-year-line,
.spread > .book-page:nth-child(2):not(.book-page--song) .page__inner > .intro-word-count {
  text-align: right;
}

.spread > .book-page:nth-child(2):not(.book-page--song) .page__inner > .display-title {
  text-align: right;
}

.spread > .book-page:nth-child(2):not(.book-page--song) .page__inner > .chapter-thesis--intro {
  text-align: right;
  border-left: none;
  padding-left: 0;
  border-right: 2px solid var(--accent);
  padding-right: 16px;
  margin-left: auto;
  max-width: 36em;
}

.spread > .book-page:nth-child(2).book-page--song .col-main .label {
  text-align: right;
}

.spread > .book-page:nth-child(2).book-page--song .rail-label {
  text-align: right;
}

/* Single-page songs (no spread): same masthead treatment as recto */
.template-section.book-chapter:not(:has(.spread)) .book-page--song .page__inner > .kicker,
.template-section.book-chapter:not(:has(.spread)) .book-page--song .page__inner > .pen-line {
  text-align: right;
  width: 100%;
}

.template-section.book-chapter:not(:has(.spread)) .book-page--song .col-main .label {
  text-align: right;
}

.template-section.book-chapter:not(:has(.spread)) .book-page--song .rail-label {
  text-align: right;
}

/* Intentional blank leaf (chapter ended on a lone song page; balances next chapter spread) */
.book-chapter--blank {
  padding-top: 28px;
}

.book-page--blank {
  background: var(--paper);
}

.page__inner--blank {
  justify-content: flex-end;
  min-height: 100%;
}
