/* Адаптивность для слайд-шоу Phoca Gallery */
.phocagalleryslideshow {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
}

.phocagalleryslideshow img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .phocagalleryslideshow {
        max-width: 95% !important;
    }
}
/* Адаптивная пагинация для Phoca Gallery */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination li {
    margin: 2px;
    white-space: nowrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
}

.pagination .active a,
.pagination .active span {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .pagination a,
    .pagination span {
        padding: 4px 8px;
        font-size: 14px;
    }
}
/* Скрываем автоматический заголовок меню "Галерея" на странице слайд-шоу */
.com-content-article .page-header h1,
.com-content-article .page-header,
.com-content-article h1[itemprop="headline"] {
    display: none;
}

/* Если заголовок имеет другой класс, можно попробовать скрыть и его */
.phocagalleryslideshow + .page-header,
.phocagalleryslideshow + h1 {
    display: none;
}
/* Адаптивное слайд-шоу Phoca Gallery */
.responsive-slideshow-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.responsive-slideshow-wrapper .pg-slideshow,
.responsive-slideshow-wrapper .phocagalleryslideshow,
.responsive-slideshow-wrapper img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Для мобильных в горизонтальной ориентации */
@media (orientation: landscape) {
    .responsive-slideshow-wrapper .pg-slideshow,
    .responsive-slideshow-wrapper .phocagalleryslideshow {
        max-height: 90vh !important;
        width: auto !important;
    }
}

/* Принудительно разрешаем зум на всём сайте */
html, body {
    touch-action: pan-x pan-y pinch-zoom !important;
    -webkit-text-size-adjust: 100% !important;
}

/* Для контейнера слайд-шоу — двойная защита */
.pg-slideshow,
.phocagalleryslideshow,
.responsive-slideshow-wrapper {
    touch-action: pan-x pan-y pinch-zoom !important;
}
/* Принудительно разрешаем зум щипком для слайд-шоу */
.pg-slideshow,
.phocagalleryslideshow,
.pg-slideshow img,
.phocagalleryslideshow img {
    touch-action: pan-x pan-y pinch-zoom !important;
}

/* Финальная настройка отступов футера */
.container-footer,
.footer,
footer {
    margin-top: 0.0rem !important;
    margin-bottom: 0.0rem !important;
    padding-top: 0.0rem !important;
    padding-bottom: 0.0rem !important;
    min-height: auto !important;
}

.container-footer .grid-child,
.footer .grid-child,
footer .grid-child {
    margin-top: 0.0 !important;
    margin-bottom: 0.0 !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Убираем отступы у любых модулей внутри футера */
.container-footer .moduletable,
.footer .moduletable,
footer .moduletable,
.container-footer .card,
.footer .card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Убираем отступы у самого текстового блока */
.container-footer p,
.footer p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Заставляем контейнер слайд-шоу подстраиваться под пропорции изображения */
.phocagalleryslideshow,
.pg-slideshow,
.responsive-slideshow-wrapper {
    height: auto !important; /* <-- КЛЮЧ: убираем фиксированную высоту */
    max-width: 100% !important;
}

/* Опционально: если фон контейнера мешает, можно сделать его прозрачным */
.phocagalleryslideshow {
    background-color: transparent !important;
}
/* Исправление обрезки изображений в слайд-шоу после конвертации в WebP */
.phocagalleryslideshow img,
.pg-slideshow img,
.responsive-slideshow-wrapper img {
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
}


/* Плавающие иконки в правом верхнем углу */
.floating-icons {
    position: fixed !important;
    top: 30px !important;  /* Отступ сверху — ниже шапки */
    right: 20px !important;
    z-index: 9999 !important;
    display: flex !important;
    gap: 10px !important;
}

.floating-icon {
    display: inline-block !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}

.floating-icon:hover {
    opacity: 1 !important;
    transform: scale(1.05) !important;
}

.floating-icon.vk-icon {
    background-color: #0077FF !important;
    text-align: center !important;
    line-height: 38px !important;
}

.floating-icon.vk-icon span {
    color: white !important;
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    font-size: 17px !important;
}

.floating-icon.closed-icon {
    background-color: #5a5a5a !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C9.5 2 7.5 4 7.5 6.5V9H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2h-1.5V6.5C16.5 4 14.5 2 12 2zm0 2c1.4 0 2.5 1.1 2.5 2.5V9h-5V6.5C9.5 5.1 10.6 4 12 4zm-6 7h12v9H6v-9zm6 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E") !important;
    background-size: 22px 22px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Мобильные */
@media (max-width: 600px) {
    .floating-icons {
        top: 30px !important;
        right: 12px !important;
        gap: 8px !important;
    }
    
    .floating-icon {
        width: 34px !important;
        height: 34px !important;
    }
    
    .floating-icon.vk-icon {
        line-height: 34px !important;
    }
    
    .floating-icon.vk-icon span {
        font-size: 15px !important;
    }
    
    .floating-icon.closed-icon {
        background-size: 20px 20px !important;
    }
}