/*
Theme Name: Kricketaudio Video
Theme URI: https://kricketaudio.art
Author: Kricket Audio
Description: Lightweight video hub theme (YouTube / Worldstar style).
Version: 2.2
License: GPLv2 or later
Text Domain: kricketaudio-video
*/

/* ===== DESIGN TOKENS ===== */
:root {
    --bg-base:        #080c14;
    --bg-surface:     #0d1220;
    --bg-elevated:    #131929;
    --bg-glass:       rgba(13, 18, 32, 0.75);
    --border:         rgba(255, 255, 255, 0.07);
    --border-hover:   rgba(56, 189, 248, 0.4);
    --accent:         #38bdf8;
    --accent-glow:    rgba(56, 189, 248, 0.15);
    --accent-warm:    #fbbf24;
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #475569;
    --radius-sm:      0.5rem;
    --radius-md:      0.75rem;
    --radius-lg:      1.25rem;
    --shadow-glow:    0 0 30px rgba(56, 189, 248, 0.08);
    --transition:     0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Subtle animated background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 10%, rgba(56,189,248,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(251,191,36,0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

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

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

/* ===== LAYOUT ===== */
.site-main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 24px rgba(0,0,0,0.4);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 64px;
}

.site-logo {
    font-weight: 800;
    font-size: 2rem !important;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity var(--transition);
}

.site-logo:hover { opacity: 0.85; }

.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-link {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.nav-link--active {
    color: var(--accent);
    background: var(--accent-glow);
}

.nav-badge {
    font-size: 0.6rem;
    background: rgba(251,191,36,0.15);
    color: var(--accent-warm);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: background var(--transition);
}

.nav-toggle:hover span { background: var(--text-primary); }

@media (max-width: 640px) {
    .nav-toggle { display: flex; }

    .primary-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 1.25rem 1.25rem;
        gap: 0.25rem;
        margin-left: 0;
        z-index: 99;
    }

    .primary-nav.nav-open { display: flex; }
    .nav-link { padding: 0.7rem 0.85rem; font-size: 0.95rem; }
}

/* ===== CAROUSEL ===== */
.carousel-section { margin-bottom: 2rem; }

.carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    aspect-ratio: 21 / 9;
    max-height: 500px;
    box-shadow: var(--shadow-glow), 0 4px 40px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide { flex: 0 0 100%; position: relative; }

.carousel-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(8,12,20,0.92) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.carousel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--accent);
    color: var(--bg-base);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    width: fit-content;
}

.carousel-title {
    margin: 0;
    font-size: clamp(1.1rem, 3vw, 1.75rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition);
    z-index: 2;
}

.carousel-btn:hover {
    background: var(--accent-glow);
    border-color: var(--border-hover);
}

.carousel-btn--prev { left: 1rem; }
.carousel-btn--next { right: 1rem; }

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    right: 1.25rem;
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 0;
    transition: background var(--transition), transform var(--transition), width var(--transition);
}

.carousel-dot--active {
    background: var(--accent);
    width: 20px;
    border-radius: 999px;
    transform: none;
}

/* ===== HUB CARDS ===== */
.hub-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
    .hub-links { grid-template-columns: 1fr; }
}

.hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hub-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.hub-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-2px);
}

.hub-card:hover::before { opacity: 1; }

.hub-icon {
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.hub-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.hub-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* ===== VIDEO ARCHIVE GRID ===== */
.video-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.video-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.video-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 24px rgba(56, 189, 248, 0.1);
    transform: translateY(-3px);
}

.video-card-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-elevated);
    overflow: hidden;
    position: relative;
}

.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.video-card:hover .video-card-thumb img {
    transform: scale(1.04);
}

/* Play icon overlay on hover */
.video-card-thumb::after {
    content: '▶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.9);
    background: rgba(8,12,20,0.45);
    opacity: 0;
    transition: opacity var(--transition);
}

.video-card:hover .video-card-thumb::after {
    opacity: 1;
}

.video-card-body {
    padding: 0.85rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.video-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-title a {
    color: inherit;
    text-decoration: none;
}

.video-card-title a:hover { color: var(--accent); }

.video-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== SORT DROPDOWN ===== */
.archive-header {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.archive-header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.archive-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.sort-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sort-wrap label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.sort-wrap select {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}

.sort-wrap select:hover,
.sort-wrap select:focus {
    border-color: var(--border-hover);
}

/* ===== SINGLE VIDEO PAGE ===== */
.single-video-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 900px) {
    .single-video-layout { grid-template-columns: 1fr; }
}

.single-video-title {
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.single-video-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.single-video-meta span::before {
    content: '·';
    margin-right: 0.5rem;
    color: var(--text-muted);
}

.single-video-meta span:first-child::before { content: none; }

/* Video player wrapper - responsive */
.video-player {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    margin-bottom: 1.25rem;
}

.video-player iframe,
.video-player video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

/* ===== SIDEBAR ===== */
.video-sidebar {
    position: sticky;
    top: 80px;
}

.video-sidebar h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sidebar-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0.65rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 0.35rem;
    transition: background var(--transition);
}

.sidebar-item:hover { background: var(--bg-elevated); }

.sidebar-item-thumb {
    border-radius: 0.35rem;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-elevated);
    flex-shrink: 0;
}

.sidebar-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-item:hover .sidebar-item-thumb img { transform: scale(1.05); }

.sidebar-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ===== COMMENTS ===== */
.comments-area {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.comments-area h2,
.comments-area h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 1rem;
}

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 2.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.pagination a:hover {
    border-color: var(--border-hover);
    color: var(--accent);
    background: var(--accent-glow);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-base);
    font-weight: 700;
}

/* ===== FOOTER ===== */
.site-footer {
    padding: 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* ===== UTILITY ===== */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }