/* CLIENTS PAGE SPECIAL STYLES */
.clients-page {
    padding-top: 140px;
    background: #ffffff;
}

.clients-header {
    text-align: center;
    margin-bottom: 80px;
}

.clients-header h1 {
    font-size: 3rem;
    font-family: 'Poppins', sans-serif;
    color: var(--primary);
    margin-bottom: 15px;
}

.portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.category-group {
    margin-bottom: 100px;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.category-info h2 {
    font-size: 1.5rem;
    white-space: nowrap;
    color: var(--primary);
}

.category-info .line {
    height: 1px;
    background: #e2e8f0;
    width: 100%;
}

/* MASONRY GRID SYSTEM */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.m-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #f1f5f9;
    aspect-ratio: 4/3;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

.m-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.m-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

.m-item:hover img {
    transform: scale(1.1);
}

/* Clickable cursor */
.zoom-target {
    cursor: zoom-in;
}

/* Modal Background */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.95); /* Deep slate to match theme */
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

/* Modal Content (Image) */
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform:scale(0.8); opacity: 0;}
    to {transform:scale(1); opacity: 1;}
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    color: var(--accent2);
    transform: rotate(90deg);
}

@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .clients-header h1 { font-size: 2rem; }
    .masonry-grid { grid-template-columns: 1fr; }
}

/* ================= MOBILE MENU ENGINE ================= */
@media (max-width: 900px) {
    .nav { padding: 15px 5% !important; }

    .nav-toggle { 
        display: flex !important; 
        flex-direction: column;
        gap: 5px;
        z-index: 2000; 
        cursor: pointer;
    }

    .nav-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--primary);
        transition: 0.3s;
    }

    .nav-actions {
        display: flex !important; 
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: center; 
        justify-content: center;
        z-index: 1500;
        transform: translateY(-100%); 
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
    }

    .nav-actions.active {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .nav-actions a {
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease;
        margin: 15px 0 !important;
        margin-left: 0 !important; /* FIX: Prevents the left-side jump */
        text-align: center;
    }

    .nav-actions.active a {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    .nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle.active span:nth-child(2) { opacity: 0; }
    .nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}