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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 95%; /* Changed from 1400px to 95% of viewport width */
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: #ffffff;
}

/* Blog Grid Layout */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Changed to grid with auto-fill */
    gap: 20px;
    margin-bottom: 50px;
}

/* Blog Tile Styles */
.blog-tile {
    position: relative;
    background-color: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    width: 100%; /* Changed from fixed 300px to 100% */
    height: 380px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Date Display */
.blog-tile .date {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #6d6d6d;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1;
}

/* Content Layout */
.blog-tile .content {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.blog-tile img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* YouTube Tile Styles */
.youtube-tile {
    position: relative;
}

.youtube-thumbnail {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.youtube-img {
    transition: transform 0.3s ease;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    margin-left: 4px;
}

.youtube-tile:hover .youtube-img {
    transform: scale(1.05);
}

.blog-tile h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.blog-tile p {
    font-size: 0.95rem;
    color: #b0b0b0;
    /* Limit to a few lines of text with ellipsis */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: auto; /* Push the category footer to the bottom */
}

/* Category Footer Styles */
.category-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Colors */
.category-footer.code {
    background-color: #f44336; /* Red */
}

.category-footer.vr {
    background-color: #4CAF50; /* Green */
}

.category-footer.ai {
    background-color: #00BCD4; /* Cyan */
}

.category-footer.stuff {
    background-color: #CDDC39; /* Yellow-green */
}

.category-footer.tech {
    background-color: #9C27B0; /* Purple */
}

.category-footer.white {
    background-color: #eeeeee; /* Purple */
}

/* Quote Container */
.quote-container {
    max-width: 800px;
    margin: 0 auto 25px;
    padding: 15px;
    background-color: #1e1e1e;
    border-radius: 10px;
    text-align: center;
}

blockquote {
    font-style: italic;
    color: #b0b0b0;
    position: relative;
    padding: 10px 30px;
}

blockquote::before, 
blockquote::after {
    content: '"';
    font-size: 2.5rem;
    position: absolute;
    color: #6d6d6d;
    line-height: 1;
}

blockquote::before {
    top: 0;
    left: 0;
}

blockquote::after {
    bottom: -10px;
    right: 0;
}

/* Footer Styles */
.site-footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.social-links {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.social-button {
    display: inline-block;
    background-color: #2d2d2d;
    color: #e0e0e0;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.social-button:hover {
    background-color: #3d3d3d;
}

.copyright {
    font-size: 0.8rem;
    color: #5a5a5a;
    margin-bottom: 10px;
}

/* Responsive Layout */
@media (max-width: 768px) {
    .blog-tile {
        height: 50vh; /* Takes up about half the screen height on mobile */
    }
    
    .blog-tile img {
        height: 50%;
    }
    
    .blog-tile h2 {
        font-size: 1.4rem;
    }
    
    .blog-tile p {
        font-size: 1.1rem;
        -webkit-line-clamp: 4;
    }
    
    .category-footer {
        padding: 10px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .social-button {
        display: block;
        width: 80%;
        margin: 10px auto;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .blog-tile {
        height: 90vh; /* Takes up most of the screen height */
    }
    
    .category-footer {
        padding: 8px;
    }
}

/* Additional breakpoint for extra wide screens */
@media (min-width: 2000px) {
    .container {
        max-width: 98%; /* Even more of the screen on very wide displays */
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Slightly smaller minimum size for more columns */
    }
}