/* ============================================================
   Reviews — "words that come dil se" (postcards.html)
   A jharokha gate that opens as the visitor scrolls. Behind it the
   reviews slide sideways; each review's photos sit in a deck of cards
   whose top photo slides left to the back. Only transform/opacity animate.
   The gate itself (leaves + arch outline) is drawn by js/reviews.js.
   ============================================================ */

.rev { margin-top: 96px; }
.rev [hidden] { display: none !important; }  /* class display rules below must never beat the hidden attribute */
.rev-head { text-align: center; margin-bottom: 44px; }
.rev-head .eyebrow { justify-content: center; }
.rev-head .lede { margin: 16px auto 0; }

.rev-stage { max-width: 960px; margin: 0 auto; }

/* ---------- the gate ---------- */

.rev-rig { --drop: 78px; margin: 0 auto; position: relative; }
.rev-gate { position: relative; perspective: 1500px; outline-offset: 10px; }
.rev-gate:focus-visible { outline: 2.5px solid var(--gold); border-radius: 12px; }

/* what shows behind the gate, cut to the arch outline by js (clip-path: url(#rev-clip)) */
.rev-scene { position: relative; overflow: hidden; background: var(--surface); clip-path: url(#rev-clip); }
.rev-track { display: flex; transition: transform 0.75s var(--ease), opacity 0.25s ease; will-change: transform; }
.rev-track.no-anim { transition: none; }
.rev-track.is-fading { opacity: 0; }

.rev-frame { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; display: block; }

.rev-leaf {
  position: absolute;
  top: 0;
  z-index: 3;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  pointer-events: none;
  will-change: transform;
}
.rev-leaf svg { display: block; }
.rev-leaf-l { left: 0; transform-origin: left center; }
.rev-leaf-r { right: 0; transform-origin: right center; }

/* the stone base the gate stands on */
.rev-plinth {
  height: 14px;
  margin: 0 -12px;
  background: var(--ink);
  border-top: 3px solid var(--gold);
  border-radius: 3px;
}

/* ---------- one review ---------- */

.rev-slide {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--drop) + 16px) 56px 40px;
}
.rev-body { display: flex; align-items: center; gap: 30px; min-width: 0; max-width: 100%; }
.rev-body.no-photo { max-width: 600px; }

/* ---------- the deck of photos ---------- */

.rev-deckwrap { flex: 0 0 auto; padding-right: 54px; padding-top: 14px; }
.rev-deck { position: relative; width: 206px; aspect-ratio: 4 / 5; }
.rev-deck.is-deck { cursor: pointer; }
.rev-deck:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 6px; border-radius: 8px; }

.rev-pcard {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  padding: 8px;
  background: var(--surface);
  border: 1.5px solid rgba(194, 161, 94, 0.65);
  border-radius: 8px;
  transition: transform 0.5s var(--ease), opacity 0.4s ease;
  will-change: transform;
}
.rev-pimg {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: var(--lavender);
}
/* photos are shown whole, never cropped */
.rev-pimg img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }

/* ---------- the words ---------- */

.rev-text { margin: 0; position: relative; min-width: 0; }
.rev-text::before {
  content: "\201C";
  display: block;
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 0.7;
  color: var(--rose);
  margin-bottom: 8px;
}
.rev-words {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 1.2vw + 0.6rem, 1.35rem);
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.rev-by { margin-top: 18px; font-family: var(--font-hand); font-size: 1.6rem; color: var(--rose-deep); }

/* ---------- controls ---------- */

.rev-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; }
.rev-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(194, 161, 94, 0.6);
  background: var(--surface);
  color: var(--rose-deep);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease);
}
.rev-arrow:hover { background: var(--rose); transform: translateY(-2px); }
.rev-arrow:focus-visible, .rev-dot:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }

.rev-dots { display: flex; gap: 2px; align-items: center; }
.rev-dot {
  /* 44px touch target around a small diamond */
  width: 28px; height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rev-dot::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--rose);
  transform: rotate(45deg);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.rev-dot[aria-current="true"]::before { background: var(--rani); transform: rotate(45deg) scale(1.35); }
.rev-count { font-family: var(--font-head); font-weight: 700; font-size: 0.9rem; color: var(--rose-deep); min-width: 56px; text-align: center; }

/* ---------- call to action ---------- */

.rev-cta { text-align: center; margin-top: 42px; }
.rev-fallback { margin: 14px auto 0; max-width: 460px; font-size: 0.92rem; color: var(--ink-soft); }
.rev-fallback a { text-decoration: underline; text-underline-offset: 3px; }
.rev-empty { margin: 0 auto 22px; max-width: 460px; color: var(--ink-soft); }

/* ---------- phones: a narrow gate, kept short ----------
   The gate is as tall as its longest review, so on a phone every size here counts: smaller text,
   a smaller photo deck and tighter gaps keep the jharokha well under one screen. */

.rev-rig.is-phone { --drop: 58px; }
.rev-rig.is-phone .rev-slide { padding: calc(var(--drop) + 8px) 22px 22px; }
.rev-rig.is-phone .rev-body { flex-direction: column; gap: 12px; text-align: left; }
.rev-rig.is-phone .rev-deckwrap { padding-right: 30px; padding-top: 4px; }
.rev-rig.is-phone .rev-deck { width: min(140px, 42vw); }
.rev-rig.is-phone .rev-text::before { font-size: 2.6rem; margin-bottom: 4px; }
.rev-rig.is-phone .rev-words { font-size: 0.875rem; line-height: 1.5; }
.rev-rig.is-phone .rev-by { font-size: 1.2rem; margin-top: 8px; }
.rev-rig.is-phone .rev-slide .rev-text { align-self: stretch; }

@media (max-width: 760px) {
  .rev { margin-top: 70px; }
}

/* ---------- reduced motion: gate stays open, photos change without sliding ---------- */

@media (prefers-reduced-motion: reduce) {
  .rev-track, .rev-pcard { transition: none; }
}
