/* ============================================================
   MUBLIS - Shorts vertical feed (9:16 scroll-snap)
   ============================================================ */

:root {
  --shorts-gold: #D4AF37;
  --shorts-head-h: 70px;
}

@media (min-width: 820px) {
  :root {
    --shorts-head-h: 80px;
  }
}

html.shorts-html,
html.shorts-html body {
  background: #040405;
  overflow-x: hidden;
}

/* Full-bleed immersive feed: header floats over the video */
.shorts-main {
  padding-top: 0;
}

.shorts-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
}

.shorts-stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #040405;
}

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

/* ── Single slide ──────────────────────────────────────── */
.short-slide {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}

.short-frame {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08080A;
  cursor: pointer;
}

/* Ambient blur and side panel only make sense on the framed desktop layout */
.short-ambient {
  display: none;
}

.short-side {
  display: none;
}

.short-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Vertical short on a landscape source: keep the centre of the frame */
  object-position: center;
}

/* Legibility scrims */
.short-scrim-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--shorts-head-h) + 90px);
  background: linear-gradient(to bottom, rgba(4, 4, 5, 0.88), rgba(4, 4, 5, 0.35) 55%, transparent);
  pointer-events: none;
}

.short-scrim-bottom {
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(4, 4, 5, 0.92), rgba(4, 4, 5, 0.45) 45%, transparent);
  pointer-events: none;
}

/* ── Meta block (title / category / cta) ───────────────── */
.short-meta {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0 18px 30px;
  padding-inline-end: 76px; /* keep clear of the action rail */
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
}

.short-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.32);
  color: var(--shorts-gold);
  font-family: Outfit, 'Noto Sans Hebrew', 'Noto Sans Arabic', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.short-title {
  font-family: Outfit, 'Noto Sans Hebrew', 'Noto Sans Arabic', sans-serif;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
  color: #F4F4F6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  max-width: 34ch;
}

.short-sub {
  font-size: 12px;
  color: #9494A1;
  letter-spacing: 0.02em;
}

.short-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.short-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: Outfit, 'Noto Sans Hebrew', 'Noto Sans Arabic', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.short-cta:hover {
  transform: translateY(-2px);
}

.short-cta-primary {
  background: var(--shorts-gold);
  color: #08080A;
  box-shadow: 0 10px 30px -12px rgba(212, 175, 55, 0.75);
}

.short-cta-primary:hover {
  background: #F0CD5D;
}

.short-cta-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #F4F4F6;
  backdrop-filter: blur(10px);
}

.short-cta-ghost:hover {
  border-color: rgba(212, 175, 55, 0.6);
  color: var(--shorts-gold);
}

/* ── Action rail ───────────────────────────────────────── */
.short-rail {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 4;
}

.short-rail-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #F4F4F6;
  background: rgba(8, 8, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.short-rail-btn:hover {
  color: var(--shorts-gold);
  border-color: rgba(212, 175, 55, 0.55);
  transform: scale(1.06);
}

.short-rail-label {
  font-size: 9px;
  font-weight: 700;
  color: #B9B9C6;
  letter-spacing: 0.06em;
}

.short-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

/* ── Progress + counter ────────────────────────────────── */
.short-progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 5;
}

.short-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #A68028, var(--shorts-gold), #F0CD5D);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.75);
  transition: width 0.15s linear;
}

.short-counter {
  position: absolute;
  inset-inline-start: 18px;
  top: calc(var(--shorts-head-h) + 14px);
  z-index: 4;
  font-family: Outfit, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(244, 244, 246, 0.8);
  background: rgba(8, 8, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

/* ── Play / pause affordance ───────────────────────────── */
.short-playstate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 3;
}

.short-frame.is-paused .short-playstate {
  opacity: 1;
}

.short-playstate span {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shorts-gold);
  background: rgba(8, 8, 10, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.4);
  backdrop-filter: blur(8px);
}

.short-buffering {
  position: absolute;
  inset-inline-start: 18px;
  bottom: 96px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--shorts-gold);
  animation: shorts-spin 0.85s linear infinite;
  z-index: 4;
  display: none;
}

.short-frame.is-buffering .short-buffering {
  display: block;
}

@keyframes shorts-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Scroll hint (first slide only) ────────────────────── */
.shorts-hint {
  position: absolute;
  inset-inline: 0;
  bottom: 26px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(244, 244, 246, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.shorts-hint.is-hidden {
  opacity: 0;
}

.shorts-hint svg {
  animation: shorts-nudge 1.8s ease-in-out infinite;
}

@keyframes shorts-nudge {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

/* ── Desktop: framed 9:16 card + info panel ────────────── */
@media (min-width: 1024px) {
  .short-slide {
    gap: 26px;
    padding: calc(var(--shorts-head-h) + 26px) 40px 40px;
  }

  .short-frame {
    flex: 0 0 auto;
    width: auto;
    height: min(100%, calc(min(430px, 46vw) * 16 / 9));
    aspect-ratio: 9 / 16;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(212, 175, 55, 0.07);
  }

  .short-ambient {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .short-ambient img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(70px) brightness(0.32) saturate(1.15);
    transform: scale(1.15);
  }

  .short-side {
    display: flex;
    position: relative;
    z-index: 2;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    max-width: 420px;
  }

  .short-side .short-title {
    font-size: 30px;
    text-shadow: none;
  }

  .short-slide .short-meta {
    display: none;
  }

  .short-slide .short-rail {
    inset-inline-end: auto;
    inset-inline-start: 26px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  .short-slide .short-counter {
    top: 22px;
  }
}

/* ── Loading / empty states ────────────────────────────── */
.shorts-state {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 0 26px;
  background: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.06), transparent 55%), #040405;
}

.shorts-state.is-hidden {
  display: none;
}

.shorts-state-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shorts-gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.shorts-state h3 {
  font-family: Outfit, 'Noto Sans Hebrew', 'Noto Sans Arabic', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #F4F4F6;
}

.shorts-state p {
  font-size: 13px;
  color: #9494A1;
  line-height: 1.7;
  max-width: 46ch;
}

.shorts-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.18);
  border-top-color: var(--shorts-gold);
  animation: shorts-spin 0.9s linear infinite;
}

/* ── Keyboard nav helpers ──────────────────────────────── */
.short-rail-btn:focus-visible,
.short-cta:focus-visible {
  outline: 2px solid var(--shorts-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .shorts-stage {
    scroll-behavior: auto;
  }

  .shorts-hint svg {
    animation: none;
  }
}
