.inline-gallery-container{
	position:relative; 
	width:100%;
	max-width:100vw;
	border-radius:var(--radius-lg);
	display:flex; 
	align-items:center;
	outline:none;
    width:var(--container-width);
    margin:0 auto
}

.inline-gallery-container .gallery{
	width:100%;
	height:100%;
	display:flex;
	align-items:center;
	gap:var(--spacing-4);
	overflow-x:auto;
	scrollbar-width:none;
    scroll-snap-type: x mandatory;

	overflow-x:visible;
    transform:translate3d(0px, 0px, 0px)
}
.inline-gallery-container .gallery::-webkit-scrollbar{
	display:none
}
.inline-gallery-container .gallery .gallery-item{
    width: auto;
    /* aspect-ratio: 12/9; */ 
    flex-shrink: 0;
    object-fit: contain; 
    border-radius: var(--radius-md);
    user-select: none;
    cursor: zoom-in;
    scroll-snap-align: center;
    pointer-events: auto;
    transition: opacity .4s ease, transform .4s ease;
    max-width: 100%;
}
.inline-gallery-container .gallery .gallery-item.gallery-image-dimmed{
	opacity:0.3;
	transform:scale(.95);
	cursor:pointer
}

.inline-gallery-container .gallery .gallery-item.gallery-image-active{
	opacity:1;
	transform:scale(1)
}

.lightbox-nav,
.inline-gallery-container .gallery-nav{
	position:absolute;
	z-index:1;
	width:20dvw;
	min-width:120px;
	height:100%;
	background-color:transparent;
	border:none;
	cursor:pointer;
	display:flex;
	align-items:center;
	justify-content:center;
	transition:background-color .4s
}
.lightbox-nav:hover,
.inline-gallery-container .gallery-nav:hover{
	background-color:transparent
}
.lightbox-nav:active,
.inline-gallery-container .gallery-nav:active{
	background-color:rgba(0,0,0,.1)
}

.lightbox-nav.lightbox-prev,
.inline-gallery-container .gallery-nav.prev{
	left:0
}
.lightbox-nav.lightbox-next,
.inline-gallery-container .gallery-nav.next{
	right:0
}

/* СТРЕЛКИ ГАЛЕРЕИ */
.lightbox-nav::before,
.inline-gallery-container .gallery-nav::before{
	content:'';
	display:block;
	width:10px;
	height:10px;
    /* Lightbox всегда темный, стрелки всегда должны быть белыми. 
       В обычной галерее берем адаптивный цвет. */
	border-top:2px solid var(--bg-surface-white);
	border-left:2px solid var(--bg-surface-white);
	transition:height .4s, width .4s, border-color .3s
}

/* Исправление для Lightbox: всегда белые стрелки */
.lightbox-nav::before {
    border-color: var(--white);
}

/* Исправление для темной темы обычной галереи: стрелки должны быть видны */
[data-theme="dark"] .inline-gallery-container .gallery-nav::before {
    border-color: var(--white);
}

.lightbox-nav:hover::before,
.inline-gallery-container .gallery-nav:hover::before{
	width:20px;
	height:20px
}
.lightbox-nav.lightbox-prev::before,
.inline-gallery-container .gallery-nav.prev::before{
	transform:translateX(2px) rotate(-45deg)
}
.lightbox-nav.lightbox-next::before,
.inline-gallery-container .gallery-nav.next::before{
	transform:translateX(-2px) rotate(135deg)
}

.inline-gallery-container .gallery-pagination {
    position: absolute;
    bottom:var(--spacing-5);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: var(--spacing-3);
    padding: var(--spacing-2);
    /* Заменена жесткая прозрачность на адаптивный фон */
    background-color: var(--bg-surface-02);
    border-radius: var(--spacing-5);
    transition: background-color 0.3s;
}

[data-theme="dark"] .inline-gallery-container .gallery-pagination {
     background-color: var(--bg-surface-03);
}

.inline-gallery-container .gallery-pagination .dot {
    width: var(--spacing-2);
    height: var(--spacing-2);
    border-radius: 50%;
    background-color: var(--text-body-03);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all .4s ease;
}

.inline-gallery-container .gallery-pagination .dot:hover {
    background-color: var(--text-body-07);
}

.inline-gallery-container .gallery-pagination .dot.active {
    background-color: var(--text-body-09);
    transform: scale(1.5);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .inline-gallery-container .gallery-pagination .dot.active {
    background-color: var(--white);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

body.lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .4s ease;
}

.gallery-lightbox.fade-out {
    animation: fadeOut .4s ease forwards;
}

.lightbox-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.lightbox-image {
    display: block;
    min-width: 100vw;
    max-height: 98vh;
    object-fit: contain;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: var(--spacing-5);
    right: var(--spacing-5);
    width: var(--spacing-7);
    height: var(--spacing-7);
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--spacing-5);
    height: 2px;
    background-color: var(--white); /* Всегда белый крестик */
}

.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}


.inline-gallery-container.fullwidth{
    width:auto;
	height:110vh
}
.inline-gallery-container.fullwidth .gallery .gallery-item{
	width:100%;
	height:110vh
}

@media(max-width:480px){
	.inline-gallery-container{
		width:100vw;
		height:37.5vh
	}
	.inline-gallery-container .gallery,
	.inline-gallery-container .gallery .gallery-item{
		height:37.5vh
	}
	.inline-gallery-container.fullwidth,
	.inline-gallery-container.fullwidth .gallery,
	.inline-gallery-container.fullwidth .gallery .gallery-item{
		height:75vh
	}

	.inline-gallery-container .gallery-pagination .dot{
		width:var(--spacing-1);
		height:var(--spacing-1)
	}
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}