/*
 * [yubake_shorts] — horizontal, click-to-play wall of vertical Shorts.
 * Brand tokens fall back to literals so the wall looks right even on a page
 * that does not also load seo-collection.css.
 */
.yb-shorts {
  --yb-short-w: clamp(158px, 42vw, 208px);
  --yb-short-radius: 16px;
  --yb-short-gap: 14px;
  margin: 0 auto;
  max-width: 1200px;
}

/*
 * Matches the mooncake-promotion page's section headings (Elementor): a full
 * cream band (#F4ECD5) with 10px padding, holding centred Roboto 600 19px cocoa
 * (#583C32) text. No radius/shadow — the band just stands out against the white
 * page, exactly like the "BESTSELLER: Mooncakes & Gift Sets" heading. Roboto is
 * loaded site-wide by Elementor; the stack falls back gracefully. Line-height is
 * a touch looser than the theme's so a wrapped EN + 中文 heading stays legible.
 */
.yb-shorts__heading {
  margin: 0 0 12px;
  padding: 10px 16px;
  background: #F4ECD5;
  font-family: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: #583C32;
  text-align: center;
}

.yb-shorts__viewport {
  position: relative;
}

.yb-shorts__track {
  list-style: none;
  margin: 0;
  padding: 6px 4px 10px;
  display: flex;
  gap: var(--yb-short-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.yb-shorts__track::-webkit-scrollbar { display: none; }

.yb-short {
  flex: 0 0 auto;
  width: var(--yb-short-w);
  margin: 0;
  scroll-snap-align: start;
}

.yb-short__btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--yb-short-radius);
  overflow: hidden;
  background: #000;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(46, 31, 26, .16);
  transition: transform .18s ease, box-shadow .18s ease;
}
.yb-short__btn:hover,
.yb-short__btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(46, 31, 26, .26);
  outline: none;
}

.yb-short__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yb-short__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  transform: translate(-50%, -50%);
  opacity: .95;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  transition: transform .18s ease, opacity .18s ease;
}
.yb-short__play svg { display: block; width: 100%; height: auto; }
.yb-short__play-bg { fill: #f00; } /* YouTube red — reads instantly as "video" */
.yb-short__btn:hover .yb-short__play,
.yb-short__btn:focus-visible .yb-short__play {
  transform: translate(-50%, -50%) scale(1.08);
  opacity: 1;
}

/* Active player: replaces the facade in place. */
.yb-short__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Prev/next arrows — a desktop affordance; touch users swipe. */
.yb-shorts__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  /* Reset the theme's default <button> chrome (padding 10px 20px + border),
     which would otherwise collapse the content box and push the chevron
     off-centre. */
  box-sizing: border-box;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--yb-cocoa-900, #2E1F1A);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(46, 31, 26, .22);
  transition: background .15s ease, transform .15s ease;
}
.yb-shorts__nav:hover { background: var(--yb-cream-100, #FAF5E7); }
.yb-shorts__nav:active { transform: translateY(-50%) scale(.94); }
.yb-shorts__nav[hidden] { display: none; }
.yb-shorts__nav--prev { left: -6px; }
.yb-shorts__nav--next { right: -6px; }
.yb-shorts__nav svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Touch devices: no hover arrows, native swipe only. */
@media (hover: none) {
  .yb-shorts__nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .yb-short__btn,
  .yb-short__play,
  .yb-shorts__nav { transition: none; }
}
