/* =============================================================================
   AdStar landing — examples.css
   Full-bleed horizontal marquee strip of example ad creatives.
   ========================================================================== */

.examples {
  /* Strip sits tight under the hero; override the section's default rhythm. */
  padding-block: 0 60px;
  /* Clip the full-bleed track, but allow the hover ring/scale to breathe
     vertically (overflow:hidden would cut the lime border top & bottom).
     The extra horizontal bleed falls in the mask's transparent edge zone. */
  overflow: clip;
  overflow-clip-margin: 24px;
}
@media (max-width: 1024px) { .examples { padding-block: 0 48px; } }
@media (max-width: 767px)  { .examples { padding-block: 0 40px; } }

/* Full-bleed viewport. Left padding aligns the first clip ~120px from the edge
   (roughly content-aligned on a 1440 frame). */
.examples__viewport {
  position: relative;
  width: 100%;
  padding-left: 120px;
  /* Vertical breathing room INSIDE the masked box so the hover ring isn't
     cut by mask-clip (border-box). Negative margin cancels the layout shift,
     so the strip stays put while the mask area grows 20px above & below. */
  padding-block: 20px;
  margin-block: -20px;
  /* fade the right edge so clips bleed off-screen rather than hard-cut */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 120px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 120px), transparent 100%);
}

/* The moving track. JS duplicates the clip set and drives the transform. */
.examples__track {
  display: flex;
  align-items: center;
  gap: 24px;
  width: max-content;
  will-change: transform;
  touch-action: pan-y;          /* allow vertical page scroll; JS owns horizontal */
}
/* While JS controls the loop, suppress text selection / image drag ghosts. */
.examples__track,
.examples__track * { user-select: none; -webkit-user-drag: none; }

/* ---- Clip --------------------------------------------------------------- */
.examples__clip {
  position: relative;
  flex: 0 0 auto;
  height: 300px;
  width: var(--clip-w, 300px);
  border-radius: var(--radius-sm);
}

.examples__open {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  outline: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out);
}

.examples__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  pointer-events: none;
}

/* ---- Expand affordance (hidden until hover/focus) ----------------------- */
.examples__expand {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;                 /* Figma: rounded-[4px] */
  background: var(--gray-800);        /* Figma: #242424 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px) scale(0.9);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
  pointer-events: none;
}
.examples__open:hover .examples__expand { background: var(--gray-750); }
.examples__expand img { width: 16px; height: 16px; }

/* ---- Hover / focus emphasis --------------------------------------------- */
@media (hover: hover) {
  .examples__open:hover {
    transform: scale(1.04);
    box-shadow: 0 0 0 2px var(--brand-600),
                var(--shadow-pop);
    z-index: 2;
  }
  .examples__open:hover .examples__expand {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Keyboard focus mirrors hover (and is always reachable on touch). */
.examples__open:focus-visible {
  box-shadow: 0 0 0 2px var(--brand-600), var(--shadow-pop);
}
.examples__open:focus-visible .examples__expand {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Paused state (set by JS while hovering / after tap) keeps the lifted clip
   raised above its neighbours. */
.examples.is-paused .examples__open:hover { z-index: 3; }

/* ---- Reduced motion ------------------------------------------------------ */
/* JS already skips the marquee + autoplay; ensure the strip is simply visible
   and horizontally scrollable as a fallback. */
@media (prefers-reduced-motion: reduce) {
  .examples__viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .examples__open,
  .examples__open:hover { transform: none; }
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .examples__viewport { padding-left: 40px; }
  .examples__clip { height: 240px; }
  /* keep aspect ratios by scaling widths proportionally (×0.8) */
  .examples__clip--16x9 { width: calc(var(--clip-w, 300px) * 0.8); }
  .examples__clip--9x16 { width: calc(var(--clip-w, 168px) * 0.8); }
  .examples__clip--1x1  { width: 240px; }
}
@media (max-width: 767px) {
  .examples__viewport {
    padding-left: var(--gutter-mobile);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
            mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
  }
  .examples__track { gap: 16px; }
  .examples__clip { height: 200px; }
  .examples__clip--16x9 { width: calc(var(--clip-w, 300px) * 0.62); }
  .examples__clip--9x16 { width: calc(var(--clip-w, 168px) * 0.62); }
  .examples__clip--1x1  { width: 200px; }
  .examples__expand { width: 30px; height: 30px; top: 8px; right: 8px; }
  .examples__expand img { width: 16px; height: 16px; }
}
