/*
Theme Name: VideoSite Theme
Theme URI: https://videosite.com
Author: VideoSite
Author URI: https://videosite.com
Description: A premium dark video magazine theme with thumbnail-first loading, AJAX search, category filtering, and paywall support.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL v2 or later
Text Domain: videosite
*/

/* =============================================
   CSS Custom Properties (Design Tokens)
   ============================================= */
:root {
    --vs-bg-primary: #0f0f13;
    --vs-bg-secondary: #15151d;
    --vs-bg-card: #1a1a24;
    --vs-bg-card-hover: #1f1f2e;
    --vs-border: rgba(255, 255, 255, 0.06);
    --vs-border-hover: rgba(255, 255, 255, 0.12);
    --vs-accent: #e63946;
    --vs-accent-hover: #ff4d5a;
    --vs-accent-glow: rgba(230, 57, 70, 0.25);
    --vs-text-primary: #f1f1f1;
    --vs-text-secondary: #8b8b9a;
    --vs-text-muted: #5a5a6e;
    --vs-premium-gold: #f59e0b;
    --vs-premium-gold-dark: #d97706;
    --vs-success: #22c55e;
    --vs-radius-sm: 6px;
    --vs-radius-md: 10px;
    --vs-radius-lg: 14px;
    --vs-radius-xl: 20px;
    --vs-shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
    --vs-shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.5);
    --vs-shadow-glow: 0 0 30px var(--vs-accent-glow);
    --vs-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --vs-content-width: 1280px;
    --vs-content-narrow: 800px;
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--vs-bg-primary);
    color: var(--vs-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--vs-accent); text-decoration: none; transition: var(--vs-transition); }
a:hover { color: var(--vs-accent-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--vs-text-primary);
}

/* =============================================
   Layout
   ============================================= */
.vs-container {
    max-width: var(--vs-content-width);
    margin: 0 auto;
    padding: 0 24px;
}

.vs-container--narrow {
    max-width: var(--vs-content-narrow);
}

/* =============================================
   Header
   ============================================= */
.vs-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--vs-border);
    padding: 0 24px;
}

.vs-header__inner {
    max-width: var(--vs-content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.vs-header__logo {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--vs-text-primary);
    letter-spacing: -0.5px;
}

.vs-header__logo span { color: var(--vs-accent); }

.vs-header__nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.vs-header__nav a {
    color: var(--vs-text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--vs-radius-sm);
    transition: var(--vs-transition);
}

.vs-header__nav a:hover,
.vs-header__nav a.active {
    color: var(--vs-text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* =============================================
   Search Bar
   ============================================= */
.vs-search {
    position: relative;
    flex: 0 1 360px;
}

.vs-search__input {
    width: 100%;
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-lg);
    padding: 10px 16px 10px 42px;
    color: var(--vs-text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--vs-transition);
}

.vs-search__input:focus {
    border-color: var(--vs-accent);
    box-shadow: var(--vs-shadow-glow);
}

.vs-search__input::placeholder { color: var(--vs-text-muted); }

.vs-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vs-text-muted);
    pointer-events: none;
}

.vs-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-md);
    box-shadow: var(--vs-shadow-card-hover);
    display: none;
    overflow: hidden;
    z-index: 100;
}

.vs-search__results.active { display: block; }

.vs-search__result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    transition: var(--vs-transition);
    cursor: pointer;
}

.vs-search__result-item:hover { background: var(--vs-bg-card-hover); }

.vs-search__result-item img {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: var(--vs-radius-sm);
}

.vs-search__result-item span {
    font-size: 13px;
    color: var(--vs-text-primary);
}

/* =============================================
   Category Pills
   ============================================= */
.vs-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 24px 0;
}

.vs-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    border-radius: 100px;
    color: var(--vs-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--vs-transition);
    text-decoration: none;
}

.vs-pill:hover, .vs-pill.active {
    background: var(--vs-accent);
    border-color: var(--vs-accent);
    color: #fff;
}

.vs-pill__count {
    font-size: 11px;
    opacity: 0.7;
}

/* =============================================
   Video Card
   ============================================= */
.vs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}

@media (max-width: 1100px) { .vs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .vs-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px)  { .vs-grid { grid-template-columns: 1fr; } }

.vs-card {
    position: relative;
    border-radius: var(--vs-radius-lg);
    overflow: hidden;
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    transition: var(--vs-transition);
    cursor: pointer;
}

.vs-card:hover {
    transform: translateY(-4px);
    border-color: var(--vs-border-hover);
    box-shadow: var(--vs-shadow-card-hover);
}

.vs-card__thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--vs-bg-secondary);
}

.vs-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.vs-card:hover .vs-card__thumb { transform: scale(1.05); }

.vs-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: rgba(0, 0, 0, 0.3);
}

.vs-card:hover .vs-card__play { opacity: 1; }

.vs-card__play-icon {
    width: 48px;
    height: 48px;
    background: var(--vs-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--vs-accent-glow);
}

.vs-card__play-icon svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin-left: 2px;
}

.vs-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: var(--vs-radius-sm);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.vs-card__premium {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, var(--vs-premium-gold), var(--vs-premium-gold-dark));
    color: #000;
    padding: 3px 10px;
    border-radius: var(--vs-radius-sm);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vs-card__body { padding: 14px 16px; }

.vs-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--vs-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.4;
}

.vs-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--vs-text-muted);
}

.vs-card__meta span { display: flex; align-items: center; gap: 4px; }

/* =============================================
   Hero Section
   ============================================= */
.vs-hero {
    position: relative;
    aspect-ratio: 21 / 9;
    max-height: 500px;
    overflow: hidden;
    border-radius: var(--vs-radius-xl);
    margin-bottom: 8px;
}

.vs-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,15,19,0.95) 0%, rgba(15,15,19,0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px 40px;
}

.vs-hero__cat {
    display: inline-block;
    background: var(--vs-accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
    width: fit-content;
}

.vs-hero__title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 800;
    margin-bottom: 8px;
    max-width: 700px;
}

.vs-hero__desc {
    color: var(--vs-text-secondary);
    font-size: 15px;
    max-width: 600px;
    line-height: 1.5;
}

.vs-hero__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    background: var(--vs-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--vs-transition);
    box-shadow: 0 8px 32px var(--vs-accent-glow);
}

.vs-hero__play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 48px var(--vs-accent-glow);
}

.vs-hero__play svg { width: 28px; height: 28px; fill: #fff; margin-left: 3px; }

@media (max-width: 768px) {
    .vs-hero { aspect-ratio: 16 / 9; border-radius: var(--vs-radius-md); }
    .vs-hero__overlay { padding: 20px; }
}

/* =============================================
   Single Video Player
   ============================================= */
.vs-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--vs-radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.vs-player__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.vs-player__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vs-player__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--vs-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--vs-transition);
    box-shadow: 0 8px 32px var(--vs-accent-glow);
    border: none;
    z-index: 10;
}

.vs-player__play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.vs-player__play-btn svg { width: 32px; height: 32px; fill: #fff; margin-left: 4px; }

/* =============================================
   Paywall Overlay
   ============================================= */
.vs-paywall {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 20;
    padding: 24px;
}

.vs-paywall__icon { font-size: 48px; margin-bottom: 16px; }
.vs-paywall__title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.vs-paywall__price { font-size: 32px; font-weight: 800; color: var(--vs-premium-gold); margin-bottom: 16px; }

.vs-paywall__btn {
    background: linear-gradient(135deg, var(--vs-premium-gold), var(--vs-premium-gold-dark));
    color: #000;
    border: none;
    padding: 14px 36px;
    border-radius: var(--vs-radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--vs-transition);
}

.vs-paywall__btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); }

/* =============================================
   Single Video Meta
   ============================================= */
.vs-video-meta { margin-bottom: 32px; }
.vs-video-meta h1 { font-size: clamp(22px, 3vw, 32px); margin-bottom: 12px; }

.vs-video-meta__info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--vs-text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.vs-video-meta__info span { display: flex; align-items: center; gap: 6px; }

.vs-video-content {
    color: var(--vs-text-secondary);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 24px;
}

.vs-video-content p { margin-bottom: 16px; }

/* =============================================
   Tags
   ============================================= */
.vs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.vs-tag {
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--vs-text-secondary);
    transition: var(--vs-transition);
}

.vs-tag:hover { border-color: var(--vs-accent); color: var(--vs-accent); }

/* =============================================
   Share Buttons
   ============================================= */
.vs-share {
    display: flex;
    gap: 10px;
    padding: 20px 0;
    border-top: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);
    margin-bottom: 32px;
}

.vs-share__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--vs-radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--vs-border);
    background: var(--vs-bg-card);
    color: var(--vs-text-secondary);
    cursor: pointer;
    transition: var(--vs-transition);
}

.vs-share__btn:hover {
    border-color: var(--vs-accent);
    color: var(--vs-accent);
}

/* =============================================
   Section Headers
   ============================================= */
.vs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.vs-section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.vs-section-header a {
    font-size: 13px;
    color: var(--vs-text-secondary);
}

/* =============================================
   Footer
   ============================================= */
.vs-footer {
    background: var(--vs-bg-secondary);
    border-top: 1px solid var(--vs-border);
    padding: 40px 24px;
    margin-top: 60px;
}

.vs-footer__inner {
    max-width: var(--vs-content-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.vs-footer__copy {
    color: var(--vs-text-muted);
    font-size: 13px;
}

.vs-footer__links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.vs-footer__links a {
    color: var(--vs-text-muted);
    font-size: 13px;
}

.vs-footer__links a:hover { color: var(--vs-text-primary); }

/* =============================================
   Load More Button
   ============================================= */
.vs-load-more {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.vs-load-more__btn {
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    color: var(--vs-text-secondary);
    padding: 12px 36px;
    border-radius: var(--vs-radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vs-transition);
}

.vs-load-more__btn:hover {
    border-color: var(--vs-accent);
    color: var(--vs-accent);
}

/* =============================================
   Page Header (Archive / Search)
   ============================================= */
.vs-page-header {
    padding: 40px 0 8px;
}

.vs-page-header h1 {
    font-size: clamp(24px, 3vw, 36px);
    margin-bottom: 8px;
}

.vs-page-header p {
    color: var(--vs-text-secondary);
    font-size: 15px;
}

/* =============================================
   404
   ============================================= */
.vs-404 {
    text-align: center;
    padding: 80px 24px;
}

.vs-404__code {
    font-size: 120px;
    font-weight: 900;
    color: var(--vs-accent);
    opacity: 0.3;
    line-height: 1;
}

.vs-404 h1 { margin: 16px 0; }
.vs-404 p { color: var(--vs-text-secondary); margin-bottom: 32px; }

/* =============================================
   Utilities
   ============================================= */
.vs-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* Breakout image for Discover */
.alignfull, .wp-block-post-featured-image.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    max-width: none;
    height: auto;
}
