/* ---------- Shorts page ----------
   Layout rule: nothing is drawn on top of the video.
   Video on top, thin progress bar, then a solid info bar underneath. */

:root {
  --header-h: 68px;        /* real value is measured by js/shorts.js */
  --short-bar-h: 150px;    /* progress bar + info bar, total height under the video */
  --feed-h: calc(100vh - var(--header-h));

  /* VIP gold palette */
  --gold-light: #f6d98a;
  --gold: #e3ad3c;
  --gold-deep: #a97a22;
  --gold-ink: #2a1d05;     /* dark text used on top of gold */
}

@supports (height: 100dvh) {
  :root { --feed-h: calc(100dvh - var(--header-h)); }
}

.shorts-page {
  overflow: hidden; /* the feed scrolls, not the page */
}

.shorts-main {
  height: var(--feed-h);
  position: relative;
}

/* ---------- Feed (vertical snap scrolling) ---------- */

.shorts-feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.shorts-feed::-webkit-scrollbar {
  display: none;
}

.short {
  height: 100%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* ---------- Card: video + progress + info bar ---------- */

.short-card {
  /* the video is 9:16, so its width follows the height that is left for it */
  width: min(440px, 100%, calc((var(--feed-h) - 24px - var(--short-bar-h)) * 9 / 16));
  display: flex;
  flex-direction: column;
  background: var(--bg-header);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.short-media {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.short-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Play glyph, only visible while the viewer has paused the clip */
.short-indicator {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.short-media.is-paused .short-indicator {
  display: flex;
}

.short-indicator span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ---------- Progress bar (click to seek) ---------- */

.short-progress {
  height: 6px;
  background: #26262c;
  cursor: pointer;
}

.short-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* ---------- Solid info bar ---------- */

.short-info {
  height: calc(var(--short-bar-h) - 6px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-header);
}

.short-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.short-meta {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.short-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.short-btn {
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1f;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}

.short-btn:hover {
  border-color: var(--accent);
}

.short-btn.is-liked {
  color: var(--accent);
}

.short-btn.is-liked svg {
  fill: currentColor;
}

.short-link {
  min-width: 0;
  margin-left: auto;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.short-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.short-btn:focus-visible,
.short-link:focus-visible,
.shorts-nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sound icon follows the global muted state */
.shorts-muted .icon-sound-on { display: none; }
body:not(.shorts-muted) .icon-sound-off { display: none; }
.short-sound span { display: inline-flex; }

/* ---------- VIP shorts: gold "premium" look ---------- */

.short.is-vip .short-card {
  border-color: rgba(227, 173, 60, 0.55);
  box-shadow: 0 0 0 1px rgba(227, 173, 60, 0.15), 0 12px 40px -14px rgba(227, 173, 60, 0.4);
}

.short.is-vip .short-info {
  background: linear-gradient(180deg, #1c160a 0%, var(--bg-header) 100%);
}

.short.is-vip .short-title {
  color: #f8e7b5;
}

.short.is-vip .short-progress {
  background: #2c2413;
}

.short.is-vip .short-progress-fill {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
}

.short.is-vip .short-btn {
  border-color: rgba(227, 173, 60, 0.3);
}

.short.is-vip .short-btn:hover {
  border-color: var(--gold);
}

.short.is-vip .short-btn.is-liked {
  color: var(--gold);
}

.short.is-vip .short-link {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-deep));
  color: var(--gold-ink);
}

.short.is-vip .short-btn:focus-visible,
.short.is-vip .short-link:focus-visible {
  outline-color: var(--gold);
}

/* VIP tag on the video: gold instead of the site's pink (only inside the shorts feed) */
.short .vip-badge {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-deep));
  color: var(--gold-ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.short .vip-badge::before {
  content: '★ ';
}

/* ---------- End of feed ---------- */

.short-end-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Previous / next buttons (desktop) ---------- */

.shorts-nav {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

.shorts-nav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1f;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.shorts-nav-btn:hover {
  border-color: var(--accent);
}

@media (max-width: 750px) {
  .shorts-nav { display: none; }
  .short { padding: 8px; }
}
