/**
 * BobVila Homepage Styles
 * Exact replica of bobvila.com homepage layout
 */

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

.homepage-main {
    background: #fff;
    padding-top: 20px;
}

/* =================================
   HERO SECTION
================================= */
.hero-section {
    margin-bottom: 40px;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

/* Featured Post (Left) */
.hero-featured-post {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.featured-post-large {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.featured-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.featured-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 40px 30px 30px;
}

.featured-inner {
    max-width: 90%;
}

.featured-category {
    display: inline-block;
    background: #67921f;
    color: #fff;
    padding: 6px 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.featured-title {
    margin: 0 0 15px 0;
}

.featured-title a {
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.featured-title a:hover {
    color: #67921f;
}

.featured-excerpt {
    color: #f5f5f5;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 15px 0;
}

.featured-meta {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #ccc;
}

/* Sidebar Posts (Right) */
.hero-sidebar-posts {
    display: flex;
    flex-direction: column;
}

.hero-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hero-post-item {
    margin: 0;
}

.post-card-small {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-thumb-link {
    display: block;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-thumb-link:hover .post-thumbnail {
    transform: scale(1.05);
}

.post-content-small {
    flex: 1;
}

.post-category-badge {
    margin-bottom: 8px;
}

.post-category-badge a {
    display: inline-block;
    color: #67921f;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.post-category-badge a:hover {
    text-decoration: underline;
}

.post-title-small {
    margin: 0 0 8px 0;
}

.post-title-small a {
    color: #2b2b2b;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title-small a:hover {
    color: #67921f;
}

.post-meta-small {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #666;
}

/* =================================
   VIDEO SECTION
================================= */
.video-section {
    margin-bottom: 50px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

.section-header {
    margin-bottom: 25px;
}

.section-title {
    margin: 0;
    padding: 0;
}

.flag-heading {
    display: inline-block;
    background: #67921f;
    color: #fff;
    padding: 12px 20px;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.flag-heading::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 21px 0 21px 12px;
    border-color: transparent transparent transparent #67921f;
}

.flag-heading a {
    color: #fff;
    text-decoration: none;
}

.flag-heading a:hover {
    text-decoration: underline;
}

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

.video-card {
    cursor: pointer;
}

.video-link {
    display: block;
    text-decoration: none;
}

.video-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.video-thumb-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-link:hover .video-thumb-img {
    transform: scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    color: #67921f;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.video-link:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-title {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #2b2b2b;
    transition: color 0.3s ease;
}

.video-link:hover .video-title {
    color: #67921f;
}

/* =================================
   CATEGORY SECTIONS
================================= */
.category-section {
    margin-bottom: 50px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

/* Featured Posts Layout (Large Left, Smaller Right) */
.featured-posts-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
}

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

.post-featured-large {
    height: 100%;
}

.featured-img-link {
    display: block;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.featured-img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-img-link:hover .featured-img {
    transform: scale(1.05);
}

.featured-post-content {
    padding: 0;
}

.featured-post-title {
    margin: 15px 0 12px 0;
}

.featured-post-title a {
    color: #2b2b2b;
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.featured-post-title a:hover {
    color: #67921f;
}

.featured-post-excerpt {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #4a4a4a;
    margin: 0 0 12px 0;
}

.post-meta {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #666;
}

/* Sidebar Posts */
.posts-sidebar-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card-sidebar {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    align-items: start;
}

.post-sidebar-thumb {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-thumb-img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.post-sidebar-content {
    flex: 1;
}

.post-sidebar-title {
    margin: 8px 0 6px 0;
}

.post-sidebar-title a {
    color: #2b2b2b;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-sidebar-title a:hover {
    color: #67921f;
}

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

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

.post-card-grid {
    display: flex;
    flex-direction: column;
}

.post-grid-thumb {
    display: block;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.grid-thumb-img {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-grid-thumb:hover .grid-thumb-img {
    transform: scale(1.05);
}

.post-grid-content {
    flex: 1;
}

.post-grid-title {
    margin: 8px 0 6px 0;
}

.post-grid-title a {
    color: #2b2b2b;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-grid-title a:hover {
    color: #67921f;
}

/* =================================
   VIDEO POPUP
================================= */
.video-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.video-popup-overlay.active {
    display: flex;
}

.video-popup-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.video-popup-close:hover {
    transform: scale(1.2);
}

.video-popup-content {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

#video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#video-player iframe {
    width: 100%;
    height: 100%;
}

/* =================================
   RESPONSIVE
================================= */
@media (max-width: 1024px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hero-posts-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-posts-layout {
        grid-template-columns: 1fr;
    }
    
    .posts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .posts-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-posts-list {
        grid-template-columns: 1fr;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .posts-grid-3,
    .posts-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .post-card-sidebar {
        grid-template-columns: 1fr;
    }
    
    .featured-title a {
        font-size: 24px;
    }
    
    .video-popup-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .featured-post-large {
        height: 400px;
    }
    
    .featured-title a {
        font-size: 20px;
    }
    
    .featured-excerpt {
        font-size: 14px;
    }
}
