/*
Theme Name: ShortVideo Feed
Theme URI: https://example.com/shortvideo-feed
Author: ChatGPT
Author URI: https://example.com
Description: A vertical short-video feed theme inspired by modern short-form video apps (not affiliated with TikTok). Uses a custom post type for videos and safe iframe embeds (YouTube/Vimeo via URL; optional sanitized iframe).
Version: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shortvideo-feed
Tags: one-column, custom-post-types, blog, fullscreen, responsive-layout
*/

:root{
  --sv-bg:#0b0b0f;
  --sv-fg:#ffffff;
  --sv-muted:rgba(255,255,255,.75);
  --sv-accent:#00f2ea; /* change in Customizer */
  --sv-accent2:#ff0050; /* change in Customizer */
  --sv-card:rgba(0,0,0,.35);
  --sv-shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--sv-bg);
  color:var(--sv-fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, sans-serif;
  overflow:hidden; /* feed handles scroll */
}

a{ color:inherit; text-decoration:none; }
a:hover{ opacity:.9; }

/* Layout */
.sv-app{ height:100vh; width:100vw; display:flex; flex-direction:column; }
.sv-topbar{
  position:fixed; top:0; left:0; right:0;
  height:56px;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 16px;
  z-index:50;
  background:linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events:none;
}
.sv-topbar > *{ pointer-events:auto; }
.sv-brand{
  font-weight:700;
  letter-spacing:.2px;
  display:flex; gap:10px; align-items:center;
}
.sv-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  box-shadow: var(--sv-shadow);
  font-size:14px;
}
.sv-pill .dot{
  width:8px; height:8px; border-radius:50%;
  background:linear-gradient(135deg, var(--sv-accent), var(--sv-accent2));
}

/* Feed */
.sv-feed{
  height:100vh;
  overflow-y:auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.sv-item{
  position:relative;
  height:100vh;
  width:100%;
  scroll-snap-align: start;
  display:flex;
  align-items:stretch;
  justify-content:center;
  background: #000;
}
.sv-video{
  position:absolute; inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
.sv-video iframe{
  width:100%;
  height:100%;
  border:0;
}

/* overlay */
.sv-overlay{
  position:absolute; inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  padding:20px 16px calc(20px + env(safe-area-inset-bottom)) 16px;
  gap:16px;
  pointer-events:none;
}
.sv-left, .sv-right{ pointer-events:none; }
.sv-left{
  max-width:min(520px, 72vw);
}
.sv-caption{
  background:rgba(0,0,0,.25);
  backdrop-filter: blur(10px);
  border-radius:14px;
  padding:12px 12px;
  box-shadow: var(--sv-shadow);
}
.sv-handle{
  font-weight:700;
  display:flex; align-items:center; gap:8px;
}
.sv-handle .badge{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--sv-accent), var(--sv-accent2));
  color:#000;
  font-weight:800;
}
.sv-text{ margin-top:8px; color:var(--sv-muted); line-height:1.3; font-size:14px; }

.sv-right{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  padding-bottom:10px;
}
.sv-btn{
  pointer-events:auto;
  width:48px; height:48px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--sv-shadow);
  cursor:pointer;
  user-select:none;
}
.sv-btn:active{ transform:scale(.98); }
.sv-btn svg{ width:22px; height:22px; fill:#fff; }
.sv-count{ font-size:12px; color:var(--sv-muted); margin-top:4px; text-align:center; }

/* bottom nav */
.sv-bottomnav{
  position:fixed; left:0; right:0; bottom:0;
  height:62px;
  display:flex; align-items:center; justify-content:space-around;
  z-index:50;
  background:linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  padding-bottom: env(safe-area-inset-bottom);
}
.sv-bottomnav a{
  width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
  border-radius:12px;
  background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}
.sv-bottomnav svg{ width:22px; height:22px; fill:#fff; opacity:.9; }

/* loading + empty */
.sv-empty{
  height:100vh; display:flex; align-items:center; justify-content:center;
  padding:24px; text-align:center; color:var(--sv-muted);
}
.sv-empty a{ text-decoration:underline; }

/* admin bar */
body.admin-bar .sv-topbar{ top:32px; }
@media (max-width: 782px){
  body.admin-bar .sv-topbar{ top:46px; }
}

/* accessibility */
.sr-only{
  position:absolute!important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
