/*
 * Colorbox 1.6.4 — Dark Graphite / Gold
 * Дизайн по референсу FAQ: #1e1e28, #2e2e3a, #ffcb17.
 * Замена исходного colorbox.css. Спрайт controls.png больше не нужен.
 *
 * ВАЖНО: базовые стили Colorbox оставлены без изменений,
 * чтобы корректно работал расчёт размеров в jquery.colorbox.js.
 */

/* ==========================================================================
   COLORBOX CORE STYLE — unchanged
   ========================================================================== */
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
#cboxWrapper {max-width:none;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
#cboxTitle{margin:0;}
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}

/* ==========================================================================
   COLORBOX THEME
   ========================================================================== */

/* Цвета можно изменить централизованно. */
#colorbox {
    --cbox-panel: #2e2e3a;
    --cbox-panel-hover: #383744;
    --cbox-page: #1e1e28;
    --cbox-gold: #ffcb17;
    --cbox-gold-hover: #ffda51;
    --cbox-ink: #f0eff5;
    --cbox-muted: #aaa9b7;
    --cbox-stroke: rgba(255, 255, 255, 0.09);
    --cbox-gold-stroke: rgba(255, 203, 23, 0.46);

    overflow: visible;
    outline: none;
    color: var(--cbox-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

#cboxWrapper {
    overflow: visible;
}

/* Подложка: степень затемнения также задаётся опцией JS opacity. */
#cboxOverlay {
    background: #101018;
    opacity: 0.88;
    filter: alpha(opacity=88);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Карточка модального окна. Отступ сверху резервирует место под панель. */
#cboxContent {
    margin-top: 56px;
    overflow: visible;
    background: var(--cbox-panel);
    border: 1px solid var(--cbox-gold-stroke);
    border-radius: 12px;
    box-shadow:
        0 26px 74px rgba(0, 0, 0, 0.50),
        0 0 0 1px rgba(255, 203, 23, 0.035);
}

#cboxLoadedContent {
    background: var(--cbox-panel);
    color: var(--cbox-ink);
    padding: 0;
    border-radius: 11px;
}

.cboxIframe {
    background: var(--cbox-panel);
    border-radius: 11px;
}

#cboxError {
    padding: 30px;
    border: 0;
    color: var(--cbox-muted);
    line-height: 1.65;
}

/* Заголовок и счётчик над модальным окном. */
#cboxTitle {
    position: absolute;
    top: -43px;
    left: 1px;
    right: 260px;
    margin: 0;
    color: var(--cbox-ink);
    font-size: 14px;
    line-height: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#cboxCurrent {
    position: absolute;
    top: -39px;
    right: 157px;
    color: var(--cbox-gold);
    font-size: 10px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-transform: uppercase;
    text-indent: 0;
}

/* Кнопки рисуются CSS, не зависят от файла images/controls.png. */
#cboxPrevious,
#cboxNext,
#cboxSlideshow,
#cboxClose {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: -47px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 203, 23, 0.30);
    border-radius: 9px;
    background: #39372e;
    color: var(--cbox-gold);
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
    overflow: hidden;
    box-shadow: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease,
                color .18s ease, box-shadow .18s ease;
}

#cboxPrevious { right: 86px; }
#cboxNext { right: 43px; }
#cboxClose { right: 0; }

#cboxPrevious:hover,
#cboxNext:hover,
#cboxSlideshow:hover {
    background: var(--cbox-gold);
    border-color: var(--cbox-gold);
    color: var(--cbox-page);
    box-shadow: 0 5px 18px rgba(255, 203, 23, 0.12);
}

/* Крестик — золотая кнопка, как раскрытый пункт аккордеона. */
#cboxClose {
    background: var(--cbox-gold);
    color: var(--cbox-page);
    border-color: var(--cbox-gold);
}

#cboxClose:hover {
    background: var(--cbox-gold-hover);
    border-color: var(--cbox-gold-hover);
    box-shadow: 0 5px 18px rgba(255, 203, 23, 0.20);
}

#cboxPrevious:focus-visible,
#cboxNext:focus-visible,
#cboxSlideshow:focus-visible,
#cboxClose:focus-visible {
    outline: 2px solid var(--cbox-gold);
    outline-offset: 3px;
}

/* Стрелки: предыдущий / следующий. */
#cboxPrevious::before,
#cboxNext::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    border-radius: 1px;
}

#cboxPrevious::before { transform: translate(-30%, -50%) rotate(-135deg); }
#cboxNext::before { transform: translate(-70%, -50%) rotate(45deg); }

/* Закрыть: крестик из двух аккуратных линий. */
#cboxClose::before,
#cboxClose::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

#cboxClose::before { transform: translate(-50%, -50%) rotate(45deg); }
#cboxClose::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* Слайд-шоу: старт (play) / пауза. */
#cboxSlideshow { right: 86px; }
.cboxSlideshow_on #cboxPrevious,
.cboxSlideshow_off #cboxPrevious { right: 129px; }

.cboxSlideshow_off #cboxSlideshow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid currentColor;
    transform: translate(-40%, -50%);
}

.cboxSlideshow_on #cboxSlideshow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 12px;
    border: 0;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 6px 0 0 currentColor;
    transform: translate(-5px, -50%);
}

/* Вместо старой GIF-анимации — компактный золотой спиннер. */
#cboxLoadingOverlay {
    background: rgba(46, 46, 58, 0.88);
    border-radius: 11px;
}

#cboxLoadingGraphic {
    background: none;
    pointer-events: none;
}

#cboxLoadingGraphic::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 203, 23, 0.20);
    border-top-color: var(--cbox-gold);
    border-radius: 50%;
    animation: cbox-gold-spin .7s linear infinite;
}

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

@media (max-width: 600px) {
    #cboxContent { margin-top: 56px; border-radius: 10px; }
    #cboxLoadedContent, .cboxIframe { border-radius: 9px; }

    #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {
        top: -44px;
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    #cboxClose { right: 0; }
    #cboxNext { right: 37px; }
    #cboxPrevious { right: 74px; }
    #cboxSlideshow { right: 74px; }
    .cboxSlideshow_on #cboxPrevious,
    .cboxSlideshow_off #cboxPrevious { right: 111px; }

    #cboxTitle {
        top: -43px;
        right: 153px;
        font-size: 12px;
        line-height: 17px;
    }

    #cboxCurrent {
        top: -23px;
        left: 1px;
        right: auto;
        font-size: 9px;
        line-height: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {
        transition: none;
    }
    #cboxLoadingGraphic::after { animation-duration: 1.6s; }
}
