/**
 * Blog Archive Custom Template Styles
 */

/* Main container layout */
.blog-archive-container {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Left Sidebar */
.blog-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.blog-sidebar h3.blog-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-sidebar-content {
    margin-top: 20px;
}

/* Category Menu */
.blog-categories {
    margin-top: 30px;
}

.blog-category-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-category-menu .parent-category {
    margin-bottom: 20px;
}

.blog-category-menu .parent-category > a {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-category-menu .parent-category > a:hover {
    color: #55924e;
}

.blog-category-menu .child-categories {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.blog-category-menu .child-categories li {
    margin: 10px 0;
    padding-left: 0;
}

.blog-category-menu .child-categories .indent {
    color: #999;
    margin-right: 8px;
    font-weight: normal;
}

.blog-category-menu .child-categories a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.blog-category-menu .child-categories a:hover {
    color: #55924e;
}

.blog-category-menu .current-cat > a {
    color: #55924e;
    font-weight: bold;
}

/* Main Content Area */
.blog-posts-container {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

/* Blog Posts List */
.blog-posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Blog Post Card */
.blog-post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.blog-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.blog-post-card .post-thumbnail {
    width: 100%;
    max-height: 646px;
    overflow: hidden;
}

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

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

.blog-post-card .post-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.blog-post-card .post-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

.blog-post-card:hover .post-title {
    color: #55924e;
}

.blog-post-card .post-meta {
    display: flex;
    gap: 15px;
    font-size: 16px;
    color: #666;
}

.blog-post-card .post-meta span {
    display: flex;
    align-items: center;
}

.blog-post-card .post-meta .post-date {
    font-weight: 500;
}

.blog-post-card .post-meta .post-categories {
    color: #55924e;
}

.blog-post-card .post-excerpt {
    line-height: 1.7;
    color: #555;
    font-size: 17px;
}

/* No Posts Found */
.no-posts-found {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.no-posts-found p {
    font-size: 18px;
    margin: 0;
}

/* Pagination */
.blog-pagination {
    margin: 60px 0 0;
    text-align: center;
}

.blog-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.blog-pagination .nav-links > *:nth-child(2) {
    margin-left: 0;
}

.blog-pagination .page-numbers:hover {
    background: #55924e;
    color: #fff;
}

.blog-pagination .page-numbers.current {
    background: #55924e;
    color: #fff;
    font-weight: bold;
}

.blog-pagination .page-numbers.dots {
    background: transparent;
    cursor: default;
}

.blog-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #333;
}

/* Responsive Design */
@media (max-width: 960px) {
    .blog-archive-container {
        flex-direction: column;
        padding: 40px 15px;
    }

    .blog-sidebar {
        width: 100%;
        margin-bottom: 40px;
    }

    .blog-post-card .post-content {
        padding: 25px;
    }

    .blog-post-card .post-title {
        font-size: 24px;
    }

    .blog-post-card .post-meta {
        font-size: 15px;
    }

    .blog-post-card .post-excerpt {
        font-size: 16px;
    }
}

@media (max-width: 569px) {
    .blog-archive-container {
        padding: 30px 10px;
    }

    .blog-sidebar h3.blog-title {
        font-size: 20px;
    }

    .blog-category-menu .parent-category > a {
        font-size: 13px;
    }

    .blog-category-menu .child-categories a {
        font-size: 13px;
    }

    .blog-pagination {
        margin: 40px 0 0;
    }

    .blog-pagination .page-numbers {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
}

/* Clear Search Button */
.search-container-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #999;
    transition: color 0.2s ease;
    z-index: 10;
}

.clear-search-btn:hover {
    color: #333;
}

.clear-search-btn span {
    display: block;
    font-weight: 300;
}

/* Skeleton Loading Cards */
.blog-post-card.skeleton-card {
    pointer-events: none;
    cursor: default;
}

.blog-post-card.skeleton-card .skeleton-thumbnail,
.blog-post-card.skeleton-card .skeleton-title,
.blog-post-card.skeleton-card .skeleton-meta,
.blog-post-card.skeleton-card .skeleton-excerpt {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.skeleton-thumbnail {
    width: 100%;
    height: 400px;
    margin-bottom: 0;
}

.skeleton-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skeleton-title {
    height: 28px;
    width: 100%;
    margin-bottom: 5px;
}

.skeleton-title.short {
    width: 70%;
}

.skeleton-meta {
    height: 16px;
    width: 50%;
    margin: 10px 0;
}

.skeleton-excerpt {
    height: 17px;
    width: 100%;
}

.skeleton-excerpt.short {
    width: 60%;
}

/* Smooth transition when replacing skeleton with real content */
.blog-posts-list {
    transition: opacity 0.3s ease;
}

.blog-posts-loading {
    opacity: 1;
}

/* Empty Search Results Message */
.blog-search-empty {
    display: none;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.blog-search-empty.active {
    display: block;
}

.blog-search-empty h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.blog-search-empty p {
    font-size: 17px;
    line-height: 1.6;
    margin: 0;
}
