/* ==========================================================================
   Casa Zaza — the menu, as a printed book
   Photograph on the left page, the page itself on the right.
   ========================================================================== */

.menu-page {
  --book-ink: #5a2a15;
  --book-copper: #8a5a30;
  --book-rule: rgba(122, 74, 38, 0.34);
  --book-paper: #faf6eb;
  --book-paper-deep: #f3ecdb;
  --book-green: #0d1a12;
  --book-mono: "DM Sans", system-ui, sans-serif;
}

.menu-page main {
  background: var(--book-green);
}

/* ---------- room ---------- */
.book-room {
  position: relative;
  padding: clamp(84px, 6vw, 100px) clamp(14px, 3vw, 40px) clamp(56px, 6vw, 84px);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(206, 160, 96, 0.16), transparent 60%),
    radial-gradient(80% 60% at 50% 110%, rgba(0, 0, 0, 0.45), transparent 70%),
    var(--book-green);
  isolation: isolate;
}

.book-intro {
  max-width: 720px;
  margin: 0 auto clamp(16px, 1.8vw, 24px);
  text-align: center;
  color: #f2ecdf;
}

.book-intro h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.book-intro h1 em {
  font-style: italic;
  color: #d8a86a;
}

.book-intro-copy {
  max-width: 60ch;
  margin: 0 auto;
  font-size: clamp(11px, 0.9vw, 13px);
  line-height: 1.65;
  color: rgba(242, 236, 223, 0.55);
}

/* ---------- the book ---------- */
.book-wrap {
  display: flex;
  justify-content: center;
  perspective: 2600px;
  perspective-origin: 50% 46%;
}

.book {
  position: relative;
  width: min(1040px, 100%, calc((100vh - 322px) * 1.21));
  aspect-ratio: 1.21;
  container-type: inline-size;
  container-type: inline-size;
  transform-style: preserve-3d;
  transform: rotateX(2.6deg);
}

.book__stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  border-radius: 4px;
  box-shadow:
    0 42px 70px -30px rgba(0, 0, 0, 0.75),
    0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

.book__shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -4%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.72), transparent 72%);
  filter: blur(14px);
  z-index: 0;
}

.book__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 7%;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    rgba(30, 18, 8, 0) 0%,
    rgba(30, 18, 8, 0.16) 34%,
    rgba(30, 18, 8, 0.34) 50%,
    rgba(30, 18, 8, 0.16) 66%,
    rgba(30, 18, 8, 0) 100%
  );
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 8;
}

/* ---------- spreads ---------- */
.spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  visibility: hidden;
  z-index: 1;
}

.spread.is-current {
  opacity: 1;
  visibility: visible;
  z-index: 4;
}

.spread.is-incoming {
  opacity: 1;
  visibility: visible;
  z-index: 3;
}

.book[data-dir="next"] .spread.is-turning .page--right,
.book[data-dir="prev"] .spread.is-turning .page--left {
  visibility: hidden;
}

.book[data-dir="next"] .spread.is-incoming .page--left,
.book[data-dir="prev"] .spread.is-incoming .page--right {
  visibility: hidden;
}

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

.page--left {
  border-radius: 4px 0 0 4px;
}

.page--right {
  border-radius: 0 4px 4px 0;
}

/* paper grain */
.page--sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 84, 40, 0.05) 0.6px, transparent 0.6px);
  background-size: 4px 4px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.page--sheet {
  background:
    radial-gradient(120% 100% at 100% 0%, #fffdf6 0%, var(--book-paper) 46%, var(--book-paper-deep) 100%);
}

/* ---------- photo pages ---------- */
.page--photo {
  background: #ffffff;
}

.spread[data-deck="bar"] .page--photo {
  background: #0c0a09;
}

.page--photo .plate {
  display: block;
  width: 100%;
  height: 100%;
  /* the printed page, uncropped */
  object-fit: contain;
  object-position: 50% 50%;
}

.page--photo .page-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 12, 4, 0.14) 0%, transparent 7%, transparent 93%, rgba(20, 12, 4, 0.2) 100%);
  pointer-events: none;
}

/* ---------- cover page ---------- */
.page--cover {
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(210, 168, 104, 0.22), transparent 60%),
    linear-gradient(160deg, #16261a 0%, #0c1710 60%, #08110b 100%);
  display: grid;
  place-items: center;
  color: #efe6d2;
}

.cover-plate {
  position: relative;
  text-align: center;
  padding: 8%;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
}

.cover-plate::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(232, 197, 146, 0.26);
  pointer-events: none;
}

.cover-kicker {
  font-size: 1.05cqw;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(239, 230, 210, 0.5);
}

.cover-mark {
  margin: 5cqw 0 1.4cqw;
  font-family: "Playfair Display", serif;
  font-size: 9cqw;
  line-height: 0.9;
  letter-spacing: 0.06em;
  color: #e8c592;
}

.cover-title {
  font-family: "Playfair Display", serif;
  font-size: 2.5cqw;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(239, 230, 210, 0.82);
}

.cover-rule {
  width: 22%;
  height: 1px;
  margin: 3.4cqw auto;
  background: rgba(232, 197, 146, 0.5);
}

.cover-line {
  font-size: 1cqw;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(239, 230, 210, 0.55);
}

/* ---------- the sheet ---------- */
.sheet {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 4.6% 6.6% 3.4%;
  display: flex;
  flex-direction: column;
  color: var(--book-ink);
}

.sheet-frame {
  position: absolute;
  inset: 3.2%;
  border: 1px solid var(--book-rule);
  pointer-events: none;
  background-image:
    var(--orn-tl), var(--orn-tr), var(--orn-br), var(--orn-bl);
  background-repeat: no-repeat;
  background-position:
    left 0 top 0,
    right 0 top 0,
    right 0 bottom 0,
    left 0 bottom 0;
  background-size: 2.6cqw 2.6cqw;
}

.menu-page {
  --orn-tl: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M39 3H12C6 3 3 6 3 12v25' fill='none' stroke='%237a4a26' stroke-width='1.2'/%3E%3Cpath d='M34 8c-9 0-14 3-15 8-1 6 7 8 10 4 2-3 0-7-4-7' fill='none' stroke='%237a4a26' stroke-width='1.1'/%3E%3C/svg%3E");
  --orn-tr: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Cpath d='M39 3H12C6 3 3 6 3 12v25' fill='none' stroke='%237a4a26' stroke-width='1.2'/%3E%3Cpath d='M34 8c-9 0-14 3-15 8-1 6 7 8 10 4 2-3 0-7-4-7' fill='none' stroke='%237a4a26' stroke-width='1.1'/%3E%3C/g%3E%3C/svg%3E");
  --orn-br: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(40 40) rotate(180)'%3E%3Cpath d='M39 3H12C6 3 3 6 3 12v25' fill='none' stroke='%237a4a26' stroke-width='1.2'/%3E%3Cpath d='M34 8c-9 0-14 3-15 8-1 6 7 8 10 4 2-3 0-7-4-7' fill='none' stroke='%237a4a26' stroke-width='1.1'/%3E%3C/g%3E%3C/svg%3E");
  --orn-bl: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Cpath d='M39 3H12C6 3 3 6 3 12v25' fill='none' stroke='%237a4a26' stroke-width='1.2'/%3E%3Cpath d='M34 8c-9 0-14 3-15 8-1 6 7 8 10 4 2-3 0-7-4-7' fill='none' stroke='%237a4a26' stroke-width='1.1'/%3E%3C/g%3E%3C/svg%3E");
}

.sheet-head {
  padding: 4.2cqw 0 2.6cqw;
  text-align: center;
}

.sheet-kicker {
  font-size: 1.02cqw;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--book-copper);
}

.sheet-title {
  margin: 1.4cqw 0 1.1cqw;
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-size: 4.5cqw;
  line-height: 0.94;
  letter-spacing: -0.015em;
  color: #5f2a12;
}

.sheet-title em {
  font-style: italic;
}

.sheet-sub {
  max-width: 34ch;
  margin: 0 auto;
  font-size: 1.12cqw;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: #7b5a3c;
}

.sheet-note {
  margin-top: 0.9cqw;
  font-size: 1cqw;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--book-copper);
}

.sheet-body {
  flex: 1;
  padding: 0 1.2cqw;
}

.sheet-body--columns {
  display: block;
  columns: 2;
  column-gap: 3.4cqw;
  column-fill: balance;
  column-rule: 1px solid rgba(122, 74, 38, 0.14);
}

.sheet-body--columns .dish-note,
.sheet-body--columns .dish-tasting {
  font-size: 1.05cqw;
}

.dishes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dish {
  position: relative;
  display: grid;
  grid-template-columns: 0.75cqw 1fr;
  gap: 0.9cqw;
  padding: 0.95cqw 0;
  break-inside: avoid;
}

.dish + .dish {
  border-top: 1px solid rgba(122, 74, 38, 0.07);
}

.mark {
  width: 0.62cqw;
  height: 0.62cqw;
  margin-top: 0.5cqw;
  border: 1px solid currentColor;
  display: block;
  position: relative;
}

.mark--veg {
  color: #3f7a3a;
}

.mark--nonveg {
  color: #a33224;
}

.mark--both {
  color: #6b4a2a;
  background: linear-gradient(135deg, #3f7a3a 0 50%, #a33224 50% 100%);
}

.mark--none {
  border-color: transparent;
  visibility: hidden;
}

.mark--none::after {
  display: none;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: currentColor;
  border-radius: 50%;
}

.dish-line {
  display: flex;
  align-items: baseline;
  gap: 0.7cqw;
}

.dish-name {
  font-size: 1.45cqw;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.3;
  color: #4a2410;
}

.dish-dots {
  flex: 1;
  min-width: 0.8cqw;
  border-bottom: 1px dotted rgba(122, 74, 38, 0.42);
  transform: translateY(-0.25cqw);
}

.dish-price {
  font-size: 1.34cqw;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #4a2410;
}

.dish-note {
  margin-top: 0.28cqw;
  font-size: 1.12cqw;
  line-height: 1.42;
  color: #7a5c3e;
  max-width: 40ch;
}

.dish-tasting {
  margin-top: 0.18cqw;
  font-size: 1cqw;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9a7a52;
}

.dish-group + .dish-group {
  margin-top: 2.2cqw;
}

.dish-group-title {
  margin: 0 0 0.8cqw;
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-size: 1.68cqw;
  letter-spacing: 0.01em;
  color: #6b3518;
  break-after: avoid;
}

.sheet-foot {
  margin-top: 1.8cqw;
  padding-top: 1.2cqw;
  border-top: 1px solid rgba(122, 74, 38, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 2cqw;
  font-size: 0.95cqw;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(122, 74, 38, 0.72);
}

.sheet-cta {
  color: #6b3518;
  text-decoration: none;
}

.sheet-cta span {
  color: var(--book-copper);
}

/* ---------- intro / closing pages ---------- */
.page--intro .sheet-head {
  text-align: left;
  padding-top: 3.4cqw;
}

.page--intro .sheet-title {
  font-size: 5.2cqw;
  line-height: 0.92;
}

.intro-body {
  flex: 1;
  padding: 0 1.2cqw;
  font-size: 1.16cqw;
  line-height: 1.72;
  color: #6d4c31;
}

.intro-body p + p {
  margin-top: 1.5cqw;
}

.intro-meta {
  margin-top: 2.4cqw;
  padding-top: 1.4cqw;
  border-top: 1px solid rgba(122, 74, 38, 0.18);
  font-size: 1.02cqw;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--book-copper);
  line-height: 1.8;
}

/* ---------- the turning leaf ---------- */
.flipper {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.92s cubic-bezier(0.32, 0.06, 0.18, 1), opacity 0.24s linear;
  will-change: transform;
}

.flipper.is-on {
  opacity: 1;
}

.flipper__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--book-paper);
}

.flipper__face--back {
  transform: rotateY(180deg);
}

.flipper__face .page {
  height: 100%;
  border-radius: 0 4px 4px 0;
}

.flipper__face--back .page {
  border-radius: 4px 0 0 4px;
}

.flipper__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 12, 4, 0.42), rgba(20, 12, 4, 0) 55%);
  opacity: 0;
  transition: opacity 0.4s;
}

.flipper.is-turning .flipper__shade {
  opacity: 0.85;
  transition: opacity 0.45s 0.12s;
}

/* ---------- controls ---------- */
.book-controls {
  margin: clamp(14px, 1.6vw, 22px) auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 32px);
}

.book-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 236, 223, 0.26);
  border-radius: 50%;
  background: transparent;
  color: #f2ecdf;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.book-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.book-btn:hover {
  border-color: rgba(232, 197, 146, 0.7);
  background: rgba(232, 197, 146, 0.08);
}

.book-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.book-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  min-width: 190px;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(242, 236, 223, 0.72);
  font-variant-numeric: tabular-nums;
}

.book-count-sep {
  color: rgba(242, 236, 223, 0.34);
}

.book-count-label {
  margin-left: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
  color: #d8a86a;
}

.book-hint {
  margin: 14px auto 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 236, 223, 0.34);
}

/* ---------- small screens: a stack, not a spread ---------- */
@media (max-width: 900px) {
  .book-room {
    padding-bottom: 108px;
  }

  .book-wrap {
    perspective: none;
  }

  .book {
    width: 100%;
    aspect-ratio: auto;
    transform: none;
  }

  .book__stage {
    position: relative;
    border-radius: 0;
    box-shadow: none;
  }

  .book__spine,
  .book__shadow {
    display: none;
  }

  /* One page at a time: the photograph, then the menu beneath it.
     Only the current spread is laid out, so the page stays short. */
  .spread {
    position: relative;
    inset: auto;
    display: none;
    grid-template-columns: 1fr;
    gap: 0;
    border-radius: 3px;
    overflow: hidden;
  }

  .spread.is-current {
    display: grid;
  }

  .page--left {
    border-radius: 3px 3px 0 0;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .page--right {
    border-radius: 0 0 3px 3px;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .page--cover {
    aspect-ratio: 3 / 4;
  }

  .page--photo .plate {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: 50% 50%;
  }

  .page--photo .page-shade {
    display: none;
  }

  .book {
    container-type: inline-size;
  }

  .sheet {
    padding: 26px 22px 22px;
  }

  .sheet-frame {
    inset: 12px;
    background-size: 18px 18px;
  }

  .sheet-head {
    padding: 14px 0 12px;
  }

  .sheet-kicker {
    font-size: 11px;
    letter-spacing: 0.22em;
  }

  .sheet-title {
    font-size: 38px;
    margin: 8px 0 6px;
  }

  .page--intro .sheet-title {
    font-size: 38px;
  }

  .sheet-sub,
  .dish-name,
  .dish-price,
  .dish-note,
  .intro-body,
  .cover-title,
  .cover-kicker,
  .cover-line {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-transform: none;
  }

  .sheet-sub,
  .dish-note,
  .intro-body {
    font-size: 15px;
    line-height: 1.62;
  }

  .dish-tasting,
  .sheet-note {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7f5f3d;
  }

  .dish {
    grid-template-columns: 9px 1fr;
    gap: 10px;
    padding: 9px 0;
  }

  .mark {
    width: 7px;
    height: 7px;
    margin-top: 5px;
  }

  .dish-name {
    font-size: 17px;
    line-height: 1.35;
  }

  .dish-price {
    font-size: 16px;
  }

  .dish-group-title {
    font-family: "Playfair Display", serif;
    font-size: 23px;
    margin: 4px 0 8px;
  }

  .sheet-body--columns {
    columns: 1;
  }

  .sheet-foot {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-top: 14px;
    margin-top: 18px;
    border-top: 1px solid rgba(122, 74, 38, 0.16);
    color: rgba(90, 58, 32, 0.88);
  }

  .sheet-foot > * + * {
    margin-top: 4px;
  }

  .cover-mark {
    font-size: 56px;
    margin: 20px 0 8px;
  }

  .cover-title {
    font-size: 14px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
  }

  .cover-kicker,
  .cover-line {
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
  }

  .cover-rule {
    width: 40px;
    height: 1px;
    margin: 18px auto;
    background: rgba(232, 197, 146, 0.5);
  }

  .book-intro h1 {
    font-size: 38px;
  }

  .book-controls {
    gap: 14px;
    margin-top: 22px;
  }

  .book-count {
    min-width: 0;
  }

  .flipper {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flipper {
    transition-duration: 0.01ms;
  }
}

/* ---------- print: the whole book, flat ---------- */
@media print {
  .book-room {
    background: #fff;
    padding: 0;
  }

  .book-intro,
  .book-controls,
  .book-hint,
  .flipper,
  .book__spine,
  .book__shadow {
    display: none;
  }

  .book,
  .book__stage {
    width: 100%;
    aspect-ratio: auto;
    transform: none;
    box-shadow: none;
  }

  .spread {
    position: relative;
    display: grid;
    opacity: 1;
    visibility: visible;
    break-after: page;
  }
}
