/* Просмотр фотографий галереи. */

.ph-viewer {
    position: fixed;
    inset: 0;
    z-index: 1080;                 /* выше меню сайта */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 14, 18, .94);
    -webkit-user-select: none;
    user-select: none;
}

.ph-viewer[hidden] { display: none; }

/* Пока открыт просмотр, страница под ним не прокручивается. */
body.ph-open { overflow: hidden; }

.ph-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4.5rem;
}

.ph-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 40px rgba(0, 0, 0, .55);
    transition: opacity .18s ease;
}

.ph-loading .ph-img { opacity: 0; }

/* ------------------------------------------------------------- кнопки */

.ph-btn {
    position: absolute;
    background: rgba(255, 255, 255, .10);
    border: 0;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-btn:hover,
.ph-btn:focus-visible { background: rgba(255, 255, 255, .24); outline: none; }
.ph-btn[hidden] { display: none; }

.ph-close {
    top: 1rem;
    right: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 2rem;
}

.ph-prev,
.ph-next {
    top: 50%;
    transform: translateY(-50%);
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.35rem;
}

.ph-prev { left: 1rem; }
.ph-next { right: 1rem; }

.ph-counter {
    position: absolute;
    bottom: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .75);
    font-size: .95rem;
    letter-spacing: .04em;
}

/* ---------------------------------------------------------- ожидание */

.ph-spinner {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: ph-spin .8s linear infinite;
}

.ph-loading .ph-spinner { opacity: 1; }

@keyframes ph-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ph-spinner { animation-duration: 2.4s; }
    .ph-img { transition: none; }
}

/* ------------------------------------------------------------ телефон */

@media (max-width: 600px) {
    .ph-stage { padding: 3.25rem .5rem 3.5rem; }
    .ph-prev, .ph-next { width: 2.75rem; height: 2.75rem; }
    .ph-prev { left: .35rem; }
    .ph-next { right: .35rem; }
    .ph-close { right: .5rem; }
}

/* Плитки галереи кликабельны - показываем это курсором. */
.mbr-gallery-item [data-full] { cursor: pointer; }
