
/* =====================================================
   ИСКРИНКА - GALLERY
   Светлая и тёмная темы
===================================================== */

/* Основной контейнер */
.rb-gallery-list {
    overflow: hidden;
}

.rb-gallery-item {
    text-align: center;
    margin: 10px 0;
}

/* =====================================================
   КАРТОЧКА ГАЛЕРЕИ
===================================================== */

.rb-gallery-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(54, 207, 196, 0.18);
    box-shadow: 0 3px 12px rgba(80, 110, 100, 0.07);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.rb-gallery-item:hover .rb-gallery-inner {
    border-color: rgba(54, 207, 196, 0.55);
    box-shadow: 0 5px 16px rgba(54, 160, 145, 0.13);
}

/* =====================================================
   ИЗОБРАЖЕНИЕ
===================================================== */

/* Ссылка на изображение */
.rb-gallery-link {
    display: block;
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    outline: none !important;
    text-decoration: none !important;
    overflow: hidden;
    border-radius: 9px;
}

/* Обёртка изображения */
.rb-gallery-img-outer {
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 0 10px;
    border-radius: 9px;
    background: #f5faf8;
}

/* Фотография с рамкой */
.rb-gallery-img-outer.foto {
    padding: 7px;
    background: #ffffff;
    border: 1px solid #e6efeb;
    box-shadow: 0 3px 9px rgba(80, 100, 90, 0.12);
}

/* Изображение */
.rb-gallery-img {
    display: block;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
}

/* Увеличение */
.rb-gallery-item:hover .rb-gallery-img.anim-scale {
    transform: scale(1.12);
}

/* Прозрачность */
.rb-gallery-item:hover .rb-gallery-img.anim-opacity {
    transform: none;
    opacity: 0.72;
}

/* Чёрно-белый эффект */
.rb-gallery-item:hover .rb-gallery-img.anim-grayscale {
    transform: none;
    filter: grayscale(0.85);
}

/* Сепия */
.rb-gallery-item:hover .rb-gallery-img.anim-sepia {
    transform: none;
    filter: sepia(90%);
}

/* Контраст */
.rb-gallery-item:hover .rb-gallery-img.anim-contrast {
    transform: none;
    filter: contrast(120%);
}

/* =====================================================
   ПОДПИСИ ПОД ФОТОГРАФИЯМИ
===================================================== */

.rb-gallery .text-gallery {
    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 128px;
    max-height: none;

    padding: 12px 10px;
    margin: 0;

    color: #806052;
    background: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    text-align: center;

    overflow: visible;
    overflow-wrap: anywhere;
}

/* Наведение на подпись */
.rb-gallery-item:hover .text-gallery,
.rb-gallery-inner.style-over .rb-gallery-link:hover + .text-gallery {
    opacity: 1 !important;
    color: #087f78;
}

/* =====================================================
   ПОДПИСЬ ПОВЕРХ ИЗОБРАЖЕНИЯ
===================================================== */

.rb-gallery-inner.style-over {
    overflow: hidden;
}

.rb-gallery-inner.style-over .rb-gallery-link {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: block;
    width: 100%;
    height: 100%;
}

.rb-gallery-inner.style-over .text-gallery {
    position: absolute;
    z-index: 11;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    padding: 20px;
    overflow: hidden;
    justify-content: center;
    color: #ffffff;
    background: rgba(8, 127, 120, 0.76);
    opacity: 0;
    pointer-events: none;
}

/* =====================================================
   ТЁМНАЯ ТЕМА
===================================================== */

.dark-theme .rb-gallery-inner {
    background: #252b2a;
    border-color: rgba(54, 207, 196, 0.2);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.dark-theme .rb-gallery-item:hover .rb-gallery-inner {
    border-color: rgba(54, 207, 196, 0.6);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.3);
}

/* Белая подложка под изображения */
.dark-theme .rb-gallery-img-outer {
    background: #ffffff;
    padding: 7px;
    border-radius: 9px;
}

/* Фотографии с рамкой */
.dark-theme .rb-gallery-img-outer.foto {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Подписи */
.dark-theme .rb-gallery .text-gallery {
    color: #e5d3c5;
    background: #252b2a;
}

.dark-theme .rb-gallery-item:hover .text-gallery {
    color: #36cfc4;
}

/* Подпись поверх фотографии */
.dark-theme .rb-gallery-inner.style-over .text-gallery {
    color: #ffffff;
    background: rgba(8, 127, 120, 0.88);
}

/* =====================================================
   СЕТКА КОЛОНОК
===================================================== */

.rb-gallery .col-lg-1,
.rb-gallery .col-lg-2,
.rb-gallery .col-lg-3,
.rb-gallery .col-lg-4,
.rb-gallery .col-lg-6,
.rb-gallery .col-lg-12 {
    float: left;
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
}

/* =====================================================
   MAGNIFIC POPUP
===================================================== */

/* Белая подложка фотографии */
.rb-gallery .mfp-figure figure {
    box-sizing: border-box;
    border-radius: 10px;
    padding: 7px;
    background: #ffffff;
}

/* Кнопка закрытия */
.rb-gallery .mfp-image-holder .mfp-close,
.rb-gallery .mfp-iframe-holder .mfp-close {
    color: #ffffff;
    right: -6px;
    text-align: right;
    padding-right: 6px;
    width: 100%;
}

/* Нижняя панель */
.rb-gallery .mfp-bottom-bar {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin-top: 0;
    padding: 12px 16px;
    background: #26302e;
    border-top: 2px solid #36cfc4;
    border-radius: 0 0 10px 10px;
    cursor: auto;
}

/* Текст подписи */
.rb-gallery .mfp-title {
    flex: 1;
    min-width: 0;
    padding: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Счётчик */
.rb-gallery .mfp-counter {
    position: static;
    flex-shrink: 0;
    padding: 0;
    color: #36cfc4;
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
}

/* Стрелки */
.rb-gallery .mfp-arrow:hover,
.rb-gallery .mfp-arrow:focus {
    opacity: 1;
}

.rb-gallery button.mfp-close,
.rb-gallery button.mfp-arrow {
    overflow: visible;
    cursor: pointer;
    background: transparent;
    border: 0;
    -webkit-appearance: none;
    display: block;
    outline: none;
    padding: 0;
    z-index: 1046;
    box-shadow: none;
}

.rb-gallery .mfp-arrow-right {
    right: 0;
}

.rb-gallery .mfp-arrow {
    position: absolute;
    opacity: 0.75 !important;
    margin: 0;
    top: 50%;
    margin-top: -55px;
    padding: 0;
    width: 90px;
    height: 110px;
    -webkit-tap-highlight-color: transparent;
}

/* =====================================================
   КНОПКА ЗАГРУЗКИ ЕЩЁ
===================================================== */

.rb-gallery .gallery-load-more {
    background: #36cfc4;
    color: #ffffff;
    border: 0;
    outline: none;
    border-radius: 30px;
    padding: 11px 25px;
    text-transform: none;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
    box-shadow: 0 3px 9px rgba(54, 207, 196, 0.2);
}

.rb-gallery .gallery-load-more:hover {
    background: #087f78;
    color: #ffffff;
    box-shadow: 0 5px 13px rgba(8, 127, 120, 0.22);
}

.dark-theme .rb-gallery .gallery-load-more {
    background: #36cfc4;
    color: #173d39;
}

.dark-theme .rb-gallery .gallery-load-more:hover {
    background: #55ded2;
    color: #173d39;
}

/* =====================================================
   OWL CAROUSEL
===================================================== */

.rb-gallery-owl-carousel {
    display: none;
    width: 100%;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}

.rb-gallery-owl-carousel .owl-stage {
    position: relative;
    -ms-touch-action: pan-Y;
    touch-action: manipulation;
    -moz-backface-visibility: hidden;
}

.rb-gallery-owl-carousel .owl-stage:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

.rb-gallery-owl-carousel .owl-stage-outer {
    position: relative;
    overflow: hidden;
    -webkit-transform: translate3d(0, 0, 0);
}

.rb-gallery-owl-carousel .owl-wrapper,
.rb-gallery-owl-carousel .owl-item {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
}

.rb-gallery-owl-carousel .owl-item {
    position: relative;
    min-height: 1px;
    float: left;
    -webkit-backface-visibility: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.rb-gallery-owl-carousel .owl-item img {
    display: block;
    width: 100%;
}

.rb-gallery-owl-carousel .owl-nav.disabled,
.rb-gallery-owl-carousel .owl-dots.disabled {
    display: none;
}

.rb-gallery-owl-carousel .owl-nav .owl-prev,
.rb-gallery-owl-carousel .owl-nav .owl-next,
.rb-gallery-owl-carousel .owl-dot {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.rb-gallery-owl-carousel .owl-nav button.owl-prev,
.rb-gallery-owl-carousel .owl-nav button.owl-next,
.rb-gallery-owl-carousel button.owl-dot {
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
}

.rb-gallery-owl-carousel.owl-loaded {
    display: block;
}

.rb-gallery-owl-carousel.owl-loading {
    opacity: 0;
    display: block;
}

.rb-gallery-owl-carousel.owl-hidden {
    opacity: 0;
}

.rb-gallery-owl-carousel.owl-refresh .owl-item {
    visibility: hidden;
}

.rb-gallery-owl-carousel.owl-drag .owl-item {
    -ms-touch-action: pan-y;
    touch-action: pan-y;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.rb-gallery-owl-carousel.owl-grab {
    cursor: grab;
}

.rb-gallery-owl-carousel.owl-rtl {
    direction: rtl;
}

.rb-gallery-owl-carousel.owl-rtl .owl-item {
    float: right;
}

.no-js .rb-gallery-owl-carousel {
    display: block;
}

/* Анимация */
.rb-gallery-owl-carousel .animated {
    animation-duration: 1000ms;
    animation-fill-mode: both;
}

.rb-gallery-owl-carousel .owl-animated-in {
    z-index: 0;
}

.rb-gallery-owl-carousel .owl-animated-out {
    z-index: 1;
}

.rb-gallery-owl-carousel .fadeOut {
    animation-name: fadeOut;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Auto Height */
.owl-height {
    transition: height 500ms ease-in-out;
}

/* Lazy Load */
.rb-gallery-owl-carousel .owl-item .owl-lazy {
    opacity: 0;
    transition: opacity 400ms ease;
}

.rb-gallery-owl-carousel .owl-item img.owl-lazy {
    transform-style: preserve-3d;
}

/* Видео */
.rb-gallery-owl-carousel .owl-video-wrapper {
    position: relative;
    height: 100%;
    background: #000;
}

.rb-gallery-owl-carousel .owl-video-play-icon {
    position: absolute;
    height: 80px;
    width: 80px;
    left: 50%;
    top: 50%;
    margin-left: -40px;
    margin-top: -40px;
    background: url("owl.video.play.png") no-repeat;
    cursor: pointer;
    z-index: 1;
    -webkit-backface-visibility: hidden;
    transition: transform 100ms ease;
}

.rb-gallery-owl-carousel .owl-video-play-icon:hover {
    transform: scale(1.3);
}

.rb-gallery-owl-carousel .owl-video-playing .owl-video-tn,
.rb-gallery-owl-carousel .owl-video-playing .owl-video-play-icon {
    display: none;
}

.rb-gallery-owl-carousel .owl-video-tn {
    opacity: 0;
    height: 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    transition: opacity 400ms ease;
}

.rb-gallery-owl-carousel .owl-video-frame {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
}

/* Стрелки слайдера */
.rb-gallery-owl-carousel .owl-nav {
    position: absolute;
    top: 34%;
    text-align: center;
    width: 100%;
}

.rb-gallery-owl-carousel .owl-nav button.owl-prev,
.rb-gallery-owl-carousel .owl-nav button.owl-next {
    color: #087f78;
    outline: none;
    font-size: 34px;
    margin: 5px;
    padding: 4px 15px 11px;
    background: rgba(54, 207, 196, 0.2);
    position: absolute;
    cursor: pointer;
    font-family: Arial;
    opacity: 0;
    transition: 0.3s;
    border-radius: 10px;
}

.rb-gallery-owl-carousel .owl-nav button.owl-prev {
    left: 0;
}

.rb-gallery-owl-carousel .owl-nav button.owl-next {
    right: 0;
}

.rb-gallery-owl-carousel .owl-nav [class*='owl-']:hover {
    background: #36cfc4;
    color: #ffffff;
}

.rb-gallery-owl-carousel:hover .owl-nav [class*='owl-'] {
    opacity: 1;
}

.rb-gallery-owl-carousel .owl-nav .disabled {
    opacity: 0.35 !important;
}

/* Точки слайдера */
.rb-gallery-owl-carousel .owl-nav.disabled + .owl-dots {
    margin-top: 10px;
}

.rb-gallery-owl-carousel .owl-dots {
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.rb-gallery-owl-carousel .owl-dots .owl-dot {
    display: inline-block;
    zoom: 1;
}

.rb-gallery-owl-carousel .owl-dots .owl-dot span {
    width: 9px;
    height: 9px;
    margin: 5px;
    background: #b8e8e2;
    display: block;
    -webkit-backface-visibility: visible;
    transition: background 200ms ease, transform 200ms ease;
    border-radius: 30px;
}

.rb-gallery-owl-carousel .owl-dots .owl-dot.active span,
.rb-gallery-owl-carousel .owl-dots .owl-dot:hover span {
    background: #36cfc4;
    transform: scale(1.15);
}

.dark-theme .rb-gallery-owl-carousel .owl-dots .owl-dot span {
    background: #ffffff;
    opacity: 0.4;
}

.dark-theme .rb-gallery-owl-carousel .owl-dots .owl-dot.active span,
.dark-theme .rb-gallery-owl-carousel .owl-dots .owl-dot:hover span {
    background: #36cfc4;
    opacity: 1;
}

/* =====================================================
   АДАПТИВНАЯ СЕТКА
===================================================== */

@media (min-width: 1200px) {
    .rb-gallery .col-lg-2:nth-child(6n+1),
    .rb-gallery .col-lg-3:nth-child(4n+1),
    .rb-gallery .col-lg-4:nth-child(3n+1),
    .rb-gallery .col-lg-6:nth-child(2n+1) {
        clear: left;
    }

    .rb-gallery .col-lg-1 { width: 8.33333333%; }
    .rb-gallery .col-lg-2 { width: 16.66666667%; }
    .rb-gallery .col-lg-3 { width: 25%; }
    .rb-gallery .col-lg-4 { width: 33.33333333%; }
    .rb-gallery .col-lg-6 { width: 50%; }
    .rb-gallery .col-lg-12 { width: 100%; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .rb-gallery .col-md-2:nth-child(6n+1),
    .rb-gallery .col-md-3:nth-child(4n+1),
    .rb-gallery .col-md-4:nth-child(3n+1),
    .rb-gallery .col-md-6:nth-child(2n+1) {
        clear: left;
    }

    .rb-gallery .col-md-1 { width: 8.33333333%; }
    .rb-gallery .col-md-2 { width: 16.66666667%; }
    .rb-gallery .col-md-3 { width: 25%; }
    .rb-gallery .col-md-4 { width: 33.33333333%; }
    .rb-gallery .col-md-6 { width: 50%; }
    .rb-gallery .col-md-12 { width: 100%; }
}

@media (min-width: 768px) and (max-width: 991px) {
    .rb-gallery .col-sm-2:nth-child(6n+1),
    .rb-gallery .col-sm-3:nth-child(4n+1),
    .rb-gallery .col-sm-4:nth-child(3n+1),
    .rb-gallery .col-sm-6:nth-child(2n+1) {
        clear: left;
    }

    .rb-gallery .col-sm-1 { width: 8.33333333%; }
    .rb-gallery .col-sm-2 { width: 16.66666667%; }
    .rb-gallery .col-sm-3 { width: 25%; }
    .rb-gallery .col-sm-4 { width: 33.33333333%; }
    .rb-gallery .col-sm-6 { width: 50%; }
    .rb-gallery .col-sm-12 { width: 100%; }
}

@media (max-width: 767px) {
    .rb-gallery .col-xs-2:nth-child(6n+1),
    .rb-gallery .col-xs-3:nth-child(4n+1),
    .rb-gallery .col-xs-4:nth-child(3n+1),
    .rb-gallery .col-xs-6:nth-child(2n+1) {
        clear: left;
    }

    .rb-gallery .col-xs-1 { width: 8.33333333%; }
    .rb-gallery .col-xs-2 { width: 16.66666667%; }
    .rb-gallery .col-xs-3 { width: 25%; }
    .rb-gallery .col-xs-4 { width: 33.33333333%; }
    .rb-gallery .col-xs-6 { width: 50%; }
    .rb-gallery .col-xs-12 { width: 100%; }

    /* Компактная карточка на мобильных */
    .rb-gallery-inner {
        padding: 7px;
        border-radius: 11px;
    }

    /* Увеличенная подпись */
    .rb-gallery .text-gallery {
        flex-basis: 112px;
        height: 112px;
        min-height: 112px;
        max-height: 112px;
        font-size: 13px;
        padding: 10px 8px;
    }

    /* Панель открытого слайдера */
    .rb-gallery .mfp-bottom-bar {
        gap: 8px;
        padding: 10px 12px;
    }

    .rb-gallery .mfp-title {
        font-size: 13px;
    }
}
