/* Editor content image gallery */
#blog-detail-content-swiper.news-detail-gallery {
    --gallery-accent: #18a9c7;
    --gallery-ink: #17324d;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 24px 0;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
}

#blog-detail-content-swiper.news-detail-gallery *,
#blog-detail-content-swiper.news-detail-gallery *::before,
#blog-detail-content-swiper.news-detail-gallery *::after {
    box-sizing: border-box;
}

.news-detail-gallery__viewport {
    position: relative;
    overflow: hidden;
    padding: 0 2px;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

.news-detail-gallery__track {
    display: flex;
    gap: 16px;
    transition: transform .4s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.news-detail-gallery__slide {
    flex: 0 0 calc((100% - 32px) / 3);
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #e1ebef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(22, 50, 77, .08);
}

.news-detail-gallery__image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #f4f8f9;
}

.news-detail-gallery__image {
    display: block;
    width: 100%;
    height: auto;
}

.news-detail-gallery__button {
    position: absolute;
    top: calc(50% - 20px);
    z-index: 2;
    display: inline-grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(23, 50, 77, .84);
    box-shadow: 0 4px 15px rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, opacity .2s ease;
}

.news-detail-gallery__button:hover,
.news-detail-gallery__button:focus-visible {
    color: #fff;
    background: var(--gallery-accent);
    transform: scale(1.08);
}

.news-detail-gallery__button:focus-visible,
.news-detail-gallery__thumbnail:focus-visible,
.news-detail-gallery__image-button:focus-visible,
.news-detail-gallery__lightbox-button:focus-visible {
    outline: 3px solid #0f7c96;
    outline-offset: 3px;
}

.news-detail-gallery__button[disabled] {
    cursor: default;
    opacity: .4;
    transform: none;
}

.news-detail-gallery__button--previous { left: 10px; }
.news-detail-gallery__button--next { right: 10px; }

.news-detail-gallery__button svg,
.news-detail-gallery__lightbox-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.news-detail-gallery__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 2px 0;
    background: transparent;
}

.news-detail-gallery__counter {
    flex: 0 0 auto;
    color: var(--gallery-ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.news-detail-gallery__thumbnails {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}

.news-detail-gallery__thumbnail {
    flex: 0 0 68px;
    width: 68px;
    height: 52px;
    padding: 2px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 7px;
    background: #e4edf0;
    cursor: pointer;
}

.news-detail-gallery__thumbnail[aria-current="true"] {
    border-color: var(--gallery-accent);
}

.news-detail-gallery__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.news-detail-gallery__lightbox {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 72px;
    background: rgba(5, 19, 31, .94);
}

.news-detail-gallery__lightbox[hidden] { display: none; }

.news-detail-gallery__lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    object-fit: contain;
}

.news-detail-gallery__lightbox-button {
    position: absolute;
    display: inline-grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    cursor: pointer;
}

.news-detail-gallery__lightbox-button:hover { background: var(--gallery-accent); }
.news-detail-gallery__lightbox-button--close { top: 18px; right: 18px; }
.news-detail-gallery__lightbox-button--previous { top: 50%; left: 16px; transform: translateY(-50%); }
.news-detail-gallery__lightbox-button--next { top: 50%; right: 16px; transform: translateY(-50%); }

body.news-detail-gallery-open { overflow: hidden; }

@media (max-width: 575.98px) {
    #blog-detail-content-swiper.news-detail-gallery {
        margin: 24px 0;
        border-radius: 12px;
    }

    .news-detail-gallery__track { gap: 12px; }
    .news-detail-gallery__slide { flex-basis: 100%; }
    .news-detail-gallery__button { width: 38px; height: 38px; top: calc(50% - 19px); }
    .news-detail-gallery__button--previous { left: 10px; }
    .news-detail-gallery__button--next { right: 10px; }
    .news-detail-gallery__footer { gap: 10px; padding: 8px 2px 0; }
    .news-detail-gallery__thumbnail { flex-basis: 54px; width: 54px; height: 42px; }
    .news-detail-gallery__lightbox { padding: 16px 54px; }
    .news-detail-gallery__lightbox-button { width: 40px; height: 40px; }
    .news-detail-gallery__lightbox-button--previous { left: 7px; }
    .news-detail-gallery__lightbox-button--next { right: 7px; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .news-detail-gallery__track { gap: 14px; }
    .news-detail-gallery__slide { flex-basis: calc((100% - 14px) / 2); }
}
