/* Увеличение картинок по клику (js/zoom.js): снаряжение и статьи блога */
.equip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.equip-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Место под полосу прокрутки резервируется всегда: иначе при открытии зума
   (overflow: hidden) полоса пропадает и вся страница сдвигается вправо */
html {
    scrollbar-gutter: stable;
}

body.zoom-open {
    overflow: hidden;
}

.equipment-image-zoom {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 11000;
    cursor: pointer;
    width: auto !important;
    height: auto !important;
    animation: zoomIn 0.4s ease-out;
}

.equipment-image-zoom.closing {
    animation: zoomOut 0.3s ease-in forwards;
}

.equipment-image-zoom img {
    max-width: 96vw;
    max-height: 96vh;
    display: block;
    width: auto;
    height: auto;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
}

.zoom-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 26px;
    line-height: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

/* Вытянутая картинка на телефоне: в натуральную величину, листается вбок */
.equipment-image-zoom.wide {
    inset: 0;
    transform: none;
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    overflow: auto;
    padding: 0 2vw;
    animation: zoomFade 0.3s ease-out;
}

.equipment-image-zoom.wide.closing {
    animation: zoomFade 0.3s ease-in reverse forwards;
}

.equipment-image-zoom.wide img {
    flex: none;
    max-width: none;
    max-height: 90vh;
    margin-right: 2vw;
}

.equipment-image-zoom.wide .zoom-close {
    position: fixed;
    top: 12px;
    right: 12px;
}

@keyframes zoomIn {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes zoomOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
}

@keyframes zoomFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Картинки в тексте статей блога: по центру, не шире текста, одинаковая рамка
   (встроенные в статьи float, ширина и высота убираются шаблоном — article/default.php) */
.article-details [itemprop="articleBody"] img.article-zoom {
    display: block;
    float: none;
    max-width: 100%;
    height: auto;
    margin: 0.75rem auto;
    border: 1px solid #bab6b657;
    border-radius: 6px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

/* Картинки от 800px — на всю ширину колонки */
.article-details [itemprop="articleBody"] img.article-img-full {
    width: 100%;
}

/* Главная картинка статьи — по центру над заголовком, тоже увеличивается */
.article-details .article-full-image {
    float: none !important;
    margin: 0 0 1.5rem;
    text-align: center;
}

.article-details .article-full-image img {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    border-radius: 6px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .article-details [itemprop="articleBody"] img.article-zoom:hover,
    .article-details .article-full-image img:hover {
        transform: scale(1.02);
    }
}

/* Статьи блога: текст и картинки колонкой 900px по центру, главная картинка над заголовком — в своём размере */
.ew-blog-narrow .article-details > *:not(.article-full-image) {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.ew-blog-narrow [itemprop="articleBody"] {
    font-size: 1.0625rem;
    line-height: 1.7;
}
