/* Mobile Blog Menu */
.mobile-blog-menu-container {
    display: none;
    z-index: 998;
}

.mobile-blog-title {
    display: none;
}

@media (max-width: 1199px) {
    .mobile-blog-menu-container {
        display: block;
    }
}

.mobile-blog-menu-container.sticky {
    background: #2d2d2d !important;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 998;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-blog-menu {
    padding: 20px 10px;
}

.mobile-blog-title {
    display: none;
    font-size: var(--heading-mobile-lg-size);
    color: #fff;
    line-height: var(--heading-mobile-lg-line);
}

.mobile-blog-menu-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 10px;
    position: relative;
}

/* Category Custom Dropdown */
.mobile-blog-categories {
    position: relative;
    z-index: 1001;
    /* Ensure dropdown is above search */
}

.custom-category-toggle,
.mobile-search-toggle {
    width: fit-content;
    padding: 0;
    background-color: transparent;
    color: #fff;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    font-family: 'Kumbh Sans', sans-serif;
    text-transform: uppercase;
    line-height: 22px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.single-post-template .custom-category-toggle,
.single-post-template .mobile-search-toggle {
    color: var(--rp-headlines);
}


.single-post-template .sticky .custom-category-toggle,
.single-post-template .sticky .mobile-search-toggle {
    color: #fff;
}

.single-post-template .mobile-blog-menu {
    border-bottom: 1px solid var(--rp-medium-grey);
    margin-bottom: 20px;
}

.single-post-template .sticky .mobile-blog-menu {
    border-bottom: none;
    margin-bottom: 0;
}

.custom-category-toggle svg {
    width: 12px;
    height: 7px;
    transition: transform 0.3s ease;
}

.custom-category-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.custom-category-list {
    margin: 16px 0 0 0;
    padding: 0;
    list-style: none;
    background-color: transparent;
    display: none;
    width: 100%;
}

.custom-category-list li {
    margin: 0;
}

.custom-category-list a {
    display: block;
    padding: 4px 0;
    color: #fff;
    width: 100%;
    text-decoration: none;
    transition: background-color 0.2s ease;

    font-family: 'Kumbh Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 28px;
}

.custom-category-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.custom-category-list .selected>a {
    color: var(--rp-pale-cyan, #00D1FF);
}

.mobile-search-toggle svg {
    width: 18px;
    height: 18px;
}

/* Search Content Full Width */
.mobile-blog-menu-wrapper.search-expanded .mobile-blog-categories,
.mobile-blog-menu-wrapper.search-expanded .mobile-search-toggle {
    display: none !important;
}

.mobile-blog-search {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.mobile-search-content {
    width: 100%;
    display: none;
    align-items: center;
    gap: 15px;
}

.mobile-search-content.active {
    display: flex !important;
}

.mobile-search-close {
    display: none !important;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.mobile-search-close:hover {
    opacity: 0.7;
}

.mobile-search-content form {
    margin: 0;
    display: flex;
    width: 100%;
    position: relative;
    background-color: transparent;
    border: 1px solid #fff;
    border-radius: 41px;
    overflow: hidden;
}


.mobile-search-content input[type="search"] {
    flex: 1;
    padding: 10px 20px;
    background: transparent !important;
    color: var(--rp-white) !important;
    border: none;
    font-size: 14px;
    outline: none;
}

.mobile-search-content input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.mobile-search-content button[type="submit"] {
    background-color: var(--rp-bright-red);
    /* Red color from image */
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Kumbh Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.mobile-search-content button[type="submit"]:hover {
    background-color: var(--rp-pale-cyan);
    color: var(--rp-headlines);
}

.mobile-search-content button[type="submit"] svg {
    width: 16px;
    height: 16px;
}

/* Override default search form styles if any */
.mobile-search-content .search-form {
    display: flex;
    width: 100%;
}

.single-post-template .mobile-search-content .search-form {
    border: 1px solid var(--rp-medium-grey);
}

.single-post-template .mobile-search-content .search-form input[type="search"] {
    color: var(--rp-headlines) !important;
}

.single-post-template .sticky .mobile-search-content .search-form input[type="search"] {
    color: var(--rp-white) !important;
}

.single-post-template .custom-category-list a {
    color: var(--rp-headlines) !important;
}

.single-post-template .sticky .custom-category-list a {
    color: var(--rp-white) !important;
}

.single-post-template .custom-category-toggle svg path {
    fill: var(--rp-headlines) !important;
}

.single-post-template .sticky .custom-category-toggle svg path {
    fill: var(--rp-white) !important;
}


@media (max-width: 768px) {
    .mobile-blog-title {
        display: none;
    }

    .mobile-blog-menu {
        padding: 20px 0;
    }
}

@media (max-width: 576px) {
    .mobile-search-toggle {
        justify-content: center;
    }
}

/* AJAX Loading Styles */
.posts-grid-loading {
    position: relative;
}

.posts-grid-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 245, 245, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.posts-grid-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pagination-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}