/* Archive page wrapper */
.archive-masonry-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 0;
}

.archive-masonry-header {
    margin-bottom: 40px;
}

.archive-masonry-title {
    font-size: 2em;
    font-weight: 700;
    color: #0E2244;
    margin: 0 0 10px;
}

.archive-masonry-description {
    color: #696D70;
    font-size: 1.1em;
    line-height: 1.6;
}

.archive-masonry-page .masonry-blog-wrapper {
    padding-top: 0;
}

/* ---------------------------------------- */

.masonry-blog-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Category filter bar */
.masonry-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.masonry-cat-btn {
    padding: 8px 20px;
    border: 2px solid #E2E4E6;
    border-radius: 100px;
    background: #fff;
    color: #696D70;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.masonry-cat-btn:hover {
    border-color: #0E2244;
    color: #0E2244;
}

.masonry-cat-btn.active {
    background: #0E2244;
    border-color: #0E2244;
    color: #fff;
}

@media (max-width: 576px) {
    .masonry-category-filter {
        gap: 8px;
    }
    .masonry-cat-btn {
        padding: 7px 14px;
        font-size: 0.85em;
    }
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 992px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.masonry-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.masonry-item-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: #F6F6F6;
}

.masonry-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.masonry-item:hover .masonry-item-image img {
    transform: scale(1.05);
}

.masonry-item-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.masonry-item-meta {
    font-size: 0.85em;
    color: #696D70;
    margin-bottom: 10px;
}

.masonry-item-meta a {
    color: #696D70;
    text-decoration: none;
    transition: color 0.3s ease;
}

.masonry-item-meta a:hover {
    color: #E35205;
}

.masonry-item-title {
    font-size: 1.4em;
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 700;
}

.masonry-item-title a {
    color: #0E2244;
    text-decoration: none;
    transition: color 0.3s ease;
}

.masonry-item-title a:hover {
    color: #E35205;
}

.masonry-item-excerpt {
    color: #696D70;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.masonry-item-readmore {
    display: inline-block;
    color: #E35205;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.masonry-item-readmore:hover {
    color: #0E2244;
}

.masonry-loading,
.masonry-no-more {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.masonry-loading.active {
    display: block;
}

.masonry-no-more.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #F6F6F6;
    border-top: 4px solid #00C389;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.masonry-loading p,
.masonry-no-more p {
    color: #696D70;
    font-size: 1.1em;
    margin: 0;
}

.no-posts {
    text-align: center;
    color: #696D70;
    font-size: 1.2em;
    padding: 40px 20px;
}
