﻿body {
    margin: 0;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background: #ffffff;
    color: #111827;
    -webkit-font-smoothing: antialiased;
}

.gallery-page {
    max-width: 1800px;
    margin: auto;
    padding: 42px 22px 60px;
}

.gallery-header {
    margin-bottom: 34px;
}

    .gallery-header h1 {
        margin: 0;
        font-size: clamp(34px,5vw,62px);
        font-weight: 800;
        letter-spacing: -2px;
        color: #0f172a;
    }

    .gallery-header p {
        margin-top: 12px;
        color: #64748b;
        font-size: 15px;
        font-weight: 500;
    }

/* GRID */

.gallery-grid {
    column-count: 5;
    column-gap: 18px;
}

.gallery-card {
    position: relative;
    break-inside: avoid;
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    cursor: pointer;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 10px rgba(15,23,42,.03), 0 18px 40px rgba(15,23,42,.06);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

    .gallery-card:hover {
        transform: translateY(-4px);
        border-color: #e2e8f0;
        box-shadow: 0 8px 20px rgba(15,23,42,.05), 0 25px 55px rgba(15,23,42,.10);
    }

    .gallery-card img {
        width: 100%;
        display: block;
        transition: transform .45s ease;
    }

    .gallery-card:hover img {
        transform: scale(1.025);
    }

    /* IMAGE OVERLAY */

    .gallery-card::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( to top, rgba(0,0,0,.08), transparent 40% );
        opacity: 0;
        transition: .3s;
        pointer-events: none;
    }

    .gallery-card:hover::after {
        opacity: 1;
    }

/* PAGINATION */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 50px;
}

    .pagination button {
        min-width: 46px;
        height: 46px;
        border-radius: 14px;
        border: 1px solid #e2e8f0;
        background: #fff;
        color: #0f172a;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        transition: .22s;
        box-shadow: 0 4px 12px rgba(15,23,42,.04);
    }

        .pagination button:hover {
            transform: translateY(-2px);
            border-color: #cbd5e1;
            box-shadow: 0 10px 24px rgba(15,23,42,.08);
        }

        .pagination button.active {
            background: #0f172a;
            color: #fff;
            border-color: #0f172a;
        }

/* MODAL */

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: .25s ease;
}

    .image-modal.active {
        opacity: 1;
        visibility: visible;
    }

    .image-modal img {
        max-width: 96%;
        max-height: 92vh;
        border-radius: 24px;
        box-shadow: 0 15px 35px rgba(15,23,42,.10), 0 35px 80px rgba(15,23,42,.18);
    }

/* CLOSE */

.close-modal {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(15,23,42,.08);
    transition: .22s;
}

    .close-modal:hover {
        transform: scale(1.06);
        background: #f8fafc;
    }

/* SCROLLBAR */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #dbe4ee;
    border-radius: 20px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #cbd5e1;
    }

/* RESPONSIVE */

@media(max-width:1500px) {
    .gallery-grid {
        column-count: 4;
    }
}

@media(max-width:1100px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media(max-width:700px) {

    .gallery-page {
        padding: 20px 12px 40px;
    }

    .gallery-grid {
        column-count: 2;
        column-gap: 10px;
    }

    .gallery-card {
        margin-bottom: 10px;
        border-radius: 18px;
    }

    .gallery-header {
        margin-bottom: 22px;
    }

        .gallery-header p {
            font-size: 14px;
        }

    .pagination {
        gap: 8px;
        margin-top: 34px;
    }

        .pagination button {
            min-width: 42px;
            height: 42px;
            border-radius: 12px;
        }

    .image-modal {
        padding: 14px;
    }

        .image-modal img {
            border-radius: 18px;
        }

    .close-modal {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        top: 14px;
        right: 14px;
    }
}
