/* ========================================
   RESPONSIVE NAVIGATION - MOBILE & TABLET
   Modern Full-Screen Overlay with Animations
   ======================================== */

/* ---- Hamburger Button ---- */
.hamburger-btn {
    display: none;
    position: relative;
    width: 32px;
    height: 22px;
    cursor: pointer;
    z-index: 1020;
    background: none;
    border: none;
    padding: 0;
    outline: none;
}

.hamburger-btn span {
    display: block;
    position: absolute;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    left: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    transform-origin: center;
}

.hamburger-btn span:nth-child(1) {
    top: 0;
}

.hamburger-btn span:nth-child(2) {
    top: 10px;
    transition: all 0.2s ease;
}

.hamburger-btn span:nth-child(3) {
    top: 20px;
}

/* Hamburger → X animation */
.hamburger-btn.is-active span:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
}

.hamburger-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.is-active span:nth-child(3) {
    top: 10px;
    transform: rotate(-45deg);
}

/* Glow effect on hover */
.hamburger-btn:hover span {
    background: #D63447;
    box-shadow: 0 0 8px rgba(214, 52, 71, 0.6);
}

/* Show hamburger on mobile/tablet */
@media (max-width: 991.98px) {
    .hamburger-btn {
        display: block !important;
        position: fixed !important;
        top: 25px !important;
        right: 25px !important;
        left: auto !important;
        z-index: 10000 !important;
        transform: none !important;
        margin: 0 !important;
        float: none !important;
    }

    /* Hide the entire desktop navigation bar */
    .unslate_co--site-nav,
    .unslate_co--site-nav.scrolled,
    .unslate_co--site-nav.scrolled.awake,
    .unslate_co--site-nav.scrolled.sleep {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ---- Full-Screen Overlay Menu ---- */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1010;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
}

/* Dark backdrop with blur */
.mobile-nav-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle gradient accent line at top */
.mobile-nav-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #D63447, #ff6b6b, #D63447, transparent);
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.5s ease 0.3s, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.mobile-nav-overlay.is-open {
    pointer-events: auto;
    visibility: visible;
}

.mobile-nav-overlay.is-open::before {
    opacity: 1;
}

.mobile-nav-overlay.is-open::after {
    opacity: 1;
    transform: scaleX(1);
}

/* ---- Close Button ---- */
.mobile-nav-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 1015;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    transition: all 0.5s cubic-bezier(0.68, -0.6, 0.32, 1.6) 0.4s;
}

.mobile-nav-overlay.is-open .mobile-nav-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.mobile-nav-close:hover {
    border-color: #D63447;
    background: rgba(214, 52, 71, 0.1);
    transform: rotate(90deg) scale(1.1);
    transition: all 0.3s ease;
}

.mobile-nav-close span {
    display: block;
    position: absolute;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.mobile-nav-close span:first-child {
    transform: rotate(45deg);
}

.mobile-nav-close span:last-child {
    transform: rotate(-45deg);
}

/* ---- Navigation Items Container ---- */
.mobile-nav-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 80px 30px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Navigation Links ---- */
.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.mobile-nav-links li {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.mobile-nav-links li a {
    display: block;
    font-size: 1.6rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 14px 10px;
    position: relative;
    letter-spacing: 0.05em;
    transition: color 0.3s ease, transform 0.3s ease;
    transform: translateY(100%);
    opacity: 0;
}

/* Staggered entrance animation */
.mobile-nav-overlay.is-open .mobile-nav-links li a {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(1) a {
    transition-delay: 0.15s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(2) a {
    transition-delay: 0.20s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(3) a {
    transition-delay: 0.25s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(4) a {
    transition-delay: 0.30s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(5) a {
    transition-delay: 0.35s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(6) a {
    transition-delay: 0.40s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(7) a {
    transition-delay: 0.45s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(8) a {
    transition-delay: 0.50s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(9) a {
    transition-delay: 0.55s;
}

.mobile-nav-overlay.is-open .mobile-nav-links li:nth-child(10) a {
    transition-delay: 0.60s;
}

/* Underline hover effect */
.mobile-nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #D63447, #ff6b6b);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.mobile-nav-links li a:hover {
    color: #fff;
    transform: scale(1.05);
}

.mobile-nav-links li a:hover::after {
    width: 60%;
    left: 20%;
}

/* Active link glow */
.mobile-nav-links li a.active {
    color: #D63447;
    text-shadow: 0 0 20px rgba(214, 52, 71, 0.3);
}

.mobile-nav-links li a.active::after {
    width: 40%;
    left: 30%;
    background: #D63447;
    box-shadow: 0 0 10px rgba(214, 52, 71, 0.5);
}

/* ---- Decorative floating particles ---- */
.mobile-nav-overlay .nav-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(214, 52, 71, 0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.mobile-nav-overlay.is-open .nav-particle {
    opacity: 1;
    animation: floatParticle 6s ease-in-out infinite;
}

.nav-particle:nth-child(1) {
    width: 60px;
    height: 60px;
    top: 10%;
    left: 8%;
    animation-delay: 0s !important;
}

.nav-particle:nth-child(2) {
    width: 40px;
    height: 40px;
    top: 70%;
    right: 10%;
    animation-delay: 2s !important;
}

.nav-particle:nth-child(3) {
    width: 25px;
    height: 25px;
    bottom: 15%;
    left: 15%;
    animation-delay: 4s !important;
}

@keyframes floatParticle {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-25px) scale(1.15);
    }
}

/* ---- Social links in mobile menu ---- */
.mobile-nav-social {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s;
}

.mobile-nav-overlay.is-open .mobile-nav-social {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-social a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-nav-social a:hover {
    border-color: #D63447;
    color: #D63447;
    background: rgba(214, 52, 71, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(214, 52, 71, 0.2);
}

/* ---- Tablet adjustments (768px - 991px) ---- */
@media (min-width: 768px) and (max-width: 991.98px) {
    .mobile-nav-links li a {
        font-size: 2rem;
        padding: 18px 10px;
        letter-spacing: 0.08em;
    }

    .mobile-nav-social a {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* ---- Small phone adjustments ---- */
@media (max-width: 375px) {
    .mobile-nav-links li a {
        font-size: 1.3rem;
        padding: 12px 8px;
    }

    .mobile-nav-content {
        padding: 70px 20px 30px;
    }
}

/* ---- RTL Support ---- */
html[dir="rtl"] .mobile-nav-close {
    right: auto;
    left: 25px;
}

html[dir="rtl"] .mobile-nav-links li a {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    letter-spacing: 0;
}

html[dir="rtl"] .mobile-nav-overlay::after {
    background: linear-gradient(270deg, transparent, #D63447, #ff6b6b, #D63447, transparent);
}

/* ---- Scrolled navbar hamburger visibility ---- */
/* Nav is fully hidden on mobile, no scrolled state needed */
@media (max-width: 991.98px) {
    .unslate_co--site-nav.scrolled {
        display: none !important;
    }
}

/* ---- RTL hamburger position ---- */
html[dir="rtl"] .hamburger-btn {
    right: auto !important;
    left: 25px !important;
}

/* ---- Body scroll lock when menu open ---- */
body.mobile-nav-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ---- Hide old offcanvas mobile menu (legacy from style.css) ---- */
.unslate_co--site-mobile-menu {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ---- Prevent horizontal overflow on mobile ---- */
@media (max-width: 991.98px) {

    html {
        overflow-x: hidden !important;
    }

    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .unslate_co--site-wrap,
    .unslate_co--site-inner {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Hide GSAP reveal covers that overflow with translate(101%) */
    .gsap-reveal .cover,
    .gsap-reveal-img .reveal-wrap .cover,
    .gsap-reveal-hero .reveal-wrap .cover {
        display: none !important;
    }

    /* Portfolio & section overflow containment */
    .unslate_co--section,
    .portfolio-wrapper,
    #posts,
    .container {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Constrain row negative margins */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .row>[class*="col-"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Portfolio items fit viewport */
    .isotope-mb-2,
    .portfolio-item {
        max-width: 100% !important;
    }

    .portfolio-item img {
        max-width: 100% !important;
        height: auto !important;
    }
}