/* ==========================================================================
   لقطة | LAQTA Studio — Layout CSS (تخطيط المشاهد وهيكل الشاشة السينمائية)
   ========================================================================== */

/* --------------------------------------------------------------------------
   أ) ضبط عناصر التثبيت التلقائية في GSAP والمحتوى الأساسي
   -------------------------------------------------------------------------- */
.pin-spacer {
  box-sizing: border-box;
}

main {
  padding-top: 0;
  position: relative;
  width: 100%;
}

/* --------------------------------------------------------------------------
   ب) حاويات المحتوى (Containers)
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 5rem);
  width: 100%;
}

.container-narrow {
  max-width: 800px;
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 4vw, 3rem);
  width: 100%;
}

.container-fluid {
  width: 100%;
  padding-inline: clamp(1.5rem, 5vw, 5rem);
}

/* --------------------------------------------------------------------------
   ج) تباعد الأقسام الرأسي (Section Spacing)
   -------------------------------------------------------------------------- */
.section-spacer {
  padding-block: clamp(5rem, 10vw, 10rem);
}

.section-spacer-sm {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-spacer-lg {
  padding-block: clamp(7rem, 14vw, 14rem);
}

/* --------------------------------------------------------------------------
   د) القاعدة الأساسية للمشهد السينمائي (Scene Base)
   -------------------------------------------------------------------------- */
.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.scene-inner {
  width: 100%;
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   هـ) أطر المشاهد المثبتة (Pinned Scene Wrappers)
   -------------------------------------------------------------------------- */
.film-reel {
  position: relative;
  height: 500vh;
}

@media (min-width: 901px) {
  .film-reel {
    height: 1000vh;
  }
}

.film-reel-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   و) كادرات بكرة الفيلم (Film Reel Frames - Hard Cut)
   -------------------------------------------------------------------------- */
.reel-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.reel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0ms;
  will-change: opacity;
}

.reel-frame.is-active {
  opacity: 1;
}

.reel-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   ز) مسار السكرول الأفقي (Scene 04 - Horizontal Track)
   -------------------------------------------------------------------------- */
.scene-horizontal {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.scene-horizontal-track {
  display: flex;
  height: 100vh;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   ح) كروت المشاريع الأفقية بنسبة CinemaScope 2.39:1
   -------------------------------------------------------------------------- */
.horizontal-project {
  position: relative;
  flex-shrink: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.horizontal-project-card {
  width: min(85vw, 1400px);
  aspect-ratio: var(--ratio-anamorphic);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.horizontal-project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.horizontal-project-meta {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  text-align: right;
  z-index: 2;
  padding: 1rem 1.25rem;
  background: rgba(10, 10, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 2px solid var(--gold-accent);
  max-width: 60%;
}

.horizontal-project-num {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: var(--font-numeric);
  font-size: 2rem;
  color: var(--gold-accent);
  z-index: 2;
}

/* --------------------------------------------------------------------------
   ط) مشهد الافتتاح الدرامي (Scene 01 - Hero Opening)
   -------------------------------------------------------------------------- */
.scene-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  z-index: 0;
  will-change: transform;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.1) brightness(0.55);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 8, 0.5) 0%,
    rgba(10, 10, 8, 0.2) 40%,
    rgba(10, 10, 8, 0.9) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem;
  max-width: 1200px;
}

.hero-content h1 {
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  color: var(--text-secondary);
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scene-hero .scene-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* --------------------------------------------------------------------------
   ي) مشهد البيان المعماري (Scene 02 - Manifesto)
   -------------------------------------------------------------------------- */
.scene-manifesto {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  transition: background-color var(--duration-mid) var(--ease-cinematic);
}

.manifesto-content {
  max-width: 1100px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.manifesto-text {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  line-height: 1.4;
  font-weight: 400;
  color: var(--text-primary);
}

.scene-manifesto .scene-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

/* --------------------------------------------------------------------------
   ك) مشهد الختام وتتر النهاية (Scene 05 - Closing Credits)
   -------------------------------------------------------------------------- */
.scene-closing {
  position: relative;
  min-height: 100vh;
  padding-top: 10vh;
  padding-bottom: 10vh;
  overflow: visible;
}

.credits-roll {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 900px;
  margin-inline: auto;
  padding: 4rem;
}

.credits-group {
  text-align: center;
}

.credits-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.credits-names {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   ل) التجاوب مع الشاشات الصغيرة (Responsive Adjustments)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .film-reel {
    height: 500vh;
  }

  .horizontal-project {
    padding: 1.5rem;
  }

  .horizontal-project-card {
    width: 90vw;
    aspect-ratio: var(--ratio-widescreen);
  }

  .horizontal-project-meta {
    bottom: 1rem;
    right: 1rem;
  }

  .horizontal-project-num {
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
  }

  .scene-number {
    font-size: clamp(5rem, 15vw, 10rem);
  }

  .manifesto-text {
    font-size: clamp(1.375rem, 5vw, 2rem);
  }

  .hero-content,
  .scene-manifesto,
  .credits-roll {
    padding: 2rem 1.5rem;
  }

  .section-spacer-lg {
    padding-block: clamp(4rem, 8vw, 7rem);
  }
}
