/* Root Variables (Blog-Specific) */
:root {
    --accent: #F5A623; /* Aligned with style.css */
    --radius: 12px;
    --max: 1200px;
}

/* Blog Hero */
.blog-hero {
    position: relative;
    height: 70vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/urban (2).jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.blog-hero .hero-overlay {
    background: rgba(0,0,0,0.5);
    padding: 2rem;
    border-radius: 10px;
    color: #fff;
    max-width: 600px;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent);
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.blog-hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Spotlight */
.spotlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 60px 20px;
    max-width: var(--max);
    margin: 0 auto;
    align-items: center;
    animation: fadeInUp 0.5s ease-out;
}

.spotlight-image img {
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
    height: 300px;
}

.spotlight-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}

.spotlight-content .quote {
    font-style: italic;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #555;
}

.spotlight-content .description {
    color: #555;
    margin-bottom: 2rem;
}

.spotlight-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.spotlight-content a:hover,
.spotlight-content a:focus {
    color: #000;
}

/* Recent Posts */
.recent-posts {
    padding: 5rem 2rem;
    background: #f9f9f9;
}

.posts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2.5rem;
    max-width: var(--max);
    margin: 0 auto;
}

.post-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15); /* Enhanced shadow for depth */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 2px solid rgba(245,166,35,0.3); /* Subtle accent border */
    flex: 0 1 100%; /* Default: 1 per row on small screens */
}

.post-card:nth-child(1) {
    animation: fadeInUp 0.5s ease-out;
}

.post-card:nth-child(2) {
    animation: fadeInUp 0.5s ease-out 0.2s;
}

.post-card:nth-child(3) {
    animation: fadeInUp 0.5s ease-out 0.4s;
}

.post-card:nth-child(4) {
    animation: fadeInUp 0.5s ease-out 0.6s;
}

.post-card:hover,
.post-card:focus {
    transform: translateY(-8px) scale(1.05); /* More pronounced lift */
    box-shadow: 0 20px 40px rgba(245,166,35,0.5); /* Stronger glow on hover */
}

.post-card img {
    width: 100%;
    height: 400px; /* Fixed height for portrait */
    object-fit: cover;
    object-position: 50% 0; /* Focus on top for faces/designs */
    order: 1;
    transition: transform 0.4s ease;
}

.post-card:hover img,
.post-card:focus img {
    transform: scale(1.1); /* Smoother zoom effect */
}

/* Gradient overlay for image */
.post-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 400px; /* Match image height */
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4)); /* Subtle gradient */
    pointer-events: none;
    order: 1;
}

.post-card::before {
    content: attr(data-category);
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent);
    color: #000;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.post-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1.2rem 1rem 0.6rem;
    padding: 0 1rem;
    text-align: left;
    width: 100%;
    order: 2;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 1rem;
    color: #444;
    margin: 0 1rem 1.2rem;
    padding: 0 1rem;
    order: 3;
    line-height: 1.7;
}

.post-card .btn-read {
    order: 4;
    align-self: flex-start;
    margin: 0 1rem 1.2rem;
    padding: 0.6rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    background: #000;
    color: #fff;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.post-card .btn-read:hover,
.post-card .btn-read:focus {
    background: var(--accent);
    color: #000;
    box-shadow: 0 10px 25px rgba(245,166,35,0.5);
    transform: translateY(-2px);
}

/* Categories */
.categories {
    max-width: var(--max);
    margin: 60px auto;
    padding: 0 20px;
    text-align: left;
}

.categories h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #111;
}

.category {
    border-radius: 16px;
    background: #fafafa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245,166,35,0.3);
}

.category-toggle {
    width: 100%;
    background: #111;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    padding: 18px 22px;
    border: none;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-toggle:hover,
.category-toggle:focus {
    background: #222;
}

.category-toggle::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.3s ease;
}

.category.active .category-toggle::after {
    transform: rotate(180deg);
}

.category-content {
    display: none;
    flex-direction: column;
    background: #fff;
    padding: 12px 22px 20px;
    border-top: 1px solid #eee;
}

.category.active .category-content {
    display: flex;
}

.category-content a {
    color: #333;
    text-decoration: none;
    margin: 10px 0;
    display: block;
    border-left: 3px solid transparent;
    padding-left: 10px;
    transition: all 0.3s ease;
}

.category-content a:hover,
.category-content a:focus {
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

/* Button Overrides */
.btn-read {
    align-self: flex-start;
    margin: 0 1rem 1rem;
    padding: 0.5rem 1.5rem;
}

.btn-read.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-read:hover,
.btn-read:focus {
    background: var(--accent);
    color: #111;
    box-shadow: 0 8px 20px rgba(245,166,35,0.4);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Responsive Design */
@media (min-width: 600px) {
    .post-card {
        flex: 0 1 calc(50% - 1.25rem); /* 2 per row on medium screens */
    }
}

@media (min-width: 900px) {
    .post-card {
        flex: 0 1 calc(33.333% - 1.67rem); /* 3 per row on large screens */
    }
}

@media (max-width: 900px) {
    .blog-hero {
        padding: 80px 20px;
        height: 60vh;
    }

    .blog-hero h1 {
        font-size: 2.5rem;
    }

    .blog-hero p {
        font-size: 1.1rem;
    }

    .spotlight {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .posts-grid {
        justify-content: center; /* Center on smaller screens for better aesthetics */
    }

    .post-card img {
        height: 350px;
    }

    .post-card::after {
        height: 350px;
    }

    .categories h2 {
        font-size: 1.7rem;
    }

    .category-toggle {
        font-size: 1rem;
        padding: 16px 18px;
    }

    .category-content a {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .blog-hero {
        padding: 60px 20px;
        height: 50vh;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .spotlight,
    .recent-posts,
    .categories {
        padding: 40px 20px;
    }

    .spotlight-image img {
        height: 250px;
    }

    .post-card img {
        height: 300px;
    }

    .post-card::after {
        height: 300px;
    }

    .post-title {
        font-size: 1.3rem;
        padding: 0 0.8rem;
    }

    .post-excerpt {
        padding: 0 0.8rem;
    }

    .btn-read {
        padding: 0.5rem 1.2rem;
        font-size: 0.95rem;
    }

    .categories h2 {
        font-size: 1.5rem;
    }

    .category {
        border-radius: 10px;
    }

    .category-toggle {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .category-content {
        padding: 10px 16px 16px;
    }

    .category-content a {
        margin: 8px 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        gap: 1.5rem;
    }

    .post-card img {
        height: 250px;
    }

    .post-card::after {
        height: 250px;
    }

    .post-card::before {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Reduce animations for low-end devices */
@media (prefers-reduced-motion: reduce) {
    .blog-hero,
    .spotlight,
    .post-card,
    .category,
    .btn-read.pulse {
        animation: none;
    }

    .post-card:hover,
    .post-card:focus,
    .category:hover {
        transform: none;
    }

    .post-card img {
        transform: none;
    }
}