/*
Theme Name: BobVila Magazine Theme
Theme URI: https://example.com
Author: Faiz e Raza
Author URI: https://example.com
Description: A custom magazine-style WordPress theme for content-heavy websites with category sections, video support, and grid layouts
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bobvila
Tags: blog, magazine, grid-layout, custom-menu, featured-images, threaded-comments
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f8f8f8;
}

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

a {
    color: #2271b1;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #135e96;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 2px solid #e5e5e5;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.logo img {
    max-height: 50px;
    width: auto;
}

/* Navigation */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.main-navigation a:hover {
    border-bottom-color: #4CAF50;
}

/* Search */
.header-search form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.header-search input[type="search"] {
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    min-width: 200px;
}

.header-search button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

.header-search button:hover {
    background: #45a049;
}

/* Main Content */
.site-main {
    background: #fff;
}

/* Hero Section */
.hero-section {
    padding: 40px 0;
    background: #fff;
}

.hero-post {
    position: relative;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.hero-content {
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
}

.hero-content h1 {
    font-size: 36px;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content h1 a {
    color: white;
    text-decoration: none;
}

.hero-content .post-meta {
    font-size: 14px;
    opacity: 0.9;
}

.hero-content .post-meta span {
    margin-right: 15px;
}

/* Recent Posts Grid */
.recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* Category Sections */
.category-section {
    padding: 50px 0;
    border-top: 1px solid #e5e5e5;
}

.section-title {
    margin-bottom: 30px;
    font-size: 14px;
}

.category-badge {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    display: inline-block;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 3px;
}

.category-badge.how-we-test {
    background: #4CAF50;
}

.category-badge.videos {
    background: #f44336;
}

.category-badge.gardening {
    background: #8BC34A;
}

.category-badge.product-reviews {
    background: #2196F3;
}

.category-badge.diy {
    background: #FF9800;
}

/* Post Grids */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.posts-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.posts-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Post Cards */
.post-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.post-card .post-thumbnail {
    display: block;
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #4CAF50;
}

.post-meta {
    font-size: 13px;
    color: #777;
    margin-top: 10px;
}

.post-meta span {
    margin-right: 15px;
    display: inline-block;
}

.post-meta span::before {
    content: "•";
    margin-right: 8px;
}

.post-meta span:first-child::before {
    content: "";
    margin-right: 0;
}

/* Video Section */
.video-section {
    background: #f8f8f8;
    padding: 50px 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #f44336;
    transition: background 0.3s ease;
}

.video-card:hover .play-icon {
    background: #fff;
}

.video-content {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    margin-bottom: 8px;
}

/* Featured with Sidebar Layout */
.featured-with-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.featured-post-large {
    border-radius: 8px;
    overflow: hidden;
}

.post-large {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.post-large img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.post-large h3 {
    padding: 20px;
    font-size: 24px;
}

.posts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    margin: 50px 0;
}

.newsletter-box {
    text-align: center;
    color: white;
}

.newsletter-box h3 {
    font-size: 32px;
    margin-bottom: 15px;
}

.newsletter-box p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.inline-newsletter {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.inline-newsletter input[type="email"] {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

.inline-newsletter button {
    padding: 15px 40px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.inline-newsletter button:hover {
    background: #45a049;
}

/* Footer */
.site-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 50px 0 20px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: #4CAF50;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input[type="email"] {
    padding: 12px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: #fff;
    border-radius: 4px;
    outline: none;
}

.newsletter-form button {
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.newsletter-form button:hover {
    background: #45a049;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 35px;
    height: 35px;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ccc;
    font-size: 0;
    text-decoration: none;
    transition: background 0.3s ease;
}

.social-icon:hover {
    background: #4CAF50;
    color: white;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #777;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .recent-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .posts-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .recent-posts-grid,
    .posts-grid,
    .posts-grid-4,
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inline-newsletter {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .footer-columns {
        grid-template-columns: 1fr;
    }
    
    .hero-image img {
        height: 300px;
    }
    
    .newsletter-box h3 {
        font-size: 24px;
    }
    
    .newsletter-box p {
        font-size: 16px;
    }
}

/* Utility Classes */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-30 {
    margin-top: 30px;
}
