/* =================================================================
   Miriam Imbrogno — pages/cinema.css
   Dark, cinematic. Dipende da main.css + components.css + servizi.css
   ================================================================= */

/* ---- HERO DARK ------------------------------------------- */
.cinema-hero {
  background: #111;
  color: #fff;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Film grain overlay */
.cinema-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

.cinema-hero__inner {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: var(--space-7);
  padding-top: 7rem;
  padding-bottom: var(--space-7);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .cinema-hero__inner {
    grid-template-columns: 1fr minmax(0, 460px);
    gap: var(--space-9);
    padding-bottom: var(--space-8);
  }
}

.cinema-hero__content { position: relative; z-index: 1; }

.cinema-hero__script {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.cinema-hero__script::before {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Titolo con glitch intermittente */
.cinema-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: #fff;
  margin-bottom: var(--space-5);
  animation: cinema-glitch 18s step-end infinite;
}

@keyframes cinema-glitch {
  0%, 84%, 100% { text-shadow: none; transform: none; }
  84.5% {
    text-shadow: -4px 0 rgba(255, 0, 80, 0.55),
                  4px 0 rgba(0, 190, 255, 0.55);
    transform: skewX(-1.5deg) translateX(3px);
  }
  85.5% {
    text-shadow: 3px 0 rgba(255, 0, 80, 0.35),
                -3px 0 rgba(0, 190, 255, 0.35);
    transform: translateX(-2px);
  }
  87% { text-shadow: none; transform: none; }
  91% {
    text-shadow: 2px 0 rgba(255, 0, 80, 0.22);
    transform: skewX(0.4deg);
  }
  91.5% { text-shadow: none; transform: none; }
}

.cinema-hero__text {
  color: rgba(255, 255, 255, 0.6);
  max-width: 44ch;
  margin-bottom: var(--space-6);
}

/* Ciak decorativo di sfondo */
.cinema-ciak {
  position: absolute;
  right: -2%;
  top: 50%;
  transform: translateY(-50%);
  width: min(52vw, 580px);
  height: auto;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}
@media (max-width: 767px) {
  .cinema-ciak {
    right: -8%;
    top: auto;
    bottom: 10%;
    transform: none;
    width: 80vw;
    opacity: 0.6;
  }
}

/* Numero di scena in angolo */
.cinema-scene-no {
  position: absolute;
  bottom: var(--space-4);
  right: 0;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: rgba(223, 186, 159, 0.2);
  text-transform: uppercase;
  font-family: var(--font-sans);
  writing-mode: vertical-rl;
  user-select: none;
}

/* Foto hero con offset cipria */
.cinema-hero__media {
  position: relative;
  order: -1;
}
@media (min-width: 768px) { .cinema-hero__media { order: 0; } }

.cinema-hero__media::before {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  background: rgba(223, 186, 159, 0.07);
  border-radius: var(--radius-lg);
  z-index: 0;
}
.cinema-hero__media img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
  max-height: 80svh;
  object-fit: cover;
}

/* ---- MARQUEE --------------------------------------------- */
.cinema-ticker {
  background: #0a0a0a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.9rem 0;
  overflow: hidden;
  user-select: none;
  position: relative;
  z-index: 1;
}
.cinema-ticker__track {
  display: flex;
  width: max-content;
  animation: cinema-scroll 30s linear infinite;
}
.cinema-ticker__seg {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-right: var(--space-4);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: rgba(223, 186, 159, 0.80);
  text-transform: uppercase;
  white-space: nowrap;
  font-style: italic;
}
.cinema-ticker__dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
}
@keyframes cinema-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- SEZIONE "LA MAGIA" ---------------------------------- */
.cinema-h2 {
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-3);
}
.cinema-h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 2.2rem; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Bottone "Vedi tutti i lavori cinema" — su sfondo crema, serve contrasto scuro */
.set-cta .btn--outline {
  color: var(--color-text);
  border-color: var(--color-text);
}
.set-cta .btn--outline:hover {
  background: var(--color-text);
  color: var(--color-cream);
}

/* ---- FILMSTRIP (Momenti di set) -------------------------- */
.cinema-reel {
  background: #050505;
  overflow: hidden;
  position: relative;
  padding: 38px 0;
}

/* Perforazioni pellicola — visibili + sincronizzate col filmroll */
.cinema-reel__perfs {
  position: absolute;
  left: 0; right: 0;
  height: 38px;
  z-index: 2;
  pointer-events: none;
  background-color: #0d0d0d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='38'%3E%3Crect x='9' y='7' width='34' height='24' rx='5' fill='%23484848' stroke='%23606060' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 52px 38px;
  background-repeat: repeat-x;
  /* 0.82s ≈ 52px / 63px·s⁻¹ (velocità media del filmroll a ~260px/frame) */
  animation: perf-scroll 0.82s linear infinite;
}
.cinema-reel__perfs--top { top: 0; }
.cinema-reel__perfs--bot { bottom: 0; }

@keyframes perf-scroll {
  from { background-position-x: 0; }
  to   { background-position-x: -52px; }
}

/* Striscia che scorre */
.cinema-reel__track {
  display: flex;
  gap: 6px;
  width: max-content;
  animation: filmroll 55s linear infinite;
}

/* Pausa hover: ferma sia le foto sia le perforazioni */
.cinema-reel:hover .cinema-reel__track,
.cinema-reel:hover .cinema-reel__perfs {
  animation-play-state: paused;
}

@keyframes filmroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.cinema-reel__frame {
  flex-shrink: 0;
  width: clamp(180px, 22vw, 300px);
  aspect-ratio: 4/3;
  overflow: hidden;
}
.cinema-reel__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.75) brightness(0.88);
  transition: filter 0.45s, transform 0.55s var(--ease);
}
.cinema-reel__track:hover .cinema-reel__frame:hover img {
  filter: saturate(1) brightness(1);
  transform: scale(1.06);
}

/* ---- EFFETTI SPECIALI — dark section --------------------- */
.cinema-sfx {
  background: #0f0f0f;
  color: #fff;
  padding: var(--space-9) 0;
}
.cinema-sfx .section-head .eyebrow { color: var(--accent); opacity: 1; }
.cinema-sfx .section-head h2 { color: #fff; }
.cinema-sfx .divider { background: rgba(255, 255, 255, 0.3); }

.cinema-sfx__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  margin-top: var(--space-7);
}
@media (min-width: 900px) {
  .cinema-sfx__layout {
    grid-template-columns: 36% 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.cinema-sfx__text p { color: var(--color-sand); }
.cinema-sfx__text p + p { margin-top: var(--space-4); }

/* Griglia 3×2 foto — effetto polaroid sparpagliate */
.cinema-sfx__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cinema-sfx__item {
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 3/4;
  position: relative;
  z-index: 1;
  /* Rotazioni individuali via custom property */
  transform: rotate(var(--rot, 0deg));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.45s var(--ease), box-shadow 0.45s, z-index 0s 0.5s;
}

/* Rotazioni polaroid */
.cinema-sfx__item:nth-child(1) { --rot: -1.8deg; }
.cinema-sfx__item:nth-child(2) { --rot:  0.9deg; }
.cinema-sfx__item:nth-child(3) { --rot: -0.6deg; }
.cinema-sfx__item:nth-child(4) { --rot:  1.4deg; }
.cinema-sfx__item:nth-child(5) { --rot: -1.1deg; }
.cinema-sfx__item:nth-child(6) { --rot:  0.7deg; }

.cinema-sfx__item:hover {
  transform: rotate(0deg) translateY(-16px) scale(1.06);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.85);
  z-index: 3;
  transition: transform 0.45s var(--ease), box-shadow 0.45s, z-index 0s 0s;
}

.cinema-sfx__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) saturate(0.7);
  transition: filter 0.5s;
}
.cinema-sfx__item:hover img {
  filter: brightness(1) saturate(1);
}

/* ---- TESTIMONIAL ----------------------------------------- */
.cinema-quote {
  padding: var(--space-8) 0;
  text-align: center;
}
.cinema-quote__mark {
  display: block;
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 0.6;
  color: var(--accent);
  opacity: 0.35;
  margin-bottom: var(--space-3);
  user-select: none;
}
.cinema-quote blockquote {
  max-width: 56ch;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--color-text);
}
.cinema-quote cite {
  display: block;
  margin-top: var(--space-4);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-nude-dark);
  font-style: normal;
}

/* ---- reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cinema-ticker__track,
  .cinema-reel__track,
  .cinema-reel__perfs { animation: none; }
  .cinema-hero__title { animation: none; }
  .cinema-reel__frame img,
  .cinema-sfx__item img { transition: none; }
  .cinema-sfx__item { transform: none !important; }
}
