/* Header */
.site-header {
    background-color: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 1001;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    will-change: transform;
}

.site-header.is-hidden {
    transform: translateY(calc(-100% - 6px));
}

.site-header.is-elevated {
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.08);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: 1px solid #8080801a;
}

@media screen and (min-width: 769px){
	.header-inner{
		height: 65px;
	}
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #000;
    transition: 0.3s;
}

.site-logo {
    display: flex;
    align-items: center;
    padding-right: 20px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-right .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header-right .icon-btn:hover {
    background-color: var(--bg-off);
}

.desktop-secondary-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mobile-nav-container {
    display: none;
    justify-content: center;
    align-items: center;
    background: var(--bg-main);
    padding: 5px 20px;
    position: relative;
}

.mobile-nav-scroll {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-right: 52px;
}

.mobile-nav-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-nav-fade {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.82) 45%, rgba(255, 255, 255, 1) 100%);
}

.mobile-nav-links {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: calc(var(--container-width) - 40px);
}

.mobile-nav-link svg{
	height: 16px!important;
	width: 16px!important;
}

@media (max-width: 991px) {
    .desktop-secondary-nav {
        display: none;
    }

    .mobile-nav-container {
        display: flex;
    }
}

.mobile-nav-link {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 5px;
    color: var(--text-main);
    padding: 6px 10px;
    background: var(--bg-off);
    border-radius: 20px;
    transition: 0.2s;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}

.mobile-nav-link:hover {
    background: #e8e8e8;
    color: var(--accent);
}

.nav-separator {
    color: #ccc;
    margin: 0 8px;
    font-weight: 300;
    flex: 0 0 auto;
}

/* Dynamic Menu in Secondary Nav */
.mobile-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.mobile-nav-menu li a {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 5px;
    color: var(--text-main);
    padding: 6px 10px;
    background: var(--bg-off);
    border-radius: 20px;
    transition: 0.2s;
    text-decoration: none;
    line-height: 1.2;
}

.mobile-nav-menu li a:hover {
    background: #e8e8e8;
    color: var(--accent);
}

.mobile-nav-menu li a svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Main Footer */
.site-footer {
    background-color: #000;
    color: #fff;
    padding: 60px 20px 30px;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    color: #fff;
    border-right: none;
    padding-right: 0;
}

.footer-bottom {
    text-align: center;
    color: #777;
    font-size: 0.85rem;
}

/* App Drawer */
.drawer-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-height));
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.app-drawer {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    max-width: 440px;
    height: calc(100% - var(--header-height));
    background: var(--bg-main);
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: top 0.3s ease;
    display: flex;
    flex-direction: column;
}

.app-drawer.active {
    top: var(--header-height);
}

.drawer-header {
    display: none;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: var(--text-main);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-main);
    margin-top: 10%;
}

.drawer-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-section.bg-off {
    background-color: var(--bg-off);
}

.drawer-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.drawer-link {
    display: block;
    padding: 8px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-link:hover {
    color: var(--text-main);
}

.drawer-link.no-color {
    color: var(--text-main);
}

.drawer-link.no-color:hover {
    color: var(--accent);
}

.drawer-nav-menu.drawer-grid {
    display: block;
    column-count: 2;
    column-gap: 28px;
    margin: 0;
}

.drawer-nav-menu.drawer-grid li {
    list-style: none;
    break-inside: avoid;
    margin: 0 0 4px;
}

.drawer-nav-menu.drawer-grid li a {
    display: block;
    padding: 8px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.drawer-nav-menu.drawer-grid li a:hover {
    color: var(--text-main);
}

.drawer-no-accent .drawer-link,
.drawer-nav-menu.drawer-grid.drawer-no-accent li a {
    color: var(--text-main);
    font-weight: 500;
}

.drawer-no-accent .drawer-link:hover,
.drawer-nav-menu.drawer-grid.drawer-no-accent li a:hover {
    color: var(--accent);
}

@media (max-width: 420px) {
    .drawer-nav-menu.drawer-grid {
        column-gap: 18px;
    }
}

.social-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.social-icon svg {
    width: 14px;
    height: 14px;
}

.social-icon.fb {
    color: #1877f2;
}

.social-icon.ig {
    color: #e1306c;
}

.social-icon.threads {
    color: #000;
    font-size: 18px;
    line-height: 1;
}

.social-icon.pin {
    color: #e60023;
}

.social-icon.x {
    color: #000;
}

.social-icon.news {
    color: #4285f4;
}

.social-drawer-link {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    text-decoration: none;
    transition: 0.2s;
}

.social-drawer-link:hover {
    color: var(--accent);
}

/* Trending Overlay */
.trending-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trending-overlay.active {
    opacity: 1;
    visibility: visible;
}

.trending-modal {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: #fff;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.trending-overlay.active .trending-modal {
    transform: scale(1) translateY(0);
}

.trending-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trending-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trending-close {
    background: var(--bg-off);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: 0.2s;
}

.trending-close:hover {
    background: #eee;
    color: #000;
    transform: rotate(90deg);
}

.trending-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px 40px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    counter-reset: trending-counter;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    padding: 5px;
    border-radius: 12px;
    background: transparent;
    transition: 0.2s;
    position: relative;
}

.trending-item:hover {
    background: #f8f9fa;
    transform: translateX(8px);
}

.trending-thumb {
    width: 96px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    object-position: center;
}

.trending-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 15px;
    color: var(--text-muted);
}

.trending-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .header-right .user-btn.mobile-hide {
        display: none;
    }

    .mobile-nav-container {
        display: flex;
    }

    .footer-top {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .site-footer {
        padding: 40px 20px 20px;
    }

    .drawer-overlay {
        top: 104px;
        height: calc(100% - 104px);
    }

    .app-drawer {
        height: calc(100% - 104px);
    }

    .app-drawer.active {
        top: 104px;
    }
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    display: flex;
    opacity: 1;
}

.search-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 20px;
}

.close-search {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    font-size: 40px;
    cursor: pointer;
    color: #111;
    line-height: 1;
    transition: transform 0.2s;
}

.close-search:hover {
    transform: rotate(90deg);
    color: var(--accent);
}

#rest-search-input {
    width: 100%;
    max-width: 600px;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 15px 0;
    border: none;
    border-bottom: 3px solid var(--accent);
    background: transparent;
    outline: none;
    color: #111;
    text-align: center;
}

.search-results-list {
    margin-top: 50px;
    width: 100%;
    max-width: 800px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-result-post {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.search-result-post .post-image-wrap {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
}

.search-result-post .post-image-wrap img {
    border-radius: 8px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1 1 auto;
    min-width: 0;
}

.search-result-post h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1d2327;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    #rest-search-input {
        font-size: 1.8rem;
    }

    .search-result-post {
        gap: 15px;
    }

    .search-result-post .post-image-wrap {
        width: 80px;
        height: 60px;
    }

    .close-search {
        top: 20px;
        right: 20px;
        font-size: 30px;
    }

    .trending-item {
        gap: 14px;
    }

    .trending-thumb {
        width: 88px;
        height: 66px;
    }

    .trending-title {
        font-size: 1rem;
    }
}
