/* =========================================================
   THE BATHS AND BEYOND · A Virgin Gorda Legacy
   16-page editorial book mockup · 9 × 11 in portrait
   ---------------------------------------------------------
   All sizes inside a page use cqw (1cqw = 1% of page width),
   so every layout scales with the page and prints at 9 × 11 in.
   Crops: adjust each photo with the --pos variables in the
   "PHOTO CROPS" section near the bottom of this file.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* book (fixed: paper does not change with screen theme) */
  --paper: #F3F0E8;
  --paper-deep: #ECE7DB;
  --ink: #171715;
  --gray: #77736B;
  --ochre: #B78A3D;
  --sea: #315D61;
  --keyline: rgba(23, 23, 21, .22);

  /* surround (theme-aware) */
  --desk: #D9D7D2;
  --desk-ink: #4A4843;
  --desk-muted: #7D7A73;
  --ui-bg: rgba(255, 255, 255, .72);
  --ui-line: rgba(23, 23, 21, .14);
  --ui-active: #171715;
  --ui-active-ink: #F3F0E8;
  --page-shadow: 0 1px 2px rgba(20, 18, 14, .10), 0 10px 28px -8px rgba(20, 18, 14, .22);

  --display: "Cormorant Garamond", "Cormorant", "EB Garamond", Garamond, "Times New Roman", serif;
  --body: "EB Garamond", Garamond, "Adobe Garamond Pro", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pw: 600px; /* page width, set per view below */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #242422;
    --desk-ink: #D9D6CE;
    --desk-muted: #8E8A82;
    --ui-bg: rgba(40, 40, 38, .8);
    --ui-line: rgba(243, 240, 232, .16);
    --ui-active: #F3F0E8;
    --ui-active-ink: #171715;
    --page-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -10px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #242422;
  --desk-ink: #D9D6CE;
  --desk-muted: #8E8A82;
  --ui-bg: rgba(40, 40, 38, .8);
  --ui-line: rgba(243, 240, 232, .16);
  --ui-active: #F3F0E8;
  --ui-active-ink: #171715;
  --page-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -10px rgba(0, 0, 0, .7);
}

/* ---------- Surround ---------- */
* { box-sizing: border-box; }
html, body { background: var(--desk); }
body {
  margin: 0;
  color: var(--desk-ink);
  font-family: var(--sans);
  padding-inline: 16px;
  padding-block: 0 72px;
  -webkit-font-smoothing: antialiased;
}

.viewer-bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: calc(var(--pw) * 2 + 40px);
  margin: 0 auto;
  padding-block: 14px;
  background: var(--desk);
}
.viewer-bar__title {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--desk-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-bar__title strong { color: var(--desk-ink); font-weight: 500; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: var(--ui-bg);
  padding: 3px;
  flex-shrink: 0;
}
.view-toggle button {
  font: 500 11px/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--desk-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.view-toggle button[aria-pressed="true"] { background: var(--ui-active); color: var(--ui-active-ink); }
.view-toggle button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

/* ---------- Book & spreads ---------- */
.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding-top: 20px;
}
.spread-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spread-label {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--desk-muted);
}
.spread-label b { color: var(--desk-ink); font-weight: 500; }

.spread { display: flex; box-shadow: var(--page-shadow); }

.page {
  position: relative;
  width: var(--pw);
  max-width: 100%;
  aspect-ratio: 9 / 11;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  container-type: inline-size;
  font-family: var(--body);
  line-height: 1.52;
  font-feature-settings: "kern", "liga", "onum";
}

/* body size lives on the page's children: a container can't size itself in its own cqw */
.page > * { font-size: 1.8cqw; }

/* gutter: a whisper of curvature, screen only */
.page::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 5cqw;
  pointer-events: none;
  z-index: 5;
}
.spread .page-left::after  { right: 0; background: linear-gradient(to left, rgba(0,0,0,.09), rgba(0,0,0,0)); }
.spread .page-right::after { left: 0;  background: linear-gradient(to right, rgba(0,0,0,.07), rgba(0,0,0,0)); }

/* spread view (desktop default) */
.book[data-view="spread"] { --pw: min(calc((100vw - 72px) / 2), 640px, calc((100vh - 150px) * 9 / 11)); }
.book[data-view="spread"] .page { max-width: none; }

/* single view */
.book[data-view="single"] { --pw: min(calc(100vw - 32px), 680px); gap: 40px; }
.book[data-view="single"] .spread { flex-direction: column; gap: 28px; box-shadow: none; }
.book[data-view="single"] .page { box-shadow: var(--page-shadow); }
.book[data-view="single"] .page::after { display: none; }

@media (max-width: 760px) {
  .view-toggle { display: none; }
  .book[data-view] { --pw: calc(100vw - 32px); gap: 40px; }
  .book[data-view] .spread { flex-direction: column; gap: 24px; box-shadow: none; }
  .book[data-view] .page { box-shadow: var(--page-shadow); }
  .book[data-view] .page::after { display: none; }
}
@media (max-width: 760px) {
  .viewer-bar { max-width: 100%; }
}

/* ---------- Shared editorial parts ---------- */
.eyebrow, .caption, .folio, .location, .archive-no, .credit {
  font-family: var(--sans);
  font-feature-settings: "tnum";
}
.eyebrow {
  font-size: max(7px, 1.12cqw);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  line-height: 1.6;
}
.location {
  font-size: max(7px, 1.05cqw);
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  line-height: 1.75;
  color: var(--gray);
}
.caption {
  font-size: max(7px, 1.06cqw);
  line-height: 1.55;
  color: var(--gray);
  letter-spacing: .02em;
}
.caption b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: .2em;
}
.caption--light, .caption--light b { color: rgba(243, 240, 232, .88); }
.archive-no {
  font-size: max(7px, 1.02cqw);
  letter-spacing: .2em;
  color: var(--ochre);
  font-weight: 500;
}

.folio {
  position: absolute;
  bottom: 5.2cqw;
  font-size: max(7px, 1cqw);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gray);
  z-index: 3;
}
.page-left .folio  { left: 8cqw; }
.page-right .folio { right: 8cqw; text-align: right; }
.folio .n { color: var(--ink); letter-spacing: .05em; margin: 0 .9em; }
.page-left .folio .n { margin-left: 0; }
.page-right .folio .n { margin-right: 0; }
.folio--light, .folio--light .n { color: rgba(243, 240, 232, .8); }

.full-bleed { position: absolute; inset: 0; }
.full-bleed img, .photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}

.rule { border: 0; height: 0; border-top: 1px solid var(--keyline); margin: 0; }
.rule--ochre { border-top-color: var(--ochre); }

.body-copy p { margin: 0; text-wrap: pretty; hyphens: auto; }
.body-copy p + p { text-indent: 1.6em; }
.body-copy .no-indent { text-indent: 0; }

/* =========================================================
   PAGE 1 · COVER
   ========================================================= */
.p-cover .full-bleed::before {
  /* the lightest possible lift behind the title, top only */
  content: "";
  position: absolute; inset: 0 0 55% 0;
  background: linear-gradient(to bottom, rgba(10, 12, 12, .34), rgba(10, 12, 12, 0));
  z-index: 1;
}
.cover-title {
  position: absolute;
  z-index: 2;
  top: 9cqw;
  left: 9cqw;
  right: 9cqw;
  color: #F3F0E8;
}
.cover-title h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: 8.6cqw;
  line-height: .98;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.cover-title .sub {
  margin: 3.2cqw 0 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 3.3cqw;
  letter-spacing: .01em;
  opacity: .92;
}
.cover-foot {
  position: absolute;
  z-index: 2;
  left: 9cqw; right: 9cqw; bottom: 7cqw;
  display: flex; justify-content: space-between; align-items: flex-end;
  color: rgba(243, 240, 232, .82);
}

/* author on the cover */
.cover-author {
  font-family: var(--sans);
  font-size: max(7px, 1.25cqw);
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(243, 240, 232, .9);
}

/* =========================================================
   PAGE 2 · TITLE PAGE
   ========================================================= */
.p-title .eyebrow { position: absolute; top: 11cqw; left: 0; right: 0; text-align: center; color: var(--gray); }
.title-block {
  position: absolute;
  top: 38cqw; left: 0; right: 0;
  text-align: center;
}
.title-block h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 6.6cqw;
  line-height: 1.04;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-wrap: balance;
}
.title-block .rule--ochre { width: 6cqw; margin: 4.4cqw auto 3.6cqw; }
.title-block .sub {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 3.1cqw;
  color: #3b3a36;
}
.title-detail {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 17cqw;
  width: 22cqw;
}
.title-detail .photo { aspect-ratio: 4 / 3; }
.title-detail .caption { text-align: center; margin-top: 1.6cqw; }
.p-title .credit {
  position: absolute; bottom: 8cqw; left: 0; right: 0;
  text-align: center;
  font-size: max(7px, 1cqw);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gray);
}

/* author on the title page */
.title-author {
  display: block;
  margin: 9cqw 0 0;
  font-family: var(--display);
  font-size: 2.4cqw;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--ink);
}

/* =========================================================
   PAGES 3–4 · OPENING SPREAD
   ========================================================= */
.p3 .caption { position: absolute; left: 8cqw; bottom: 7cqw; z-index: 2; }
.p4-head { position: absolute; top: 12cqw; left: 16cqw; right: 12cqw; }
.p4-head .location { color: var(--gray); margin-bottom: 7cqw; }
.p4-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 4.4cqw;
  line-height: 1.12;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.p4-text {
  position: absolute;
  top: 50cqw;
  left: 16cqw;
  width: 62cqw;
}
.p4-text p:first-child::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 5.3em;
  line-height: .78;
  padding: .06em .08em 0 0;
  color: var(--ink);
}
.verse {
  margin: 2.6cqw 0 2.6cqw 3.2cqw;
  font-family: var(--display);
  font-style: italic;
  font-size: 2.35cqw;
  line-height: 1.42;
}
.verse span { display: block; }

/* =========================================================
   PAGES 5–6 · CHAPTER ONE OPENER (image crosses the gutter)
   ========================================================= */
.span-photo { position: absolute; top: 0; bottom: 0; width: 200%; }
.page-left  .span-photo { left: 0; }
.page-right .span-photo { left: -100%; }
.span-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.p5::before {
  content: "";
  position: absolute; inset: 40% 0 0 0;
  background: linear-gradient(to top, rgba(12, 10, 8, .42), rgba(12, 10, 8, 0));
  z-index: 1;
}
.chapter-mark {
  position: absolute; z-index: 2;
  top: 10cqw; left: 9cqw;
  font-family: var(--display);
  font-weight: 300;
  font-size: 3.6cqw;
  letter-spacing: .1em;
  color: #D9B774;
}
.chapter-mark::after {
  content: "";
  display: block;
  width: 5cqw;
  margin-top: 2cqw;
  border-top: 1px solid rgba(217, 183, 116, .8);
}
.chapter-title {
  position: absolute; z-index: 2;
  left: 9cqw; right: 8cqw; bottom: 12cqw;
  color: #F3F0E8;
}
.chapter-title h2 {
  margin: 0 0 3.8cqw;
  font-family: var(--display);
  font-weight: 300;
  font-size: 6.1cqw;
  line-height: 1.04;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
}
.chapter-title .location { color: rgba(243, 240, 232, .78); }

/* =========================================================
   PAGES 7–8 · THE POOLS
   ========================================================= */
.p7-photo { position: absolute; top: 0; left: 0; right: 14cqw; height: 72cqw; }
.p7-cap { position: absolute; top: 74.5cqw; left: 8cqw; width: 34cqw; }
.p7-text { position: absolute; top: 88cqw; left: 16cqw; width: 62cqw; }
.p7-text h3 {
  margin: 0 0 3.2cqw;
  font-family: var(--sans);
  font-weight: 500;
  font-size: max(7px, 1.12cqw);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink);
}
.p7-text h3 .archive-no { margin-right: 1.2em; }

.pullquote {
  position: absolute;
  top: 16cqw; left: 14cqw; width: 60cqw;
  margin: 0;
}
.pullquote .rule--ochre { width: 5cqw; margin-bottom: 4cqw; }
.pullquote p {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 4.6cqw;
  line-height: 1.2;
  text-wrap: balance;
  text-indent: -.42em; /* hang the opening quote */
}
.p8-text { position: absolute; top: 45cqw; left: 14cqw; width: 50cqw; }
.p8-photo { position: absolute; right: 0; bottom: 0; width: 70cqw; height: 50cqw; }
.p8-cap { position: absolute; left: 8cqw; bottom: 17cqw; width: 18cqw; }

/* =========================================================
   PAGES 9–10 · O'NEAL FAMILY ARCHIVE
   ========================================================= */
.p-archive { background: var(--paper); }
.archive-head { position: absolute; top: 12cqw; left: 12cqw; right: 12cqw; }
.archive-head .archive-no { display: block; margin-bottom: 6cqw; }
.archive-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 6cqw;
  line-height: 1.04;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.archive-head .eyebrow { margin-top: 3.6cqw; color: var(--gray); font-weight: 400; }
.archive-intro { position: absolute; top: 50cqw; left: 12cqw; width: 44cqw; }
.archive-item { position: absolute; }
.archive-item .mount {
  background: var(--paper);
  padding: 0;
  outline: 1px solid var(--keyline);
  outline-offset: 1.4cqw;
}
.archive-item img { display: block; width: 100%; height: auto; }
.archive-item .caption { margin-top: 3.2cqw; }
.archive-item .archive-no { display: block; margin-bottom: .6em; }
.archive-item--triboro { left: 12cqw; bottom: 16cqw; width: 42cqw; }
.archive-item--portrait { top: 13cqw; left: 50%; transform: translateX(-50%); width: 58cqw; }
.archive-item--portrait .caption { text-align: left; }

/* archive I: studio portrait beside the intro */
.archive-item--studio { right: 10cqw; top: 54cqw; width: 28cqw; }
.p9 .archive-intro { width: 40cqw; }

/* archive sections II and III: small numbered heading */
.archive-section { position: absolute; top: 12cqw; left: 14cqw; right: 12cqw; }
.archive-section .archive-no { display: block; margin-bottom: 2.6cqw; }
.archive-section h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 4.2cqw;
  line-height: 1.1;
}

/* archive II · New York */
.p11a-text { position: absolute; top: 28cqw; left: 14cqw; width: 54cqw; }
.archive-item--physicians { left: 14cqw; top: 62cqw; width: 58cqw; }
.archive-item--farewell { left: 10cqw; top: 12cqw; width: 72cqw; }
.archive-item--farewell .caption { width: 30cqw; }
.archive-item--gathering { right: 10cqw; top: 70cqw; width: 42cqw; }

/* archive III · letters and Main Street */
.p13a-text { position: absolute; top: 27cqw; left: 14cqw; width: 50cqw; }
.archive-item--letter68 { left: 12cqw; top: 44cqw; width: 34cqw; }
.archive-item--letter72 { left: 54cqw; top: 44cqw; width: 31.5cqw; }
.archive-item--bamboula { left: 14cqw; top: 12cqw; width: 72cqw; }
.p14a-text { position: absolute; top: 86cqw; left: 14cqw; width: 58cqw; }
.p14a-text .eyebrow { color: var(--gray); margin-bottom: 2.4cqw; }

/* =========================================================
   PAGES 15–16 · MEMORY / BELONGING
   ========================================================= */
.p11 .caption { position: absolute; left: 8cqw; bottom: 7cqw; z-index: 2; }
.p12-lead { position: absolute; top: 22cqw; left: 16cqw; width: 50cqw; color: #3b3a36; }
.belong {
  position: absolute; top: 56cqw; left: 16cqw; right: 10cqw;
  margin: 0;
}
.belong p {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 4.8cqw;
  line-height: 1.16;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.belong .location { margin-top: 5cqw; }

/* =========================================================
   PHOTO CROPS · edit these to re-frame any photograph
   (first value = horizontal, second = vertical)
   ========================================================= */
.img-cover-ladies-pool      { --pos: 47% 50%; }
.img-title-detail           { --pos: 50% 40%; }
.img-virgin-gorda-aerial    { --pos: 56% 50%; }
.img-baths-boulders-sky     { --pos: 50% 38%; }
.img-ladies-pool            { --pos: 36% 50%; }
.img-gentlemens-pool        { --pos: 50% 40%; }
.img-sea-grape-tree         { --pos: 62% 50%; }

/* =========================================================
   PRINT · 9 × 11 in, one page per sheet
   ========================================================= */
@page { size: 9in 11in; margin: 0; }
@media print {
  html, body { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .viewer-bar, .spread-label { display: none !important; }
  .book, .book[data-view] { display: block; padding: 0; gap: 0; --pw: 9in; }
  .spread-wrap { display: block; }
  .spread, .book[data-view] .spread { display: block; box-shadow: none !important; }
  .page, .book[data-view] .page {
    width: 9in !important;
    height: 11in !important;
    max-width: none;
    aspect-ratio: auto;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
  }
  .page::after { display: none !important; }
  .spread-wrap:last-child .page:last-child { break-after: auto; page-break-after: auto; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* =========================================================
   COVER DIRECTIONS · screen only, outside the book
   ========================================================= */
.directions {
  max-width: calc(var(--pw, 600px) * 2);
  width: 100%;
  margin: 96px auto 0;
  color: var(--desk-ink);
}
.directions__head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.directions__head h2 {
  margin: 14px 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
}
.directions__head p { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--desk-muted); }
.directions__sub {
  margin: 40px 0 16px;
  font: 500 11px/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--desk-muted);
}
.dir-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dir-tile { margin: 0; }
.dir-tile img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; box-shadow: var(--page-shadow); }
.dir-tile figcaption { margin-top: 10px; font: 400 11.5px/1.5 var(--sans); letter-spacing: .04em; color: var(--desk-muted); }
.dir-id { display: inline-block; min-width: 2.4em; color: var(--desk-ink); font-weight: 500; letter-spacing: .1em; }
.book[data-view="spread"] ~ .directions { --pw: min(calc((100vw - 72px) / 2), 640px); }
@media (max-width: 760px) {
  .directions { margin-top: 64px; }
  .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media print { .directions { display: none !important; } }

/* =========================================================
   IN REAL LIFE · screen only, outside the book
   ========================================================= */
.in-life {
  max-width: calc(var(--pw, 600px) * 2);
  width: 100%;
  margin: 96px auto 0;
  text-align: center;
  color: var(--desk-ink);
}
.book[data-view="spread"] ~ .in-life { --pw: min(calc((100vw - 72px) / 2), 640px); }
.in-life h2 {
  margin: 14px 0 28px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
}
.in-life__frame { margin: 0; }
.in-life__frame img { display: block; width: 100%; height: auto; box-shadow: var(--page-shadow); }
.in-life__frame figcaption { margin-top: 12px; font: 400 11.5px/1.5 var(--sans); letter-spacing: .04em; color: var(--desk-muted); }
@media (max-width: 760px) { .in-life { margin-top: 64px; } .in-life h2 { font-size: 24px; } }
@media print { .in-life { display: none !important; } }
