/**
 * GALLERY.CSS — Стили раздела «Gallery»
 * Masonry-кладка (CSS columns): фото разной высоты без обрезки.
 * Эстетика в духе сайта: ч/б → цвет при наведении, тонкие рамки, мягкие тени.
 */

.gallery-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-note {
    color: #777;
    font-family: 'IM Fell English', serif;
    font-size: 1rem;
    margin: 0 0 25px 0;
    text-align: center;
    font-style: italic;
}

/* Заголовок категории (для будущей разбивки) */
.gallery-category {
    font-family: 'Special Elite', cursive;
    color: #ccc;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 30px 0 18px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.gallery-group { margin-bottom: 10px; }

/* ===== MASONRY (CSS columns) ===== */
.gallery-masonry {
    column-count: 3;
    column-gap: 14px;
}

@media (max-width: 900px) {
    .gallery-masonry { column-count: 2; }
}
@media (max-width: 520px) {
    .gallery-masonry { column-count: 1; }
}

.gallery-item {
    display: inline-block;          /* корректная работа в колонках */
    width: 100%;
    margin: 0 0 14px 0;
    break-inside: avoid;            /* фото не разрывается между колонками */
    position: relative;
    border: 1px solid #1a1a1a;
    background: #0a0a0a;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.35s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item:hover {
    border-color: #444;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

/* Видимый фокус для клавиатурной навигации (a11y) */
.gallery-item:focus-visible {
    outline: 2px solid #888;
    outline-offset: -2px;
}

.gallery-item picture { display: block; }

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(75%) contrast(1.05) brightness(0.92);
    transition: filter 0.5s ease, transform 0.6s ease;
}

.gallery-item:hover img {
    filter: grayscale(0%) contrast(1) brightness(1);
    transform: scale(1.03);
}

/* Подпись (для будущего использования) */
.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 18px 10px 8px;
    font-family: monospace;
    font-size: 0.78rem;
    color: #cfcfcf;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus-visible .gallery-caption {
    opacity: 1;
}

.gallery-empty {
    color: #666;
    text-align: center;
    padding: 40px 0;
    font-family: 'IM Fell English', serif;
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-item img {
        transition: none;
    }
    .gallery-item:hover { transform: none; }
    .gallery-item:hover img { transform: none; }
}
