/* Blog Page Styles */

:root {
    --color-bg: #F5EFE7;
    --color-text-primary: #5C4033;
    --color-text-secondary: #6B5744;
    --color-accent: #D4844D;
    --color-accent-hover: #C17844;
    --color-white: #ffffff;
    --color-border: rgba(139, 69, 19, 0.1);
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.blog-page-wrapper {
    background-color: var(--color-bg);
    min-height: 100vh;
    font-family: serif;
    /* Default to serif as per design intent */
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Fix for blank space below footer */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

.site-footer {
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

/* Hero Section */
.blog-hero {
    padding-top: 1rem;
    padding-bottom: 2rem;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), transparent);
}

.blog-hero__content {
    max-width: 48rem;
    text-align: center;
    margin: 0 auto;
}

.blog-hero__title {
    font-size: var(--font-size-h1);
    /* md:text-6xl */
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.blog-hero__description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    /* text-lg */
    line-height: 1.625;
}

/* Search and Filter */
.blog-filter {
    padding-top: 2rem;
    padding-bottom: 2rem;
    /* position: sticky; REMOVED per user request */
    /* top: 5rem; */
    z-index: 40;
    background-color: transparent;
    /* Changed from backdrop-blur since it's not sticky anymore */
    border-bottom: 1px solid var(--color-border);
}

.blog-filter__inner {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    /* Increased gap */
    align-items: center;
    justify-content: space-between;
}

.blog-search {
    position: relative;
    width: 24rem;
    /* w-96 */
    opacity: 0;
    animation: fadeInLeft 0.8s 0.6s forwards;
}

.search-form {
    position: relative;
}

.search-submit {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(107, 87, 68, 0.5);
    transition: color 0.3s ease;
}

.search-submit:hover {
    color: var(--color-accent);
}

.search-icon {
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
}

.search-field {
    width: 100%;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem !important;
    border-radius: 50px !important;
    border: 1px solid rgba(139, 69, 19, 0.15) !important;
    background-color: var(--color-white);
    outline: none;
    transition: all 0.3s ease;
    font-size: var(--font-size-base);
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
    height: 3.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.search-field:focus {
    border-color: var(--color-accent);
}

/* Categories */
.blog-categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    width: auto;
    opacity: 0;
    animation: fadeInRight 0.8s 0.8s forwards;
}

.category-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: var(--font-size-sm);
    /* text-sm */
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: var(--color-white);
    color: var(--color-text-secondary);
}

.category-btn:hover {
    background-color: rgba(212, 132, 77, 0.1);
}

.category-btn.is-active {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* Posts Grid */
.blog-list-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.blog-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.blog-list>* {
    width: calc((100% - 4rem) / 3);
}

/* Post Card */
.blog-card {
    display: block;
    height: 100%;
    opacity: 0;
    transform: translateY(60px);
    animation: fadeInUp 0.5s forwards;
}

.blog-card__link {
    display: block;
    height: 100%;
    text-decoration: none;
}

.blog-card__inner {
    background-color: var(--color-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover .blog-card__inner {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-card__image-wrapper {
    position: relative;
    height: 16rem;
    overflow: hidden;
}

.blog-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__image {
    transform: scale(1.1) rotate(1deg);
}

.blog-card__placeholder {
    width: 100%;
    height: 100%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.blog-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
}

.blog-card__category {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.category-tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    border-radius: 9999px;
}

.blog-card__meta {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-xs);
}

.blog-card__content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card__title {
    font-size: var(--font-size-h4);
    /* text-xl */
    font-weight: bold;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card__title {
    color: var(--color-accent);
}

.blog-card__excerpt {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__footer {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.read-more {
    color: var(--color-accent);
    font-size: var(--font-size-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.3s ease;
}

.blog-card:hover .read-more {
    gap: 0.5rem;
}

.arrow {
    transition: transform 0.3s ease;
}

.blog-card:hover .arrow {
    transform: translateX(4px);
}

/* Pagination */
.blog-pagination {
    padding-top: 3rem;
    padding-bottom: 3rem;
    display: flex;
    justify-content: center;
}

.blog-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    margin: 0 0.25rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* Newsletter CTA */
.blog-newsletter {
    padding-top: 4rem;
    padding-bottom: 4rem;
    background-color: #5C4033;
}

.newsletter-content {
    max-width: 42rem;
    /* max-w-2xl */
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 0.8s forwards;
    /* Note: animation-timeline is a newer feature, sticking to standard load animation */
}

.newsletter-title {
    font-size: 2.25rem;
    /* text-3xl fallback */
    color: var(--color-white);
    margin-bottom: 1rem;
}

.newsletter-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 28rem;
    /* max-w-md */
    margin: 0 auto;
    flex-direction: row;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    outline: none;
    border: none;
    color: var(--color-text-primary);
}

.newsletter-button {
    padding: 0.75rem 2rem;
    background-color: var(--color-accent);
    color: var(--color-white);
    border-radius: 9999px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.newsletter-button:hover {
    background-color: var(--color-accent-hover);
}

/* Media Queries consolidated at the end */
@media (max-width: 1019px) {
    .blog-list>* {
        width: calc((100% - 2rem) / 2);
    }

    .newsletter-title {
        font-size: var(--font-size-h2);
    }
}

@media (max-width: 767px) {
    .blog-hero__content {
        text-align: left;
    }

    .blog-hero__title {
        font-size: var(--font-size-h2);
    }

    .blog-filter__inner {
        flex-direction: column;
    }

    .blog-search {
        width: 100%;
    }

    .blog-categories {
        width: 100%;
    }

    .blog-list>* {
        width: 100%;
    }

    .newsletter-form {
        flex-direction: column;
    }
}