.he-short-trending {
  --he-st-card-width: 120px;
  width: 100%;
  margin: 14px 0 18px;
  overflow: hidden;
}

.he-st-head {
  margin-bottom: 12px;
}

/* Let the active Newspress theme own widget-title typography and colors. */
.he-short-trending .he-st-widget-title {
  padding: 0;
}

.he-short-trending .he-st-heading {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  color: inherit;
  font: inherit;
  text-decoration: none;
}

.he-short-trending .he-st-heading:hover,
.he-short-trending .he-st-heading:focus {
  color: inherit;
  text-decoration: none;
}

.he-st-heading-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.he-st-scroller-wrap {
  position: relative;
}

.he-st-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 1px 0 3px;
}

.he-st-row::-webkit-scrollbar {
  display: none;
}

.he-st-card,
.he-st-skeleton {
  flex: 0 0 var(--he-st-card-width);
  width: var(--he-st-card-width);
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  background: #e9ecef;
}

.he-st-card {
  position: relative;
  display: block;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
  text-align: left;
  isolation: isolate;
}

.he-st-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .22s ease;
}

.he-st-card:hover .he-st-thumb {
  transform: scale(1.035);
}

.he-st-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.80) 0%,
    rgba(0,0,0,.42) 29%,
    rgba(0,0,0,.08) 66%,
    rgba(0,0,0,.02) 100%
  );
  pointer-events: none;
}

.he-st-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.64);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  backdrop-filter: blur(2px);
}

.he-st-play svg {
  width: 23px;
  height: 23px;
  fill: #fff;
  stroke: none;
}

.he-st-title {
  position: absolute;
  z-index: 3;
  left: 9px;
  right: 9px;
  bottom: 9px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.he-st-nav {
  position: absolute;
  z-index: 8;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #222;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
  display: grid;
  place-items: center;
}

.he-st-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.he-st-scroller-wrap:hover .he-st-nav {
  opacity: 1;
  pointer-events: auto;
}

.he-st-prev { left: 6px; }
.he-st-next { right: 6px; }

.he-st-skeleton {
  position: relative;
  background: #e7e9ec;
}

.he-st-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
}

.he-short-trending.is-loading .he-st-skeleton::after {
  animation: he-st-shimmer 1.25s infinite;
}

.he-st-message {
  margin: 0;
  padding: 12px 0;
  color: var(--np-muted, #6b7280);
  font-size: 14px;
}

@keyframes he-st-shimmer {
  100% { transform: translateX(100%); }
}

/* =========================================================
 * Production fullscreen viewer
 * One persistent YouTube player. No scroll-snap races.
 * ======================================================= */

body.he-st-modal-open {
  overscroll-behavior: none;
}

.he-st-viewer,
.he-st-viewer * {
  box-sizing: border-box;
}

.he-st-viewer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  color: #fff;
  font-family: inherit;
}

.he-st-viewer-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) minmax(72px, auto);
  overflow: hidden;
}

.he-st-viewer-topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding:
    max(8px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    6px
    max(14px, env(safe-area-inset-left));
}

.he-st-viewer-counter {
  min-width: 0;
  color: rgba(255,255,255,.86);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.he-st-viewer-topactions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.he-st-viewer-control {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .14s ease, transform .14s ease, opacity .14s ease;
}

.he-st-viewer-control:hover {
  background: rgba(255,255,255,.18);
}

.he-st-viewer-control:active {
  transform: scale(.96);
}

.he-st-viewer-control:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.he-st-viewer-control:disabled {
  opacity: .28;
  cursor: default;
  transform: none;
}

.he-st-viewer-control svg {
  display: block;
  width: 21px;
  height: 21px;
}

.he-st-viewer-close svg,
.he-st-viewer-prev svg,
.he-st-viewer-next svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.he-st-viewer-mute svg {
  fill: currentColor;
}

.he-st-viewer-mute .he-st-icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.he-st-viewer-play svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
  stroke: none;
}

.he-st-viewer-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 14px;
  overflow: hidden;
}

.he-st-viewer-stagewrap {
  min-width: 0;
  min-height: 0;
  width: min(100%, calc((100dvh - 142px) * .5625));
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.he-st-viewer-stage {
  position: relative;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #050505;
  border-radius: 10px;
  isolation: isolate;
}

.he-st-viewer-poster,
.he-st-player-mount,
.he-st-player-mount > div,
.he-st-player-mount iframe,
.he-st-gesture-surface {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.he-st-viewer-poster {
  z-index: 0;
  display: block;
  object-fit: cover;
  background: #090909;
  transform: scale(1.005);
}

.he-st-player-mount {
  z-index: 1;
  opacity: 1;
  background: #000;
  transition: opacity .14s ease;
}

.he-st-player-mount iframe {
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #000;
}

.he-st-viewer-stage.is-switching .he-st-player-mount {
  opacity: 0;
}

.he-st-gesture-surface {
  z-index: 2;
  background: transparent;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.he-st-viewer-rail {
  flex: 0 0 44px;
  display: grid;
  gap: 10px;
  align-content: center;
}

.he-st-viewer-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding:
    8px
    max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: #000;
  touch-action: none;
}

.he-st-viewer-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.he-st-viewer-title {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.he-st-viewer-status {
  margin-top: 4px;
  color: rgba(255,255,255,.62);
  font-size: 11px;
  line-height: 1.25;
}

.he-st-viewer-status.is-error {
  color: #ffb4b4;
}

.he-st-viewer-status[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .he-short-trending {
    --he-st-card-width: 112px;
  }

  .he-st-row {
    gap: 10px;
  }

  .he-st-nav {
    display: none;
  }

  .he-st-title {
    font-size: 13px;
  }

  .he-st-viewer-shell {
    grid-template-rows: 50px minmax(0, 1fr) minmax(68px, auto);
  }

  .he-st-viewer-content {
    gap: 0;
    padding: 0;
  }

  .he-st-viewer-stagewrap {
    width: min(100vw, calc((100dvh - 126px) * .5625));
  }

  .he-st-viewer-stage {
    border-radius: 0;
  }

  .he-st-viewer-rail {
    display: none;
  }

  .he-st-viewer-control {
    width: 40px;
    height: 40px;
  }
}

@media (max-height: 620px) {
  .he-st-viewer-shell {
    grid-template-rows: 46px minmax(0, 1fr) 60px;
  }

  .he-st-viewer-stagewrap {
    width: min(100vw, calc((100dvh - 106px) * .5625));
  }

  .he-st-viewer-title {
    -webkit-line-clamp: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .he-st-row {
    scroll-behavior: auto;
  }

  .he-st-thumb,
  .he-st-nav,
  .he-st-viewer-control,
  .he-st-player-mount {
    transition: none;
  }

  .he-st-skeleton::after {
    animation: none;
  }
}


/* v1.2.1 — existing iframe is created before YT.Player attaches. */
.he-st-youtube-frame {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #000;
}


/* v1.2.2: protect initial paint and lazy widget state. */
.he-short-trending [hidden] {
  display: none !important;
}

.he-short-trending:not(.is-loading):not(.is-ready) .he-st-skeleton::after {
  animation: none !important;
}
