/*
  Book pages. Both books share one layout; each has its own colour scheme below.
  These colours are the books' own (from the designs) and are NOT driven by the site palette.
*/

/* ---------- Colour schemes ---------- */
.style-trench {
  --page-bg: #071A33; --text: #E6EEFF; --heading: #FFFFFF; --muted: #9DB7E8; --body: #C7D6F2;
  --accent: #FFC83D; --link: #FFC83D; --link-hover: #FFE08A; --line: #1F3A66;
  --ph-bg: #14366E; --ph-text: #9DB7E8; --quote-cap: #9DB7E8;
  --hero-bg: #0E2A5C; --s1: #0B2248; --s2: #081C3D; --s3: #061733; --quotes-bg: #04112A;
  --closing-bg: #020A1A; --closing-text: #FFFFFF; --closing-muted: #C7D6F2; --closing-accent: #FFC83D;
  --closing-line: #1F3A66; --closing-ph: #14366E;
  --footer-bg: #020A1A; --footer-text: #9DB7E8; --footer-line: #1F3A66;
  --button: #FFFFFF; --book-shadow: rgba(0, 0, 0, 0.55);
  --r-left: 200px 200px 24px 24px; --r-right: 24px 24px 200px 24px; --r-gallery: 16px;
}
.style-city-of-grey {
  --page-bg: #CDEBF8; --text: #14161A; --heading: #14161A; --muted: #1B3F5E; --body: #2B2F35;
  --accent: #1B3F5E; --link: #14161A; --link-hover: #3D4249; --line: rgba(20, 22, 26, 0.25);
  --ph-bg: #F8F4E6; --ph-text: #14161A; --quote-cap: #2B2F35;
  --hero-bg: #CDEBF8; --s1: #B8E1F5; --s2: #A2D8F2; --s3: #88CDEE; --quotes-bg: #6DBCE4;
  --closing-bg: #2D6B9E; --closing-text: #FFFFFF; --closing-muted: #F8F4E6; --closing-accent: #F8F4E6;
  --closing-line: #90D5F1; --closing-ph: #90D5F1;
  --footer-bg: #2D6B9E; --footer-text: #F8F4E6; --footer-line: #90D5F1;
  --button: #14161A; --book-shadow: rgba(27, 63, 94, 0.45);
  --r-left: 4px 4px 4px 160px; --r-right: 4px 160px 4px 4px; --r-gallery: 0;
}

/* ---------- Basics ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body.book-page {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: Inter, system-ui, sans-serif; color: var(--text); background: var(--page-bg); line-height: 1.5;
}
.book-page main { flex: 1 0 auto; }
.book-page a { color: var(--link); }
.book-page a:hover { color: var(--link-hover); }
.book-page :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.book-page img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: #FFFFFF; color: #14161A; font-weight: 600; }
.skip-link:focus { top: 16px; }
.admin-banner { background: #14161A; color: #FFFFFF; font-size: 14px; }
.admin-banner .wrap { max-width: 1200px; margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.admin-banner a { color: #FFC83D; font-weight: 600; }

.bp-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.bp-narrow { max-width: 1100px; }
.bp-section { padding-top: 120px; padding-bottom: 120px; }
.bp-split { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; }
.bp-center { max-width: 1000px; text-align: center; display: flex; flex-direction: column; gap: 24px; align-items: center; }
.bp-center p { margin: 0; }
.display, .bp-brand, .book-page h1, .bp-tagline, .bp-lead, .bp-statement, .bp-big, .bp-subline, .book-page blockquote {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

/* ---------- Header ---------- */
.bp-header { background: var(--hero-bg); }
.bp-header-inner { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.bp-brand { font-weight: 800; font-size: 26px; letter-spacing: -0.5px; color: var(--heading) !important; text-decoration: none; }
.bp-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bp-menu a { padding: 12px 14px; color: var(--heading); text-decoration: none; font-weight: 600; }
.bp-menu a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 6px; }
.style-trench .bp-menu a[aria-current="page"] { color: var(--accent); }
.style-city-of-grey .bp-menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Hero ---------- */
.bp-hero { background: var(--hero-bg); padding-top: 40px; }
.style-city-of-grey .bp-hero { padding-top: 64px; }
.bp-hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.bp-hero-text p { margin: 0; }
.bp-kicker { font-size: 14px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); }
.book-page h1 { margin: 0; font-weight: 800; color: var(--heading); line-height: 0.86; }
.style-trench h1 { font-size: clamp(80px, 14vw, 168px); letter-spacing: -6px; line-height: 0.85; }
.style-city-of-grey h1 { font-size: clamp(64px, 11.5vw, 140px); letter-spacing: -5px; }
.bp-tagline { font-weight: 300; font-size: clamp(24px, 3vw, 32px); line-height: 1.25; max-width: 520px; }
.bp-credit { font-size: 16px; color: var(--muted); }
.bp-hero-book { flex: 1 1 360px; min-width: 0; display: flex; justify-content: center; }

/* Buying */
.bp-buy { display: flex; flex-direction: column; gap: 16px; padding-top: 10px; }
.bp-formats { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.bp-format { position: relative; cursor: pointer; }
.bp-format input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bp-format span { display: inline-block; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--text); font-size: 15px; font-weight: 500; }
.bp-format input:checked + span { border-color: var(--button); box-shadow: inset 0 0 0 1px var(--button); color: var(--heading); }
.bp-format input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.bp-format.is-sold-out { cursor: not-allowed; }
.bp-format.is-sold-out span { opacity: 0.55; text-decoration: line-through; }
.bp-buy-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.bp-button {
  padding: 14px 24px; background: transparent; color: var(--button); border: 1.5px solid var(--button); border-radius: 999px;
  font: inherit; font-weight: 500; font-size: 16px; letter-spacing: 0.3px; cursor: pointer;
}
.bp-button:hover { background: var(--button); color: var(--hero-bg); }
.bp-button:disabled { opacity: 0.5; cursor: not-allowed; background: transparent; color: var(--button); }
.bp-note { font-size: 14px; color: var(--muted); }

/* 3D book (same as the themed pages, own shadow colour) */
.book3d { perspective: 1800px; display: flex; justify-content: center; padding: 20px 0 20px var(--spine); }
.book3d .bk { position: relative; width: var(--w); max-width: 100%; aspect-ratio: 5 / 8; transform-style: preserve-3d; transform: rotateY(32deg); }
.book3d .front { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0 3px 3px 0; box-shadow: 28px 32px 56px var(--book-shadow); }
.book3d .spine { position: absolute; top: 0; left: calc(var(--spine) * -1); width: var(--spine); height: 100%; object-fit: cover; transform-origin: right center; transform: rotateY(-90deg); }

/* ---------- Chapter backgrounds ---------- */
.bp-s1 { background: var(--s1); }
.bp-s2 { background: var(--s2); }
.bp-s3 { background: var(--s3); }
.bp-quotes { background: var(--quotes-bg); }
.bp-section.layout-closing { background: var(--closing-bg); color: var(--closing-text); padding-top: 140px; }

.bp-label { margin: 0; font-size: 13px; letter-spacing: 4px; text-transform: uppercase; color: var(--accent); }
.bp-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.bp-text p { margin: 0; }
.bp-lead { font-weight: 300; font-size: clamp(26px, 3vw, 34px); line-height: 1.3; color: var(--heading); }
.bp-body { font-size: 17px; line-height: 1.75; color: var(--body); }

/* Pictures */
/* Uploaded pictures keep their own shape and are never trimmed; only very tall ones are limited in
   height. The empty placeholder spots keep the design's shapes. */
.bp-picture { flex: 1 1 440px; min-width: 0; }
.bp-picture img { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; margin: 0 auto; }
.bp-picture .bp-placeholder { width: 100%; }
.layout-picture-left .bp-picture img, .layout-picture-left .bp-placeholder { border-radius: var(--r-left); }
.layout-picture-left .bp-placeholder { aspect-ratio: 5 / 4; }
.layout-picture-right .bp-split { flex-wrap: wrap-reverse; flex-direction: row-reverse; }
.layout-picture-right .bp-picture img, .layout-picture-right .bp-placeholder { border-radius: var(--r-right); }
.layout-picture-right .bp-placeholder { aspect-ratio: 16 / 10; }
.bp-placeholder { background: var(--ph-bg); color: var(--ph-text); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-size: 15px; }

/* Big statement + gallery */
.bp-statement { font-weight: 700; font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -2px; color: var(--heading); }
.bp-section.layout-statement { padding-top: 140px; }
.bp-gallery { margin-top: 80px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; align-items: end; }
.bp-fig { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.bp-fig img { display: block; width: auto; max-width: 100%; height: auto; max-height: 440px; align-self: center; border-radius: var(--r-gallery); }
.bp-fig .bp-placeholder { width: 100%; border-radius: var(--r-gallery); }
.bp-fig.shape-1 .bp-placeholder { aspect-ratio: 3 / 4; }
.bp-fig.shape-2 { margin-bottom: 60px; }
.bp-fig.shape-2 .bp-placeholder { aspect-ratio: 1; }
.bp-fig.shape-3 .bp-placeholder { aspect-ratio: 4 / 5; }
.bp-fig figcaption { font-size: 14px; color: var(--quote-cap); }

/* Quotes */
.bp-quotes-inner { display: flex; flex-direction: column; gap: 56px; }
.book-page blockquote { margin: 0; font-weight: 300; }
.bp-quote-big { margin: 0 auto; max-width: 860px; text-align: center; display: flex; flex-direction: column; gap: 20px; }
.bp-quote-big blockquote { font-size: clamp(28px, 4vw, 44px); line-height: 1.25; color: var(--heading); }
.bp-quote-big figcaption { font-size: 15px; letter-spacing: 1px; color: var(--quote-cap); }
.bp-quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.bp-quote-grid.has-rule { border-top: 1px solid var(--line); padding-top: 48px; }
.bp-quote { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.bp-quote blockquote { font-size: 24px; line-height: 1.4; }
.bp-quote figcaption { font-size: 14px; color: var(--quote-cap); }

/* Closing + from the author */
.bp-closing-text { max-width: 900px; gap: 28px; }
.layout-closing .bp-label { color: var(--closing-accent); }
.bp-big { font-weight: 800; font-size: clamp(48px, 7vw, 88px); line-height: 0.98; letter-spacing: -3px; color: var(--closing-text); }
.bp-subline { font-weight: 300; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; color: var(--closing-muted); }
.layout-statement .bp-subline { color: var(--body); }
/* Optional picture under the closing statement, shown whole */
.bp-closing-picture { max-width: 760px; margin-top: 72px; }
.bp-closing-picture img { display: block; width: 100%; height: auto; border-radius: var(--r-right); background: var(--closing-ph); }
.bp-author { max-width: 1000px; margin-top: 100px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; border-top: 1px solid var(--closing-line); padding-top: 56px; }
.bp-author-photo { flex: 0 0 120px; width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px; background: var(--closing-ph); }
.bp-author-text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.bp-author-text p { margin: 0; font-size: 18px; line-height: 1.7; }
.bp-author-text .bp-label { font-size: 13px; letter-spacing: 3px; color: var(--closing-muted); }
.layout-closing a { color: var(--closing-accent); }

/* ---------- Footer ---------- */
.bp-footer { background: var(--footer-bg); border-top: 1px solid var(--footer-line); }
.bp-footer-inner { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; color: var(--footer-text); font-size: 14px; }
.bp-footer a { color: var(--footer-text); }
.bp-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .bp-wrap { padding-left: 16px; padding-right: 16px; }
  .bp-section { padding-top: 72px; padding-bottom: 72px; }
  .bp-section.layout-closing, .bp-section.layout-statement { padding-top: 88px; }
  .bp-hero { padding-top: 16px; }
  .style-city-of-grey .bp-hero { padding-top: 24px; }
  .bp-split { gap: 40px; }
  .style-trench h1 { letter-spacing: -3px; }
  .style-city-of-grey h1 { letter-spacing: -2.5px; }
  .bp-menu { gap: 0; }
  .bp-menu a { padding: 10px 8px; font-size: 15px; }
  .bp-hero-book .book3d .bk { width: calc(var(--w) * 0.7); }
  .bp-statement, .bp-big { letter-spacing: -1px; }
  .bp-gallery { margin-top: 48px; }
  .bp-fig.shape-2 { margin-bottom: 0; }
  .bp-author { margin-top: 64px; gap: 24px; }
  .layout-picture-left .bp-picture img, .layout-picture-left .bp-placeholder { border-radius: 120px 120px 16px 16px; }
  .style-city-of-grey .layout-picture-left .bp-picture img, .style-city-of-grey .layout-picture-left .bp-placeholder { border-radius: 4px 4px 4px 96px; }
}
