/* =========================================
   Modern Consultancy Projects — Light Theme
   Gallery Grid + Filter Tabs + Modal
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Wrapper & Hero --- */
.modern-consultancy-wrapper {
    background-color: #f8fafc;
    padding: 80px 20px 60px;
    font-family: 'Inter', sans-serif;
    color: #334155;
}

.modern-consultancy-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 50px;
}

.modern-consultancy-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.modern-consultancy-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 2px;
}

.modern-consultancy-header p {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.65;
    margin-top: 24px;
}

/* --- Filter Tabs --- */
.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.filter-tab {
    padding: 10px 22px;
    border: 1.5px solid #cbd5e1;
    border-radius: 50px;
    background: #ffffff;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.filter-tab.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

/* --- Gallery Grid --- */
.modern-consultancy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-tile {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4 / 3;
}

.gallery-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -8px rgba(0,0,0,0.1);
}

.gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-tile:hover img {
    transform: scale(1.06);
}

.tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 18px 18px;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.tile-domain {
    display: inline-block;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.tile-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    margin: 0;
}

.tile-view-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.92);
    color: #3b82f6;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gallery-tile:hover .tile-view-label {
    opacity: 1;
}

/* Hidden tiles during filtering */
.gallery-tile.hidden {
    display: none;
}

/* --- Modal (dialog) --- */
.project-modal {
    border: none;
    border-radius: 24px;
    padding: 0;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: #ffffff;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    animation: modalSlideUp 0.35s ease forwards;
    /* Native dialog centering */
    margin: auto;
    inset: 0;
    position: fixed;
}

@keyframes modalSlideUp {
    from { opacity: 0; margin-top: 5vh; }
    to   { opacity: 1; margin-top: auto; }
}

.project-modal::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #475569;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.modal-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Modal Image Gallery */
.modal-gallery {
    position: relative;
    width: 100%;
    height: 360px;
    background: #f1f5f9;
    overflow: hidden;
}

.modal-gallery img,
.modal-gallery iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    background: #f1f5f9;
}

.modal-gallery img.active-img,
.modal-gallery iframe.active-img {
    display: block;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #334155;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.gallery-nav-btn:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-nav-btn.prev { left: 12px; }
.gallery-nav-btn.next { right: 12px; }

.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: rgba(255,255,255,0.85);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

/* Modal Content */
.modal-body {
    padding: 36px 40px 40px;
}

.modal-domain-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
    line-height: 1.35;
}

.modal-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #3b82f6;
    margin-bottom: 8px;
    margin-top: 20px;
}

.modal-section-label:first-of-type {
    margin-top: 0;
}

.modal-text {
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 0;
}

/* --- CTA Banner --- */
.modern-consultancy-cta {
    margin-top: 80px;
    text-align: center;
    background: #ffffff;
    padding: 60px 24px;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.modern-consultancy-cta h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.modern-consultancy-cta p {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 28px;
}

.modern-btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: #3b82f6;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.modern-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .modern-consultancy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .modal-gallery { height: 280px; }
    .modal-body { padding: 28px 24px 32px; }
    .modal-title { font-size: 1.4rem; }
}

@media (max-width: 576px) {
    .modern-consultancy-header h1 { font-size: 2rem; }
    .modern-consultancy-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
    .filter-tabs { gap: 8px; }
    .filter-tab { padding: 8px 16px; font-size: 0.82rem; }
    .modal-gallery { height: 220px; }
    .modal-body { padding: 24px 20px 28px; }
    .modal-title { font-size: 1.25rem; }
    .modern-consultancy-cta { padding: 40px 20px; }
    .gallery-tile { aspect-ratio: 3 / 2; }
}
