/* ==========================================================================
   MANSHUR LANDING - TWO-COLUMN EDITORIAL GRID & PRESENTATION STAGE
   Strict implementation: Peyda font everywhere, zero live blur / backdrop-filter,
   ruler divider, peeking slides (opacity 0.35), window titlebar, status line,
   thumbnail rail, watermark numbers & chips.
   ========================================================================== */

/* ── Top Bar Brand Header ── */
.global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--m-paper);
  border-bottom: 1px solid var(--m-border-subtle);
  z-index: 100;
  direction: rtl;
  font-family: 'Peyda', system-ui, sans-serif;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-wrap img {
  width: 28px;
  height: 28px;
  border-radius: var(--m-radius-sm);
  object-fit: contain;
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--m-ink);
  font-family: 'Peyda', system-ui, sans-serif;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--m-muted);
  font-weight: 500;
  font-family: 'Peyda', system-ui, sans-serif;
}

.header-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--m-radius-pill);
  background: var(--brand-orange-500);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: 'Peyda', system-ui, sans-serif;
}

.header-cta-btn:hover {
  transform: translateY(-1px);
  background: var(--brand-rust-600);
}

/* ── Main Two-Column Grid ── */
.landing-grid {
  display: grid;
  grid-template-columns: minmax(320px, 37.2%) 1fr;
  min-height: 100vh;
  direction: ltr; /* Fixed column positioning */
  position: relative;
  background-color: var(--brand-cream-50);
  background-image: radial-gradient(circle, rgba(var(--brand-charcoal-900-rgb), 0.08) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

/* ── Left Column: Sticky Narrative Panel ── */
.left-column {
  position: sticky;
  top: 0;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  padding: 64px 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  direction: rtl; /* Persian content inside */
  z-index: 20;
}

.panels-stack {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 540px;
}

.narrative-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease;
  will-change: transform, opacity;
}

.narrative-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Faint Watermark Number Behind Headline */
.panel-watermark-num {
  position: absolute;
  top: -24px;
  right: -12px;
  font-size: 8.5rem;
  font-weight: 900;
  color: var(--m-accent);
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  font-family: 'Peyda', system-ui, sans-serif;
}

/* Panel Chip */
.panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--m-accent);
  background: var(--m-accent-light);
  border: 1px solid var(--m-accent-border);
  padding: 3px 12px;
  border-radius: var(--m-radius-pill);
  margin-bottom: 12px;
  align-self: flex-start;
  position: relative;
  z-index: 1;
  font-family: 'Peyda', system-ui, sans-serif;
}

/* Panel Internal Elements */
.panel-number {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--m-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
  font-family: 'Peyda', system-ui, sans-serif;
}

.panel-headline {
  font-size: clamp(2rem, 2.7vw, 2.85rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--m-ink);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  font-family: 'Peyda', system-ui, sans-serif;
}

.panel-sentence {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--m-muted);
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
  font-family: 'Peyda', system-ui, sans-serif;
}

.panel-micro-anim {
  width: 100%;
  background: var(--m-card);
  border: 1px solid var(--m-accent-border);
  border-radius: var(--m-radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ── Middle Divider: Dashed Cutting Line with Ruler Ticks & Spinning Scissors ── */
.column-divider {
  position: absolute;
  left: 37.2%;
  top: 0;
  bottom: 0;
  width: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 25;
}

.divider-ruler-svg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 14px;
  height: 100%;
}

.divider-dashed-line {
  stroke: var(--m-accent);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  animation: scrollDash 2s linear infinite;
  will-change: stroke-dashoffset;
}

@keyframes scrollDash {
  to {
    stroke-dashoffset: -24px;
  }
}

@supports (animation-timeline: scroll()) {
  .divider-dashed-line {
    animation: scrollDash linear;
    animation-timeline: scroll();
  }
}

.divider-scissors {
  position: sticky;
  top: 50vh;
  transform: translateY(-50%) rotate(0deg);
  font-size: 1.25rem;
  color: var(--m-accent);
  background: var(--m-paper);
  padding: 4px;
  border-radius: 50%;
  border: 1px solid var(--m-accent-border);
  box-shadow: var(--shadow-subtle);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: rotateScissors 12s linear infinite;
  will-change: transform;
}

@keyframes rotateScissors {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* ── Right Column: Vertical Slides ── */
.right-column {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* Prevents flex/grid blowout */
  min-height: 100vh;
  direction: ltr; /* Outer container stays LTR */
  padding: 1.5vh 0; /* padding کلی ستون راست بیشتر از 2vh 2vw نباشد */
  box-sizing: border-box;
}

.slide-section {
  height: 100dvh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2px 0 8px; /* 8px on left near divider, 2px on right */
  scroll-snap-align: center;
  scroll-snap-stop: always;
  content-visibility: auto; /* High performance for offscreen slides */
  contain-intrinsic-size: 100vh;
  position: relative;
  box-sizing: border-box;
}

/* Mobile short caption (hidden on desktop, visible on mobile) */
.mobile-slide-caption {
  display: none;
}

/* ── Stage Wrapper & Layout ── */
.slide-stage-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}

/* ── Thumbnail Rail beside Card (PowerPoint Style) ── */
.slide-thumbnail-rail {
  position: absolute;
  right: 8px; /* Floating on right margin */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px 3px;
  background: rgba(var(--brand-sand-100-rgb), 0.9);
  border: 1px solid var(--m-border-subtle);
  border-radius: var(--m-radius-md);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(var(--brand-charcoal-900-rgb), 0.05);
}

.thumb-rail-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thumb-item {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 3px;
  border-radius: 4px;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  font-family: 'Peyda', system-ui, sans-serif;
  outline: none;
}

.thumb-item:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.5);
}

.thumb-item.is-active {
  border-color: var(--brand-orange-500);
  background: var(--m-accent-light);
}

.thumb-idx {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--m-muted);
  min-width: 12px;
  text-align: center;
  font-family: 'Peyda', system-ui, sans-serif;
}

.thumb-item.is-active .thumb-idx {
  color: var(--brand-orange-500);
}

.thumb-canvas {
  width: 22px;
  height: 12px;
  background: #ffffff;
  border: 1px solid var(--m-muted-light);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.thumb-item.is-active .thumb-canvas {
  border-color: var(--brand-orange-500);
  background: rgba(var(--brand-sand-100-rgb), 0.45);
}

.thumb-c8 {
  background: var(--brand-charcoal-900);
  border-color: #4A403A;
}

/* ── Main Presentation Deck Stage ── */
.slide-deck-stage {
  position: relative;
  width: min(100%, calc((100dvh - 8vh) * 16 / 9));
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ── Peeking Previous & Next Slide Edges (opacity: 0.35) ── */
.slide-peek {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  height: 24px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 1;
}

.slide-peek-prev {
  top: -14px;
}

.slide-peek-next {
  bottom: 24px;
}

.peek-card {
  width: 100%;
  height: 100%;
  background: var(--m-card);
  border: 1px solid var(--m-border-subtle);
  border-radius: var(--m-radius-md);
  box-shadow: 0 2px 8px rgba(var(--brand-charcoal-900-rgb), 0.04);
}

#slide-8 .peek-card {
  background: var(--brand-charcoal-900);
  border-color: #4A403A;
}

/* ── Window Titlebar with 3 dots and pitch-deck.pptx ── */
.slide-window-titlebar {
  width: 100%;
  height: 30px;
  background: var(--m-paper-dark);
  border: 1px solid var(--m-accent-border);
  border-bottom: none;
  border-radius: var(--m-radius-md) var(--m-radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  direction: ltr; /* Window controls on left */
  font-family: 'Peyda', system-ui, sans-serif;
  box-sizing: border-box;
  z-index: 4;
}

.window-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.w-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.w-dot-close { background: #ef4444; }
.w-dot-min { background: #f59e0b; }
.w-dot-max { background: #10b981; }

.window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--m-ink);
  font-family: 'Peyda', system-ui, sans-serif;
}

.window-pptx-icon {
  color: var(--m-accent);
}

.window-filename {
  font-family: 'Peyda', system-ui, sans-serif;
  letter-spacing: 0.02em;
}

.window-meta {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--m-muted);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--m-border-subtle);
  padding: 1px 8px;
  border-radius: var(--m-radius-pill);
  font-family: 'Peyda', system-ui, sans-serif;
}

#slide-8 .slide-window-titlebar {
  background: var(--brand-charcoal-900);
  border-color: #4A403A;
}

#slide-8 .window-title {
  color: var(--brand-cream-50);
}

#slide-8 .window-meta {
  background: rgba(255, 255, 255, 0.1);
  border-color: #4A403A;
  color: var(--brand-sand-100);
}

/* ── 16:9 Slide Card ── */
.slide-card {
  aspect-ratio: 16 / 9;
  width: 100%;
  margin: 0 auto;
  background: var(--m-card);
  border-radius: 0 0 var(--m-radius-md) var(--m-radius-md);
  border: 1px solid var(--m-accent-border);
  box-shadow: 0 16px 36px rgba(var(--brand-charcoal-900-rgb), 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 48px 24px 32px;
  direction: rtl; /* Persian content inside slide */
  position: relative;
  box-sizing: border-box;
  z-index: 3;
}

/* Dark variant for Slide 8 (or dark preview) */
.slide-card.slide-dark {
  background: var(--m-dark);
  color: var(--m-dark-text);
  border-color: #4A403A;
}

/* Slide Top Header Bar */
.slide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--m-border-subtle);
  margin-bottom: 12px;
  font-family: 'Peyda', system-ui, sans-serif;
}

.slide-card.slide-dark .slide-card-header {
  border-bottom-color: var(--m-dark-border);
}

.slide-card-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-orange-500);
  background: var(--m-accent-light);
  border: 1px solid var(--brand-clay-300);
  padding: 2px 8px;
  border-radius: var(--m-radius-pill);
  font-family: 'Peyda', system-ui, sans-serif;
}

.slide-card.slide-dark .slide-card-tag {
  background: rgba(var(--brand-clay-300-rgb), 0.2);
  border-color: rgba(var(--brand-clay-300-rgb), 0.45);
  color: var(--brand-clay-300);
}

.slide-card-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--m-muted);
  font-family: 'Peyda', system-ui, sans-serif;
}

.slide-card.slide-dark .slide-card-num {
  color: var(--m-dark-muted);
}

/* Slide Bottom Footer Bar */
.slide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--m-border-subtle);
  font-size: 0.74rem;
  color: var(--m-muted);
  margin-top: auto;
  font-family: 'Peyda', system-ui, sans-serif;
}

.slide-card.slide-dark .slide-card-footer {
  border-top-color: var(--m-dark-border);
  color: var(--m-dark-muted);
}

/* ── Soft Radial-Gradient Shadow Under Card ── */
.slide-ground-shadow {
  width: 88%;
  height: 16px;
  margin: 4px auto 0;
  background: radial-gradient(ellipse at center, rgba(var(--brand-charcoal-900-rgb), 0.16) 0%, rgba(var(--brand-charcoal-900-rgb), 0.04) 50%, transparent 75%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* ── Status Bar Under Card: اسلاید X از ۸ · قابل ویرایش در PowerPoint ── */
.slide-status-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 0;
  direction: rtl;
  font-family: 'Peyda', system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--m-muted);
  font-weight: 600;
  box-sizing: border-box;
  z-index: 4;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Peyda', system-ui, sans-serif;
}

.status-slide-idx {
  color: var(--m-ink);
  font-weight: 700;
  font-family: 'Peyda', system-ui, sans-serif;
}

.status-sep {
  color: var(--m-muted-light);
}

.status-editable-badge {
  color: var(--brand-orange-500);
  background: var(--m-accent-light);
  border: 1px solid var(--brand-clay-300);
  padding: 1px 10px;
  border-radius: var(--m-radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  font-family: 'Peyda', system-ui, sans-serif;
}

.status-format {
  font-size: 0.72rem;
  color: var(--m-muted);
  font-family: 'Peyda', system-ui, sans-serif;
}

#slide-8 .status-slide-idx {
  color: var(--brand-cream-50);
}

#slide-8 .status-editable-badge {
  background: rgba(var(--brand-clay-300-rgb), 0.2);
  border-color: rgba(var(--brand-clay-300-rgb), 0.45);
  color: var(--brand-clay-300);
}

/* ── Mobile Responsive Rules (Under 800px) ── */
@media (max-width: 800px) {
  .landing-grid {
    display: flex;
    flex-direction: column;
    direction: rtl;
  }

  .left-column {
    display: none !important;
  }

  .column-divider {
    display: none !important;
  }

  .slide-thumbnail-rail {
    display: none !important;
  }

  .slide-peek {
    display: none !important;
  }

  .right-column {
    direction: rtl;
    width: 100%;
    padding: 0;
  }

  .slide-section {
    height: auto;
    min-height: 100dvh;
    min-height: 100vh;
    padding: 64px 16px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
  }

  .mobile-slide-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 760px;
    margin-bottom: 12px;
    padding: 0 4px;
    direction: rtl;
    text-align: right;
  }

  .mobile-caption-tag {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--m-accent);
  }

  .mobile-caption-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--m-ink);
  }

  .mobile-caption-desc {
    font-size: 0.84rem;
    color: var(--m-muted);
    line-height: 1.5;
  }

  .slide-deck-stage {
    width: 100%;
    max-width: 760px;
  }

  .slide-window-titlebar {
    border-radius: var(--m-radius-sm) var(--m-radius-sm) 0 0;
    height: 26px;
    padding: 0 10px;
  }

  .slide-card {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: none;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}
