body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 40px 20px;
}

a, a:visited {
    color: #ffffff;
}

.head {
    text-align: center;
    margin-bottom: 40px;
}

.head h1 {
    font-weight: 600;
    margin: 0 0 10px 0;
}

.head p {
    color: #9a9a9a;
    margin: 0;
}

/* Сетка: сама подбирает количество колонок под ширину экрана */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.gallery img:hover {
    transform: scale(1.03);
    opacity: 0.85;
}

.back {
    display: block;
    text-align: center;
    margin-top: 40px;
    font-size: 18px;
}

/* Просмотр фото на весь экран */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10;
    justify-content: center;
    align-items: center;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox .close,
.lightbox .prev,
.lightbox .next {
    position: absolute;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    padding: 20px;
}

.lightbox .close {
    top: 10px;
    right: 20px;
}

.lightbox .prev {
    left: 10px;
}

.lightbox .next {
    right: 10px;
}
