/* ==========================================================
   BNK GROUP — FLIP BOOK component (includes/book.php)
   Shared by brochure.php and the popup book (book-modal.php).
   Page size is set by book.js via --pw / --ph; everything inside a
   page scales with container-query (cq) units.
   ========================================================== */

.bk { display: flex; flex-direction: column; min-height: 0; width: 100%; height: 100%; }
/* the stage gets its size from the page layout; the book is centred inside it */
.book-stage {
  flex: 1 1 auto;
  min-height: 220px;
  width: 100%;
  padding: clamp(10px, 2vh, 24px) var(--gutter);
  position: relative;
}
.book-stage::after {                 /* soft table shadow under the book */
  content: ""; position: absolute; left: 50%; bottom: 4%; width: min(70%, 900px); height: 40px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent);
  filter: blur(6px); z-index: 0;
}
.book-viewport { position: absolute; left: 0; top: 0; z-index: 1; }   /* exact px position set by book.js (no half-pixels = sharp text) */
.book-viewport.is-turning { perspective: 2600px; }                     /* 3D only while a page is turning */
.book-viewport.is-single { overflow: hidden; }

/* ---------- the book ---------- */
.book {
  --pw: 360px; --ph: 500px;
  position: relative;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.645,.045,.355,1);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.book:active { cursor: grabbing; }
.book.is-ready .pg { visibility: visible; }

/* page thickness on both sides */
.book__stack {
  position: absolute; top: 1%; bottom: 1%; width: var(--pw); pointer-events: none;
  transition: opacity .6s;
}
.book__stack--left  { left: 0;  box-shadow: -1px 0 0 #ddd3bf, -2px 1px 0 #cfc4ae, -3px 1px 0 #e6dcc8, -4px 2px 0 #cbbfa7, -10px 12px 26px -6px rgba(0,0,0,.6); border-radius: 4px 0 0 4px; }
.book__stack--right { right: 0; box-shadow: 1px 0 0 #ddd3bf, 2px 1px 0 #cfc4ae, 3px 1px 0 #e6dcc8, 4px 2px 0 #cbbfa7, 10px 12px 26px -6px rgba(0,0,0,.6); border-radius: 0 4px 4px 0; }

/* a leaf = one sheet of paper with two faces */
.leaf {
  position: absolute; top: 0; left: 50%;
  width: var(--pw); height: var(--ph);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.645,.045,.355,1);
}
.leaf.is-turning { will-change: transform; }
.leaf.is-flipped { transform: rotateY(-180deg); }
.leaf__face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
  container-type: size;           /* page-relative units for .pg font-size */
}
.leaf__face--back { transform: rotateY(180deg); }
/* gutter shading */
.leaf__face--front::after, .leaf__face--back::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 20;
}
.leaf__face--front::after { background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.06) 6%, transparent 12%), linear-gradient(270deg, rgba(255,255,255,.12), transparent 4%); }
.leaf__face--back::after  { background: linear-gradient(270deg, rgba(0,0,0,.28), rgba(0,0,0,.06) 6%, transparent 12%), linear-gradient(90deg, rgba(255,255,255,.12), transparent 4%); }
/* light sweep while turning */
.leaf__shine {
  position: absolute; inset: 0; z-index: 21; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,.25) 50%, rgba(0,0,0,.25) 80%);
}
.leaf.is-turning .leaf__shine { animation: shine .9s ease-in-out; }
@keyframes shine { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* page-curl hint on the right page corner */
.leaf__face--front .leaf__curl {
  position: absolute; right: 0; bottom: 0; width: 0; height: 0; z-index: 22;
  background: linear-gradient(135deg, transparent 50%, #e8dfcb 50%, #fff 70%);
  box-shadow: -3px -3px 8px rgba(0,0,0,.18);
  transition: width .35s, height .35s;
}
.leaf.is-top:not(.is-flipped) .leaf__face--front:hover .leaf__curl { width: 9%; height: calc(9% * var(--pw-ratio, .72)); }

/* ==========================================================
   PAGES  (container query units — everything scales with page)
   ========================================================== */
.pg {
  position: absolute; inset: 0;
  container-type: size;
  visibility: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 3.1cqw;
  line-height: 1.5;
  padding: 9cqw 8.5cqw 11cqw;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pg img { width: 100%; object-fit: cover; display: block; }
.pg--paper {
  background:
    radial-gradient(120% 80% at 50% 0%, #fffdf8, transparent 70%),
    linear-gradient(180deg, #faf6ec, #f1e9d8);
}
.pg--paper::before {         /* faint paper fibres */
  content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .5; pointer-events: none; mix-blend-mode: multiply;
}
.pg--dark {
  color: var(--cream);
  background: var(--pattern-roof), linear-gradient(160deg, var(--navy-700), var(--navy-900) 60%, var(--navy-950));
}

.pg__eyebrow {
  margin: 0 0 1.6cqw; display: flex; align-items: center; gap: 2.4cqw;
  font-size: 2.3cqw; letter-spacing: .35em; text-transform: uppercase; color: var(--gold-deep); font-weight: 500;
}
.pg__eyebrow::before { content: ""; width: 7cqw; height: 1px; background: currentColor; }
.pg--dark .pg__eyebrow { color: var(--gold); }
.pg__title {
  font-family: var(--font-display); font-size: 7.4cqw; line-height: 1.08; margin: 0 0 3cqw; color: var(--navy-900);
}
.pg__title em { font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); }
.pg--dark .pg__title { color: var(--cream); }
.pg--dark .pg__title em { color: var(--gold-light); }
.pg__body { margin: 0 0 3.5cqw; color: rgba(19,32,46,.78); }
.pg--dark .pg__body { color: rgba(246,241,231,.78); }

.pg__run {
  position: absolute; left: 8.5cqw; right: 8.5cqw; top: 3.6cqw;
  display: flex; justify-content: space-between;
  font-size: 1.8cqw; letter-spacing: .3em; text-transform: uppercase; color: rgba(156,122,55,.8);
  border-bottom: 1px solid rgba(156,122,55,.25); padding-bottom: 1.2cqw;
}
.pg__num {
  position: absolute; bottom: 4cqw; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 2.6cqw; color: var(--gold-deep); letter-spacing: .1em;
}
.pg__num::before, .pg__num::after { content: "—"; margin: 0 1.6cqw; opacity: .5; }
.pg--dark .pg__num, .pg__num--light { color: var(--gold-light); }
.pg--dark .pg__run { color: rgba(236,214,160,.7); border-color: rgba(201,165,92,.25); }

.pg__hero { height: 34cqh; margin: 0 0 4cqw; border: 1px solid rgba(201,165,92,.4); }
.pg__hero--big { height: 46cqh; }
.pg--bleed-top { padding-top: 0; }
.pg--bleed-top .pg__hero { margin: 0 -8.5cqw 4cqw; width: auto; border: 0; }
.pg__strip { height: 15cqh; margin-top: auto; border: 1px solid rgba(201,165,92,.4); }

/* covers */
.pg--cover {
  color: var(--gold-light);
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(45,73,100,.6), transparent 70%),
    var(--pattern-roof),
    linear-gradient(150deg, var(--navy-700), var(--navy-900) 55%, var(--navy-950));
  align-items: center; justify-content: space-between; text-align: center;
  padding: 14cqw 10cqw;
}
.pg--cover::after { /* leather sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.08) 0%, transparent 35%, transparent 65%, rgba(255,255,255,.05));
}
.cover__frame { position: absolute; inset: 5cqw; border: 1px solid rgba(201,165,92,.65); pointer-events: none; }
.cover__frame::before { content: ""; position: absolute; inset: 1.6cqw; border: 1px solid rgba(201,165,92,.3); }
.cover__top { font-size: 2.3cqw; letter-spacing: .38em; text-transform: uppercase; }
.cover__logo { width: 64cqw; height: auto; filter: drop-shadow(0 .6cqw .8cqw rgba(0,0,0,.45)); }
.cover__bottom { display: flex; flex-direction: column; gap: 1.2cqw; font-size: 2.3cqw; letter-spacing: .3em; text-transform: uppercase; }
.cover__bottom span:last-child { color: var(--gold); font-family: var(--font-display); letter-spacing: .2em; font-size: 3cqw; }
.cover__hint {
  position: absolute; right: 7cqw; bottom: 50%; transform: translateY(50%) rotate(90deg); transform-origin: right center;
  font-size: 2cqw; letter-spacing: .4em; text-transform: uppercase; color: var(--gold);
  animation: hint 2s ease-in-out infinite;
}
@keyframes hint { 50% { opacity: .3; } }
.pg--back { justify-content: center; gap: 6cqw; }
.back__mark { width: 30cqw; height: auto; }
.back__quote { font-family: var(--font-serif); font-style: italic; font-size: 6cqw; line-height: 1.2; color: var(--cream); margin: 0; }
.back__tag { font-size: 2.3cqw; letter-spacing: .32em; text-transform: uppercase; margin: 0; }
.back__small { position: absolute; bottom: 9cqw; left: 10cqw; right: 10cqw; font-size: 1.8cqw; color: rgba(236,214,160,.6); margin: 0; }

/* welcome page */
.pg--welcome { justify-content: center; }
.welcome__mark .bnk-logo { width: 22cqw; height: auto; margin-bottom: 6cqw; opacity: .9; }
.pg--welcome .pg__title { font-size: 8cqw; }
.welcome__sign { font-family: var(--font-serif); font-style: italic; font-size: 4cqw; color: var(--gold-light); margin: 2cqw 0 0; }

/* full-photo pages */
.pg--photo { padding: 0; background: var(--navy-900); }
.pg--photo > img { position: absolute; inset: 0; height: 100%; }
.pg--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,18,28,.9), transparent 45%); }
.photo__cap {
  position: absolute; z-index: 1; left: 8cqw; right: 8cqw; bottom: 12cqw;
  font-family: var(--font-display); font-size: 7.5cqw; line-height: 1.05; color: var(--cream);
}
.photo__cap small { display: block; font-family: var(--font-body); font-size: 2.2cqw; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 2cqw; }
.pg--photo .pg__num { z-index: 1; }

/* values */
.values { display: grid; gap: 2.4cqw; margin-bottom: 4cqw; }
.values div { display: grid; grid-template-columns: 8cqw 1fr; column-gap: 3cqw; padding-bottom: 2.4cqw; border-bottom: 1px solid rgba(156,122,55,.25); }
.values b { grid-row: span 2; font-family: var(--font-display); font-weight: 400; font-size: 5cqw; color: var(--gold-deep); line-height: 1; }
.values strong { font-family: var(--font-display); font-weight: 400; font-size: 4cqw; color: var(--navy-900); }
.values span { font-size: 2.6cqw; color: rgba(19,32,46,.65); }

/* image grids */
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; margin-bottom: 3cqw; }
.grid4 figure, .duo figure { margin: 0; position: relative; }
.grid4 img { height: 19cqh; }
.grid4--tall { flex: 1; grid-template-rows: 1fr 1fr; }
.grid4--tall img { height: 100%; }
.grid4 figcaption, .duo figcaption {
  position: absolute; left: 0; bottom: 0; background: rgba(15,29,43,.85); color: var(--gold-light);
  font-size: 1.8cqw; letter-spacing: .2em; text-transform: uppercase; padding: .8cqw 1.8cqw;
}
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2cqw; margin-top: auto; }
.duo img { height: 17cqh; }
.duo--tall { margin: 0 0 3cqw; }
.duo--tall img { height: 25cqh; }

.keyplan { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3cqw; align-items: center; margin-top: auto; background: #fff; border: 1px solid rgba(156,122,55,.3); padding: 2cqw; }
.keyplan img { height: 22cqh; object-fit: contain; }
.keyplan ul { margin: 0; padding: 0; list-style: none; font-size: 2.3cqw; display: grid; gap: 1cqw; color: var(--navy-800); }
.keyplan li::before { content: "◆ "; color: var(--gold); font-size: 1.6cqw; }
.keyplan--wide { grid-template-columns: 1fr; }
.keyplan--wide img { height: 20cqh; }

.plan-img { flex: 1; min-height: 0; object-fit: contain !important; background: #fff; border: 1px solid rgba(156,122,55,.3); margin-bottom: 3cqw; }
.rooms { width: 100%; border-collapse: collapse; font-size: 2.4cqw; }
.rooms td { padding: 1.4cqw 1cqw; border-bottom: 1px solid rgba(156,122,55,.25); }
.rooms td:nth-child(odd) { color: var(--gold-deep); letter-spacing: .12em; text-transform: uppercase; font-size: 2cqw; }
.rooms td:nth-child(even) { font-family: var(--font-display); color: var(--navy-900); }

.promises { list-style: none; counter-reset: p; margin: 1cqw 0 0; padding: 0; display: grid; gap: 3cqw; }
.promises li { counter-increment: p; display: grid; grid-template-columns: 9cqw 1fr; padding-bottom: 3cqw; border-bottom: 1px solid rgba(201,165,92,.22); }
.promises li::before { content: "0" counter(p); grid-row: span 2; font-family: var(--font-display); font-size: 5.5cqw; color: var(--gold); line-height: 1; }
.promises strong { font-family: var(--font-display); font-weight: 400; font-size: 4cqw; }
.promises span { font-size: 2.6cqw; color: rgba(246,241,231,.7); }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.4cqw; }
.contact-list li { font-size: 2.8cqw; color: var(--navy-900); border-bottom: 1px solid rgba(156,122,55,.25); padding-bottom: 2cqw; }
.contact-list small { display: block; font-size: 1.9cqw; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-deep); }

/* ---------- controls ---------- */
.book-controls {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: clamp(6px, 1vw, 12px);
  padding: 0 var(--gutter);
}
.book-controls button {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(201,165,92,.5); background: rgba(15,29,43,.6);
  display: grid; place-items: center; transition: background .3s, opacity .3s;
}
.book-controls button:hover:not(:disabled) { background: var(--gold); }
.book-controls button:disabled { opacity: .3; cursor: default; }
.book-controls svg { width: 18px; height: 18px; fill: none; stroke: var(--gold-light); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.book-controls button:hover:not(:disabled) svg { stroke: var(--navy-900); }
.book-controls__count {
  min-width: 140px; text-align: center; position: relative;
  font-family: var(--font-display); color: var(--gold-light); letter-spacing: .12em; font-size: .95rem; padding-bottom: 8px;
}
.book-controls__count i { position: absolute; left: 10%; bottom: 0; height: 2px; width: 0; background: var(--gold); transition: width .6s; }
.book-controls__count::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 2px; background: rgba(201,165,92,.2); }
.book-controls__full { margin-left: 10px; }


@media (max-width: 600px) {
  .book-controls button { width: 40px; height: 40px; }
  .book-controls__count { min-width: 96px; font-size: .82rem; }
  .book-controls [data-act="first"], .book-controls [data-act="last"] { display: none; }
}
