/**
 * Pushing Video Carousel
 * An endless row of portrait video tiles where only the centre one plays, then the row pushes on.
 * Updated: Ample header clearance, theme heading typography & gold badge, 3-card layout, interactive play/pause button & YouTube modal.
 */

.pushing-video-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background-color: #faf9f6; /* warm luxury off-white theme background */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: clamp(6.6rem, 12vh, 8.8rem); /* Completely clears fixed site header */
  padding-bottom: clamp(1.2rem, 2.5vh, 2rem);
}

.pushing-video-header {
  position: relative;
  width: 100%;
  max-width: 920px;
  text-align: center;
  z-index: 10;
  padding: 0 1.5rem;
  margin-bottom: clamp(1rem, 2vh, 1.8rem);
  box-sizing: border-box;
}

.pushing-video-badge-wrap {
  margin-bottom: clamp(0.5rem, 1vh, 0.75rem);
}

.pvc-theme-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans, "Montserrat", sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #a37c44;
  background: rgba(184, 142, 85, 0.1);
  border: 1px solid rgba(184, 142, 85, 0.28);
  padding: 5px 16px;
  border-radius: 100px;
}

.pushing-video-title {
  font-family: var(--font-display, "Montserrat", sans-serif);
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #141518;
  margin: 0 auto;
}

.pushing-video-desc {
  font-family: var(--font-sans, "Montserrat", sans-serif);
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.55;
  color: #63666f;
  max-width: 660px;
  margin: 0.55rem auto 0;
}

/* Gallery Container (full width, overflow hidden) */
.gallery {
  position: relative;
  width: 100vw;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

/* Track (flex row, gap = gutter, translateX(offset)) */
.gallery .track {
  display: flex;
  flex-direction: row;
  align-items: center;
  will-change: transform;
  width: max-content;
  box-sizing: border-box;
}

/* Individual Tile Item (3 visible on desktop) */
.gallery .item {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--pvc-tile-width, 380px);
  box-sizing: border-box;
  will-change: transform;
  transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
  cursor: pointer;
}

.gallery.no-transition .item {
  transition: none !important;
}

/* Numbers: Removed per user instruction */
.gallery .caption {
  display: none !important;
}

/* Frame (8px rounded corners, #14161b background, 3:4 portrait) */
.gallery .frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #14161b;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease;
}

.gallery .frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  pointer-events: none;
  filter: brightness(0.92);
  transition: filter 0.4s ease;
}

.gallery .item:hover .frame video,
.gallery .item.is-playing .frame video {
  filter: brightness(1.0);
}

.gallery .item.is-playing .frame {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

/* Play / Pause Interactive Button in Center */
.pvc-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(18, 20, 26, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease, box-shadow 0.35s ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.gallery .item:hover .pvc-play-btn,
.gallery .item.is-playing .pvc-play-btn {
  transform: translate(-50%, -50%) scale(1.06);
  background: rgba(220, 38, 38, 0.94); /* YouTube Brand Crimson */
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.5);
}

.pvc-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Default state: Play icon is visible */
.pvc-icon-play {
  display: flex;
  margin-left: 2px; /* optical center */
}

.pvc-icon-pause {
  display: none;
}

/* Playing state: Pause icon is visible */
.gallery .item.is-playing .pvc-icon-play {
  display: none;
}

.gallery .item.is-playing .pvc-icon-pause {
  display: flex;
}

/* Bottom Card Overlay with Project Title and YouTube Badge */
.pvc-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.2rem 1.4rem 1.4rem;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 10, 14, 0.88) 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 3;
  pointer-events: none;
}

.pvc-badge-yt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 4px 10px;
  font-family: var(--font-sans, "Montserrat", sans-serif);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  width: fit-content;
  margin-bottom: 0.35rem;
}

.pvc-badge-yt svg {
  color: #ff0000; /* YouTube Red */
}

.pvc-card-title {
  margin: 0;
  font-family: var(--font-display, "Montserrat", sans-serif);
  font-size: clamp(1.15rem, 1.5vw, 1.45rem);
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Load-in animation: rise in 24px -> 0, opacity 0 -> 1 over 700ms */
.gallery .frame {
  opacity: 0;
  transform: translateY(24px);
}

.gallery.is-loaded .frame {
  animation: pvcRiseIn 700ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes pvcRiseIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger 90ms per tile */
.gallery.is-loaded .item:nth-child(1) .frame { animation-delay: 0ms; }
.gallery.is-loaded .item:nth-child(2) .frame { animation-delay: 90ms; }
.gallery.is-loaded .item:nth-child(3) .frame { animation-delay: 180ms; }
.gallery.is-loaded .item:nth-child(4) .frame { animation-delay: 270ms; }
.gallery.is-loaded .item:nth-child(5) .frame { animation-delay: 360ms; }
.gallery.is-loaded .item:nth-child(6) .frame { animation-delay: 450ms; }
.gallery.is-loaded .item:nth-child(7) .frame { animation-delay: 540ms; }
.gallery.is-loaded .item:nth-child(8) .frame { animation-delay: 630ms; }
.gallery.is-loaded .item:nth-child(9) .frame { animation-delay: 720ms; }
.gallery.is-loaded .item:nth-child(10) .frame { animation-delay: 810ms; }

/* Responsive YouTube Video Lightbox Modal */
.pvc-yt-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.pvc-yt-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pvc-yt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.pvc-yt-modal-container {
  position: relative;
  width: 92vw;
  max-width: 980px;
  background: #0f1217;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.85);
  z-index: 2;
  transform: scale(0.93);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pvc-yt-modal.is-active .pvc-yt-modal-container {
  transform: scale(1);
}

.pvc-yt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #14171e;
}

.pvc-yt-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pvc-yt-modal-pill {
  font-family: var(--font-sans, "Montserrat", sans-serif);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ff0000;
  color: #ffffff;
}

.pvc-yt-modal-title {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pvc-yt-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c0c4cc;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pvc-yt-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

.pvc-yt-modal-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.pvc-yt-modal-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Phone Layout */
@media (max-width: 768px) {
  .pushing-video-section {
    padding-top: clamp(5.5rem, 11vh, 7rem);
  }
  .gallery .item {
    width: var(--pvc-tile-width, 280px);
  }
  .pvc-play-btn {
    width: 52px;
    height: 52px;
  }
  .pvc-card-title {
    font-size: 1.1rem;
  }
}
