/*
Theme Name: VideoGrid
Theme URI: https://example.com/videogrid
Author: VideoGrid Team
Author URI: https://example.com
Description: A clean, YouTube-style video grid theme with play button overlays on featured images. Perfect for video blogs, vlogs, and video-heavy sites. Dark theme, fully responsive, lightweight.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: videogrid
Tags: dark-theme, video, grid-layout, featured-images, responsive, two-columns, custom-logo, custom-menu
*/

/* =============================================
   CSS Custom Properties (Design Tokens)
   ============================================= */
:root {
    --bg-primary: #0d0d0d;
    --bg-surface: #161616;
    --bg-surface-hover: #1f1f1f;
    --bg-card: #181818;
    --bg-card-hover: #222222;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-tertiary: #777777;
    --accent: #3ea6ff;
    --accent-hover: #5db8ff;
    --accent-red: #ff4444;
    --border: #2a2a2a;
    --border-light: #333333;
    --play-btn-bg: rgba(0, 0, 0, 0.75);
    --play-btn-size: 56px;
    --play-btn-size-sm: 40px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.6);
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1400px;
    --grid-gap: 1.25rem;
}

/* =============================================
   Reset & Base
   ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* =============================================
   Accessibility
   ============================================= */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* =============================================
   Site Header
   ============================================= */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.site-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.site-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.site-title a {
    color: #fff;
}
.site-title a:hover {
    color: var(--accent);
}

.site-description {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: none;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
}
.header-search form {
    display: flex;
    width: 100%;
}
.header-search input[type="search"] {
    flex: 1;
    background: #0d0d0d;
    border: 1px solid var(--border-light);
    border-right: none;
    border-radius: 24px 0 0 24px;
    padding: 0.55rem 1.1rem;
    color: #fff;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}
.header-search input[type="search"]:focus {
    border-color: var(--accent);
    outline: none;
}
.header-search button {
    background: #222;
    border: 1px solid var(--border-light);
    border-left: none;
    border-radius: 0 24px 24px 0;
    padding: 0.55rem 1rem;
    color: #fff;
    display: flex;
    align-items: center;
    transition: background var(--transition-fast);
}
.header-search button:hover {
    background: #333;
}

/* Main Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.main-navigation a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition-fast);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #fff;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.3rem;
}

/* =============================================
   Video Grid (Core Layout)
   ============================================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--grid-gap);
    padding: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* =============================================
   Video Card
   ============================================= */
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    background: var(--bg-card-hover);
}

/* Thumbnail container */
.video-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #1a1a1a;
}
.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}
.video-card:hover .video-card-thumb img {
    transform: scale(1.06);
}

/* Play Button Overlay */
.video-card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    transition: background var(--transition-smooth);
    pointer-events: none;
    z-index: 1;
}
.video-card:hover .video-card-thumb::after {
    background: rgba(0, 0, 0, 0.35);
}

.play-btn-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--play-btn-size);
    height: var(--play-btn-size);
    background: var(--play-btn-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    transition: transform var(--transition-smooth), background var(--transition-smooth);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.play-btn-overlay svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    margin-left: 3px;
}
.video-card:hover .play-btn-overlay {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(255, 68, 68, 0.85);
}

/* Duration badge (optional) */
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    z-index: 3;
    letter-spacing: 0.03em;
}

/* Card body */
.video-card-body {
    padding: 0.85rem 0.9rem 1rem;
    display: flex;
    gap: 0.7rem;
    flex: 1;
}

.video-card-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #333;
    overflow: hidden;
}
.video-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-info {
    flex: 1;
    min-width: 0;
}

.video-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.3rem;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-title a {
    color: #fff;
}
.video-card-title a:hover {
    color: var(--accent);
}

.video-card-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}
.video-card-meta span {
    display: block;
}

/* No thumbnail fallback */
.video-card-thumb.no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #555;
    font-size: 2.5rem;
}

/* =============================================
   Single Post / Video Page
   ============================================= */
.single-video-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
}

.single-video-main {
    min-width: 0;
}

.single-video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.2rem;
}
.single-video-player iframe,
.single-video-player video,
.single-video-player .wp-block-embed {
    width: 100%;
    height: 100%;
}

.single-video-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.single-video-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.single-video-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* Related videos sidebar */
.related-videos {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.related-videos h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.related-video-card {
    display: flex;
    gap: 0.6rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: background var(--transition-fast);
}
.related-video-card:hover {
    background: var(--bg-card-hover);
}
.related-video-card .thumb-sm {
    width: 150px;
    min-width: 150px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    position: relative;
}
.related-video-card .thumb-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-video-card .info-sm {
    padding: 0.4rem 0.5rem;
    min-width: 0;
}
.related-video-card .info-sm .title-sm {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.2rem;
}
.related-video-card .info-sm .meta-sm {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* =============================================
   Archive / Search Page Header
   ============================================= */
.page-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 0.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    color: #fff;
}
.page-header .archive-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
    max-width: var(--max-width);
    margin: 1.5rem auto 2.5rem;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.7rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.pagination .page-numbers.current {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: 700;
}
.pagination .page-numbers:hover:not(.current) {
    background: var(--bg-surface-hover);
    color: #fff;
    border-color: #555;
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.2rem;
}
.sidebar .widget {
    margin-bottom: 1.5rem;
}
.sidebar .widget:last-child {
    margin-bottom: 0;
}
.sidebar .widget-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.sidebar ul {
    list-style: none;
}
.sidebar ul li {
    margin-bottom: 0.4rem;
}
.sidebar ul li a {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.sidebar ul li a:hover {
    color: var(--accent);
}

/* =============================================
   Site Footer
   ============================================= */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: auto;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.82rem;
}
.site-footer a {
    color: var(--text-secondary);
}
.site-footer a:hover {
    color: #fff;
}

/* =============================================
   No Results / 404
   ============================================= */
.no-results,
.error-404 {
    max-width: 600px;
    margin: 3rem auto;
    text-align: center;
    padding: 1.5rem;
}
.no-results h2,
.error-404 h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.8rem;
}
.no-results p,
.error-404 p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}
.no-results .search-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
}
.no-results .search-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    background: #0d0d0d;
    border: 1px solid var(--border-light);
    border-radius: 24px 0 0 24px;
    color: #fff;
}
.no-results .search-form button {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    border: none;
    border-radius: 0 24px 24px 0;
    color: #000;
    font-weight: 600;
}

/* =============================================
   Responsive Breakpoints
   ============================================= */
@media (max-width: 1024px) {
    .single-video-container {
        grid-template-columns: 1fr;
    }
    .related-videos {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 0.8rem;
    }
    .related-video-card {
        flex-direction: column;
    }
    .related-video-card .thumb-sm {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 0.9rem;
        padding: 1rem;
    }
    .header-search {
        max-width: 300px;
    }
    .main-navigation ul {
        gap: 0.8rem;
    }
    .main-navigation a {
        font-size: 0.8rem;
    }
    :root {
        --play-btn-size: 44px;
    }
    .play-btn-overlay svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.8rem;
    }
    .header-inner {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .header-search {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }
    .menu-toggle {
        display: block;
    }
    .main-navigation {
        display: none;
    }
    .main-navigation.active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }
    .main-navigation.active ul {
        flex-direction: column;
        gap: 0.6rem;
    }
    .single-video-container {
        padding: 0.8rem;
    }
    .single-video-title {
        font-size: 1.15rem;
    }
    .single-video-content {
        padding: 0.9rem;
    }
}

@media (max-width: 400px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    .video-card-body {
        padding: 0.6rem;
    }
    .video-card-title {
        font-size: 0.82rem;
    }
}
2. index.php required
📄
index.php
/videogrid/index.php
<?php
/**
 * Main template file — fallback for all views.
 * VideoGrid Theme
 */
get_header();
?>

<main id="primary" class="site-main">
    <?php if ( have_posts() ) : ?>
        <div class="video-grid">
            <?php
            while ( have_posts() ) :
                the_post();
                get_template_part( 'template-parts/content', 'card' );
            endwhile;
            ?>
        </div>

        <?php the_posts_pagination( array(
            'mid_size'  => 2,
            'prev_text' => '&laquo; Prev',
            'next_text' => 'Next &raquo;',
            'class'     => 'pagination',
        ) ); ?>

    <?php else : ?>
        <div class="no-results">
            <h2>Nothing Found</h2>
            <p>Sorry, no posts matched your criteria. Try a search?</p>
            <?php get_search_form(); ?>
        </div>
    <?php endif; ?>
</main>

<?php
get_footer();