/* Reels feed (/reels/, /ar/reels/) — snap scrolling, phone frame on desktop.
   The feed is position:fixed + 100dvh so it always fits the real screen, whatever the
   browser does with its toolbars; never resize it from JS or the layout shakes. */
body.reels-page { overflow: hidden; background: #000; }
/* No site navbar here — the feed owns the screen; a close button takes its place. */
.reels-page .top { display: none; }

.reel-close { position: fixed; top: calc(14px + env(safe-area-inset-top)); inset-inline-start: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(20, 22, 27, .55); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 30; backdrop-filter: blur(6px); }
.reel-close:hover { background: rgba(60, 64, 74, .8); }
.reel-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.feed { position: fixed; inset: 0; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.feed::-webkit-scrollbar { display: none; }

.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }
.reel-box { position: absolute; inset: 0; }
.reel-box video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

/* Desktop: a phone-sized frame, like YouTube Shorts. pointer:fine keeps touchscreen
   laptops/tablets on the full-bleed mobile layout. */
@media (min-width: 768px) and (pointer: fine) {
  .reel-box { position: relative; height: calc(100% - 48px); width: min(100vw, calc((100dvh - 48px) * 0.6)); border-radius: 16px; overflow: hidden; }
}

/* overlays */
.reel-shade { position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); pointer-events: none; transition: opacity .4s ease; }
.reel-box.meta-hidden .reel-shade { opacity: 0; }
.reel-meta { position: absolute; inset-inline: 16px; bottom: calc(26px + env(safe-area-inset-bottom)); color: #fff; display: grid; gap: 6px; padding-inline-end: 64px; transition: opacity .4s ease, transform .4s ease; }
/* While the video plays the text steps aside; pausing or arriving on a reel brings it back. */
.reel-box.meta-hidden .reel-meta { opacity: 0; transform: translateY(10px); pointer-events: none; }
.reel-meta h2 { margin: 0; font-size: 17px; font-weight: 700; }
.reel-meta p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .82); }
.reel-meta .reel-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; width: fit-content; padding: 7px 14px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13.5px; font-weight: 700; }
.reel-meta .reel-cta:hover { text-decoration: none; filter: brightness(1.08); }

.reel-actions { position: absolute; inset-inline-end: 10px; bottom: calc(26px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.reel-actions button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); transition: background .15s; }
.reel-actions button:hover { background: rgba(255, 255, 255, .28); }
.reel-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.reel-progress { position: absolute; inset-inline: 0; bottom: 0; height: 14px; cursor: pointer; display: flex; align-items: flex-end; }
.reel-progress i { display: block; height: 3px; width: 0; background: var(--accent); transition: height .1s; }
.reel-progress:hover i { height: 6px; }

/* pause flash in the center when tapped */
.reel-flash { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .18s; }
.reel-flash.on { opacity: 1; }
.reel-flash svg { width: 64px; height: 64px; color: rgba(255, 255, 255, .9); filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .6)); fill: currentColor; stroke: none; }

/* first-visit scroll hint: shown until the visitor scrolls once, then never again */
.scroll-hint { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; color: #fff; font-size: 13.5px; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); pointer-events: none; z-index: 25; animation: hint-in .5s ease .8s both; }
.scroll-hint svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation: hint-bounce 1.2s ease-in-out infinite; }
.scroll-hint.bye { transition: opacity .3s; opacity: 0; }
@keyframes hint-bounce { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(-8px); opacity: 1; } }
@keyframes hint-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scroll-hint, .scroll-hint svg { animation: none; } }

/* desktop up/down controls */
.feed-nav { position: fixed; inset-inline-end: 22px; top: 50%; transform: translateY(-50%); display: none; gap: 10px; z-index: 20; }
@media (min-width: 768px) and (pointer: fine) { .feed-nav { display: grid; } }
.feed-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(20, 22, 27, .8); color: #fff; cursor: pointer; display: grid; place-items: center; }
.feed-nav button:hover { background: rgba(60, 64, 74, .9); }
.feed-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* while the video loads */
.reel-box:not(.ready) video { visibility: hidden; }
.reel-box:not(.ready)::after { content: ""; position: absolute; inset: 0; background: var(--panel-2, #1b1e25) center / 64px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E"); }
