/* ===== 7. Gallery · layout + «Классика»: tight mosaic of square cells ===== */
.hm-gal__eyebrow,
.hm-gal__lead { display: none; }
.hm-gal__title em { font-style: normal; }

/* The wrapper is a size container so grid rows can stay square (row = column width) */
.hm-gal__wrap { container-type: inline-size; }
.hm-gal__grid {
    --_cols: 6;
    --_gap: 8px;
    display: grid;
    grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
    grid-auto-rows: calc((100cqw - (var(--_cols) - 1) * var(--_gap)) / var(--_cols));
    grid-auto-flow: dense;
    gap: var(--_gap);
}
.hm-gal__item {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--hm-radius-media);
    background: var(--hm-c-alt);
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}
.hm-gal__item--wide { grid-column: span 2; }
.hm-gal__item--tall { grid-row: span 2; }
.hm-gal__item--big { grid-column: span 2; grid-row: span 2; }
.hm-gal__frame { position: absolute; inset: 0; display: block; overflow: hidden; }
.hm-gal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--focus, 50% 50%);
    transition: transform .9s var(--hm-ease);
}
.hm-gal__caption { display: none; }

/* Hover: soft darkening + round «+» badge */
.hm-gal__item::before,
.hm-gal__item::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--hm-dur) var(--hm-ease), transform var(--hm-dur) var(--hm-ease);
}
.hm-gal__item::before { inset: 0; z-index: 1; background: rgba(0, 0, 0, .22); }
.hm-gal__item::after {
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background:
        linear-gradient(currentColor, currentColor) center / 16px 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) center / 1.5px 16px no-repeat,
        rgba(255, 255, 255, .92);
    color: var(--hm-c-text);
    transform: scale(.8);
}
.hm-gal__item:hover .hm-gal__img { transform: scale(1.05); }
.hm-gal__item:hover::before,
.hm-gal__item:hover::after,
.hm-gal__item:focus-visible::before,
.hm-gal__item:focus-visible::after { opacity: 1; transform: none; }
.hm-gal__item:focus-visible { outline-offset: -2px; }

@media (max-width: 1023px) {
    .hm-gal__grid { --_cols: 4; }
}
@media (max-width: 767px) {
    .hm-gal__grid { --_cols: 2; --_gap: 6px; }
    .hm-gal__item::after { display: none; }
}
