/* ─────────────────────────────────────────────────────────────────
   CIVIC PAVILION · CAROUSEL STORY
   Shared layout for all 3 article carousels (01 emotions, 02 maps,
   03 taylor). Each carousel index.html sets its own palette via
   CSS variables on .story, then drops in slide content.
   ──────────────────────────────────────────────────────────────── */

:root {
  --story-cream: #F4ECD8;
  --story-cream-soft: #FAF4E5;
  --story-burgundy: #7A1F1F;
  --story-frame: #1A1818;
  --story-accent-blue: #1F718C;
  --story-accent-amber: #D9A92A;
  --story-paper: #EFE4CB;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Heebo', sans-serif;
  background: var(--story-paper);
  color: var(--story-frame);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ─── STORY FRAME (4:5 stage centered on page) ─── */

.story {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: var(--story-cream);
  box-shadow: 0 20px 60px rgba(26, 24, 24, 0.22), 0 4px 12px rgba(26, 24, 24, 0.10);
  user-select: none;
  touch-action: pan-y;
}

@media (min-width: 900px) {
  .story { max-width: 560px; }
}

/* ─── SLIDES (one per frame, hidden until active) ─── */

.story-track {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  display: flex;
  flex-direction: column;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.slide.image-slide {
  background-size: cover;
  background-position: center;
}

.slide.cream-slide {
  background: var(--story-cream);
}

/* ─── PROGRESS TRACK (Instagram-Story bars) ─── */

.progress-track {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.progress-bar {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(122, 31, 31, 0.20);
  overflow: hidden;
  cursor: pointer;
}

.progress-bar .fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--story-burgundy);
  border-radius: 2px;
  transition: width 220ms ease;
}

.progress-bar.full .fill { width: 100%; }

/* "next" bar blinks subtly to invite progression */
.progress-bar.is-next .fill {
  animation: blink-next 1.7s ease-in-out infinite;
}

@keyframes blink-next {
  0%, 100% { width: 0; }
  50%      { width: 35%; }
}

/* On burgundy slides (the bibliography), bars switch to cream */
.progress-track.on-burgundy .progress-bar {
  background: rgba(244, 236, 216, 0.22);
}
.progress-track.on-burgundy .progress-bar .fill {
  background: var(--story-cream);
}

/* ─── OPENING / CONTENT SLIDE (image bg + Hebrew overlay) ─── */

.slide.image-slide::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 56%;
  background: linear-gradient(
    to bottom,
    rgba(244, 236, 216, 0.97) 0%,
    rgba(244, 236, 216, 0.92) 55%,
    rgba(244, 236, 216, 0) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.slide-text {
  position: relative;
  padding: 11% 8% 0 8%;
  z-index: 2;
}

.slide-eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--story-burgundy);
  opacity: 0.9;
  margin-bottom: 14px;
}

.slide-hook {
  font-size: clamp(18px, 4.2vw, 26px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--story-frame);
  letter-spacing: -0.005em;
}

.slide-hook strong {
  font-weight: 900;
  color: var(--story-burgundy);
}

.slide-corner {
  position: absolute;
  bottom: 5%;
  right: 6%;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--story-cream);
  background: rgba(26, 24, 24, 0.55);
  padding: 6px 12px;
  border-radius: 2px;
  font-weight: 500;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* ─── BIBLIOGRAPHY / CLOSING SLIDE ─── */

.slide.cream-slide {
  padding: 12% 8% 8% 8%;
}

.closing-eyebrow {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--story-burgundy);
  margin-top: 30px;
}

.closing-title {
  margin-top: 16px;
  font-size: clamp(22px, 5.5vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--story-frame);
  letter-spacing: -0.02em;
}

.closing-subtitle {
  margin-top: 10px;
  font-size: clamp(13px, 2.8vw, 17px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--story-frame);
  opacity: 0.75;
}

.closing-meta {
  margin-top: 22px;
  font-size: clamp(12px, 2.4vw, 15px);
  font-weight: 500;
  color: var(--story-accent-blue);
  letter-spacing: 0.5px;
}

.closing-quote {
  margin-top: 26px;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--story-frame);
  opacity: 0.7;
  border-right: 2px solid var(--story-burgundy);
  padding-right: 14px;
}

.closing-cta {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.closing-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--story-burgundy);
  color: var(--story-cream);
  padding: 11px 20px;
  border-radius: 2px;
  text-decoration: none;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.closing-button:hover { opacity: 0.85; }

.closing-button .arrow {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

.closing-brand {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--story-frame);
  opacity: 0.55;
  font-weight: 500;
}

/* ─── RED BIBLIOGRAPHY SLIDE (burgundy bg + logo circle) ─── */

.slide.red-slide {
  background: var(--story-burgundy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10% 8%;
}

.red-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.logo-circle {
  width: clamp(110px, 26%, 150px);
  aspect-ratio: 1 / 1;
  background: var(--story-cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4%;
}

.logo-circle img {
  width: 95%;
  height: auto;
  display: block;
  transform: translateY(8%);  /* arch silhouette sits low — visually re-center */
}

.red-title {
  font-family: 'Karantina', 'Heebo', sans-serif;
  font-weight: 700;
  font-size: clamp(44px, 11vw, 76px);
  color: var(--story-cream);
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin: 8px 0 4px;
}

.red-subtitle {
  font-family: 'Heebo', sans-serif;
  font-weight: 300;
  font-size: clamp(13px, 2.8vw, 17px);
  color: var(--story-cream);
  line-height: 1.55;
  max-width: 90%;
  opacity: 0.92;
}

.red-link {
  margin-top: 14px;
  font-family: 'Heebo', sans-serif;
  font-weight: 500;
  font-size: clamp(13px, 2.7vw, 16px);
  color: var(--story-cream);
  text-decoration: none;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(244, 236, 216, 0.55);
  transition: border-color 0.2s;
}

.red-link:hover { border-bottom-color: var(--story-cream); }

.red-link .arrow {
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.2s;
}

.red-link:hover .arrow { transform: translateX(-3px); }

.red-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  justify-content: center;
  margin-top: 14px;
}

.red-links-row .red-link { margin-top: 0; }

/* ─── TAP ZONES (left = prev / right = next, RTL adjusted) ─── */

.tap-zone {
  position: absolute;
  top: 50px;
  bottom: 0;
  width: 35%;
  z-index: 4;
  cursor: pointer;
}

.tap-prev { right: 0; }   /* RTL: tapping right side goes back */
.tap-next { left: 0; }    /* RTL: tapping left side advances */

/* ─── LTR overrides (English) ───
   Mirror tap zones, corner chip, quote border, and red-link arrow
   so the visual flow matches LTR reading expectations. */
html[dir="ltr"] .tap-prev { right: auto; left: 0; }
html[dir="ltr"] .tap-next { left: auto; right: 0; }
html[dir="ltr"] .slide-corner { right: auto; left: 6%; }
html[dir="ltr"] .closing-quote {
  border-right: none;
  border-left: 2px solid var(--story-burgundy);
  padding-right: 0;
  padding-left: 14px;
}
html[dir="ltr"] .red-link .arrow { margin-right: 0; margin-left: 6px; }
html[dir="ltr"] .red-link:hover .arrow { transform: translateX(3px); }
