/* ==================================================================
   Storefront: Video Showcase (template-parts/home-v2/video-showcase.php).
   Per-device values arrive as --vid-*-d / --vid-*-m custom properties on
   the section; phones are below 768px, like the home slider.
   ================================================================== */

.hs-video-section {
  --vid-cols: var(--vid-cols-d);
  --vid-card-w: var(--vid-card-w-d);
  --vid-gap: var(--vid-gap-d);
  --vid-radius: var(--vid-radius-d);
  --vid-ratio: var(--vid-ratio-d);
  --vid-name: var(--vid-name-d);
  --vid-tag: var(--vid-tag-d);
  --vid-avatar: var(--vid-avatar-d);
  --vid-pad-t: var(--vid-pad-t-d);
  --vid-pad-b: var(--vid-pad-b-d);
  padding-top: var(--vid-pad-t);
  padding-bottom: var(--vid-pad-b);
}

@media (max-width: 767px) {
  .hs-video-section {
    --vid-cols: var(--vid-cols-m);
    --vid-card-w: var(--vid-card-w-m);
    --vid-gap: var(--vid-gap-m);
    --vid-radius: var(--vid-radius-m);
    --vid-ratio: var(--vid-ratio-m);
    --vid-name: var(--vid-name-m);
    --vid-tag: var(--vid-tag-m);
    --vid-avatar: var(--vid-avatar-m);
    --vid-pad-t: var(--vid-pad-t-m);
    --vid-pad-b: var(--vid-pad-b-m);
  }
  .hs-video-section.is-hidden-m { display: none; }
  .hs-video-section.is-full-m > .container { max-width: none; padding-inline: 16px; }
  .hs-video-section.is-carousel-m .hs-video__grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hs-video-section.is-carousel-m .hs-video__card {
    flex: 0 0 var(--vid-card-w);
    scroll-snap-align: start;
  }
}

@media (min-width: 768px) {
  .hs-video-section.is-hidden-d { display: none; }
  .hs-video-section.is-full-d > .container { max-width: none; padding-inline: 24px; }
  .hs-video-section.is-carousel-d .hs-video__grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .hs-video-section.is-carousel-d .hs-video__card {
    flex: 0 0 var(--vid-card-w);
    scroll-snap-align: start;
  }
}

.hs-video__grid {
  display: grid;
  grid-template-columns: repeat(var(--vid-cols), minmax(0, 1fr));
  gap: var(--vid-gap);
}

.hs-video__grid::-webkit-scrollbar {
  display: none;
}

.hs-video__card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  aspect-ratio: var(--vid-ratio);
  border-radius: var(--vid-radius);
  overflow: hidden;
  background: var(--hs-soft, #f6f9fd);
}

.hs-video__media {
  position: absolute;
  inset: 0;
}

.hs-video__video,
.hs-video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-video__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, var(--vid-shade)) 0%, rgba(0, 0, 0, 0) 55%);
}

.hs-video__link {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hs-video__controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.hs-video__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease;
}

.hs-video__btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.hs-video__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hs-video__meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  pointer-events: none;
}

.hs-video__avatar {
  flex: 0 0 auto;
}

.hs-video__avatar img {
  display: block;
  width: var(--vid-avatar);
  height: var(--vid-avatar);
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
}

.hs-video__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs-video__name,
.hs-video__tag {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hs-video__name {
  font-size: var(--vid-name);
  font-weight: 600;
  line-height: 1.2;
}

.hs-video__tag {
  font-size: var(--vid-tag);
  color: var(--primary, #F5B301);
}
