/* =========================================================
   UGC.CSS — UGC video carousel (9:16 vertical, full-bleed)
   ========================================================= */

.ugc {
  padding: clamp(2.75rem, 5vw, 4rem) 0;
}

/* Heading stays aligned with the site's main content container */
.ugc-head {
  max-width: var(--container);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.ugc-head .section-head {
  margin-bottom: 0;
}

/* ---- Our process (above the videos) ---- */
.ugc-process {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  max-width: var(--container);
  margin: 0 auto 1rem;
  padding: 0 1.5rem;
}

.process-step {
  flex: 1 1 150px;
  max-width: 220px;
  text-align: center;
}

.process-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: var(--border-1);
  color: var(--green-dark);
  font-size: 1.5rem;
  box-shadow: var(--shadow-2);
  margin-bottom: 0.75rem;
}

.process-name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
}

.process-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.process-arrow {
  color: var(--green-dark);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.ugc-process-note {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 2rem;
}

@media (max-width: 640px) {
  .ugc-process {
    gap: 0.75rem;
  }
  .process-step {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .process-arrow {
    transform: rotate(90deg);
  }
}

/* Full-bleed viewport with subtle edge-only fade (same as projects) */
.ugc-bleed {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  padding: 0.5rem 0 1.25rem;
  margin: -0.5rem 0 -1.25rem;
}

/* Track: first card aligns with the main container left edge */
.ugc-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: calc(max((100% - var(--container)) / 2, 0px) + 1.5rem);
  padding-inline: calc(max((100% - var(--container)) / 2, 0px) + 1.5rem);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ugc-track::-webkit-scrollbar {
  display: none;
}

/* ---- Card: 9:16 vertical ---- */
.ugc-card {
  position: relative;
  flex: 0 0 auto;
  width: min(300px, 62vw);
  aspect-ratio: 9 / 16;
  border-radius: clamp(14px, 2vw, 20px);
  overflow: hidden;
  scroll-snap-align: start;
  background: linear-gradient(160deg, var(--green-light), var(--navy-light));
  box-shadow: 0 18px 45px -18px rgba(14, 17, 22, 0.45);
}

.ugc-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

/* ---- Loading skeleton ----
   The card keeps its brand-gradient background with a light sweep
   travelling across it until the video has a frame to show.
   State classes (is-loading -> is-ready) are applied by js/main.js. */
.ugc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  background-size: 220% 100%;
  animation: ugc-shimmer 1.4s linear infinite;
  transition: opacity 0.45s var(--ease);
}

/* Sweep stops and the video fades in */
.ugc-card.is-ready::before {
  opacity: 0;
  animation: none;
}

.ugc-card.is-ready video {
  opacity: 1;
}

/* If a clip 404s, stop sweeping and leave a flat placeholder rather
   than shimmering forever, promising content that will never arrive. */
.ugc-card.is-error::before {
  animation: none;
  opacity: 0;
  background: rgba(25, 40, 60, 0.06);
}

.ugc-card.is-error video {
  display: none;
}

@keyframes ugc-shimmer {
  from { background-position: 150% 0; }
  to   { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ugc-card::before {
    animation: none;
    background: rgba(255, 255, 255, 0.25);
  }
}

/* CTA row */
.ugc-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding: 0 1.5rem;
}

/* ---- Listing page variant (UGC videos page) ---- */
.ugc-page .ugc-head {
  padding-top: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2rem;
}

/* Tighter heading line spacing on the listing page */
.ugc-page .section-title {
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.ugc-page .section-sub {
  margin-top: 0.45rem;
  line-height: 1.5;
}

.ugc-grid-page {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.ugc-grid-page .ugc-card {
  width: 100%;
  scroll-snap-align: none;
}

/* NOTE: the .ugc-caption / .ugc-brand / .ugc-sub overlay styles were
   removed along with the old caption markup. Each clip now has no
   text overlay — the video fills the card on its own. */

@media (max-width: 900px) {
  .ugc-grid-page {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 560px) {
  .ugc-grid-page {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}
