/* Страница «Наши работы» (archive-portfolio.php): сетка фото одного размера + просмотр фото.
   Исходник тех же стилей — assets/sass/block/_portfolio.scss */
.portfolio-page {
    padding: 10px 0 60px;
}
.portfolio-page h1 {
    position: relative;
    margin: 0 0 32px;
    font-family: "Poiret One", sans-serif;
    font-size: 40px;
    line-height: 1.15;
}
.portfolio-page h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 116px;
    height: 4px;
    background: var(--deepcooling);
}
.portfolio-page .portfolio-page__lead {
    max-width: 800px;
    margin: 0 0 30px;
    line-height: 1.6;
}

/* Сетка: квадратные плитки, фото обрезается по центру */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.portfolio-grid li {
    margin: 0;
}
.portfolio-grid a {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background-color: #f0f0f0;
    box-shadow: var(--box-shadow-x);
    cursor: zoom-in;
}
.portfolio-grid img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.portfolio-grid a:hover img {
    transform: scale(1.04);
}
.portfolio-grid a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* Просмотр фото */
html.lb-open {
    overflow: hidden;
}
.lb {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100001; /* выше баннера cookie (100000) */
    background: rgba(8, 18, 32, 0.94);
}
.lb[hidden] {
    display: none;
}
.lb__stage {
    position: absolute;
    top: 56px;
    right: 72px;
    bottom: 64px;
    left: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.lb__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}
.lb--zoomed .lb__stage {
    display: block;
}
.lb--zoomed .lb__img {
    max-width: none;
    max-height: none;
    margin: 0 auto;
    cursor: grab;
}
.lb__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.2s;
}
.lb__btn:hover,
.lb__btn:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}
.lb__btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.lb__close {
    top: 8px;
    right: 12px;
}
.lb__prev,
.lb__next {
    top: 50%;
    transform: translateY(-50%);
}
.lb__prev {
    left: 12px;
}
.lb__next {
    right: 12px;
}
.lb__counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}
.lb__caption {
    position: absolute;
    right: 20px;
    bottom: 20px;
    left: 20px;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
}

/*ADAPTIVE*/
/* TAB */
@media only screen and (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
/* PHONE */
@media only screen and (max-width: 576px) {
    .portfolio-page h1 {
        font-size: 30px;
    }
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .lb__stage {
        top: 56px;
        right: 0;
        bottom: 72px;
        left: 0;
    }
    .lb__prev,
    .lb__next {
        top: auto;
        bottom: 12px;
        transform: none;
        width: 44px;
        height: 44px;
    }
    .lb__caption {
        right: 64px;
        bottom: 22px;
        left: 64px;
        font-size: 13px;
    }
}
