/* Moon Technolabs Style Blog Listing CSS */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&display=swap');

.moon-blog-listing {
    font-family: 'Outfit', sans-serif;
    background-color: #fcfdfe;
    padding: 80px 0;
    color: #333;
}

/* Header & Search Area */
.moon-blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.moon-blog-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
}

.moon-search-wrapper {
    position: relative;
    width: 320px;
}

.moon-search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    background-color: #fff;
    font-size: 0.95rem;
    color: #555;
    transition: all 0.3s;
}

.moon-search-input:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.1);
}

.moon-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

/* Category Navigation */
.moon-category-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 60px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    position: relative;
}

.moon-cat-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.moon-cat-item {
    text-decoration: none;
    color: #777;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
    position: relative;
    cursor: pointer;
}

.moon-cat-item:hover, .moon-cat-item.active {
    color: #ff6b00;
}

.moon-cat-item.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #ff6b00;
}

/* More Dropdown */
.moon-more-wrapper {
    position: relative;
    display: inline-block;
}

.moon-more-btn {
    color: #ff6b00;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 0;
}

.moon-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 10px 0;
}

.moon-more-wrapper:hover .moon-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.moon-dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

.moon-dropdown-item:hover {
    background-color: #f8f9fb;
    color: #ff6b00;
}

/* Post Cards */
.moon-card {
    border: none;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.moon-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.moon-card-img-wrapper {
    position: relative;
    height: 220px;
}

.moon-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moon-card-badge {
    position: absolute;
    bottom: -15px;
    left: 20px;
    background-color: #ff6b00;
    color: #fff;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.moon-card-body {
    padding: 35px 20px 20px;
    flex-grow: 1;
}

.moon-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #1a1a1a;
    transition: color 0.3s;
}

.moon-card-title a {
    color: inherit;
    text-decoration: none;
}

.moon-card:hover .moon-card-title {
    color: #ff6b00;
}

.moon-card-footer {
    padding: 20px;
    border-top: 1px solid #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.moon-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.moon-author img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.moon-author-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
}

.moon-post-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 0.85rem;
}

#moon-load-more-btn {
    background-color: #ff6b00;
    border: none;
    transition: background-color 0.3s, transform 0.2s;
}

#moon-load-more-btn:hover {
    background-color: #e66000;
    transform: scale(1.05);
}

#moon-load-more-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#moon-posts-grid {
    transition: opacity 0.3s ease;
}

#moon-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    margin: 0 !important;
}

#moon-loader .spinner-border {
    width: 4rem;
    height: 4rem;
    color: #ff6b00 !important;
    border-width: 0.35em;
}

@media (max-width: 991px) {
    .moon-blog-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }
    .moon-blog-header h1 {
        font-size: 2.2rem;
    }
    .moon-search-wrapper {
        width: 100%;
        max-width: 100%; /* Take full width on mobile */
    }
    .moon-category-nav {
        flex-wrap: nowrap;
        padding-bottom: 0;
        gap: 10px;
        overflow: visible;
    }
    .moon-cat-scroll-container {
        flex-grow: 1;
        overflow-x: auto;
        padding-bottom: 15px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        position: relative;
        /* Mask/Fade effect for scrolling */
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }
    .moon-cat-scroll-container::-webkit-scrollbar {
        display: none;
    }
    .moon-cat-left {
        display: flex;
        flex-wrap: nowrap;
        gap: 20px;
    }
    .moon-cat-item {
        font-size: 0.95rem;
        white-space: nowrap;
    }
    .moon-more-wrapper {
        position: relative;
        flex-shrink: 0;
        background: #fcfdfe; /* Match background to cover fade if needed */
        padding-left: 10px;
        padding-bottom: 15px;
    }
    .moon-dropdown-menu {
        width: 200px;
        right: 0;
        left: auto;
        top: 100%;
        border-radius: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
}

@media (max-width: 767px) {
    .moon-blog-listing {
        padding: 40px 0;
    }
    .moon-blog-header h1 {
        font-size: 1.8rem;
    }
    .moon-card-img-wrapper {
        height: 200px;
    }
    .moon-card-body {
        padding: 25px 15px 15px;
    }
    .moon-card-title {
        font-size: 1.15rem;
        margin-bottom: 15px;
    }
    .moon-card-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    .moon-author-name {
        font-size: 0.8rem;
    }
    .moon-post-date {
        font-size: 0.75rem;
    }
}
