/* Общие стили */
.dm-works-grid,
.dm-works-archive-grid {
    display: grid;
    gap: 20px;
    
}

.dm-works-col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dm-works-col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.dm-works-col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.dm-works-grid-item{
    position: relative;
    overflow: hidden;
	transform: scale(1);
    transition: transform 0.5s ease-out;
	
}

.dm-works-archive-item:hover{
	transition: transform 0.5s ease;
	/*transform: scale(1.01);
	*/
	z-index: 100;
	background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	padding: 10px;
}



.dm-works-grid-link{
    display: block;
    text-decoration: none;
}

.dm-works-grid-image{
    width: 100%;
    height: auto;
    display: block;
	border-radius: 12px !important;
}

.dm-works-grid-title {
    margin: 15px 0 0;
    font-size: 1rem;
    text-align: center;
    color: #333;
}

/* Archive страница */
.dm-works-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dm-works-archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.dm-works-archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Стили пагинации */
.dm-works-pagination {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 50px;
    padding: 20px 0;
}

.dm-works-pagination-links {
    display: inline-block;
}

.dm-works-pagination-links .page-numbers {
	display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dm-works-pagination-links .page-numbers.current {
    background: var(--e-global-color-4de8dbf);
    color: #fff;
    border-color: var(--e-global-color-4de8dbf);
}

.dm-works-pagination-links .page-numbers:hover:not(.current) {
    background: #e5e5e5;
    border-color: #ccc;
}

.dm-works-pagination-links .prev,
.dm-works-pagination-links .next {
    padding: 10px 18px;
}

.dm-works-no-results {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #666;
}

/* Single страница */
.dm-works-single {
    margin: 0px 5%;
    padding: 40px 20px;
}

.dm-works-single-container {
    width: 100%;
}

.dm-works-single-container__wrapper{
	display: flex;
    justify-content: space-between;
    align-items: center;
}

.dm-works-link{
	font-family: "Montserrat", Sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 3em;
    color: var(--e-global-color-4de8dbf);
	min-width: 200px;
	text-align: right;
}

.dm-works-link:hover{
	color: #333;
}

.dm-works-single-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.dm-works-single-address {
    /*margin-bottom: 20px;
    padding: 10px 15px;
    background:  var(--e-global-color-5e0ba6d);
    border-left: 4px solid var(--e-global-color-4de8dbf);
	color: var(--e-global-color-2f02447); 
	*/
	margin-bottom: 30px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.dm-works-single-description {
    margin-bottom: 30px;
    line-height: 1.6;
	font-size: 32px;
}

/* Галерея - flex с одинаковой высотой */
.dm-works-single-gallery {
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    gap: 0;
}

.dm-works-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 250px;
    height: 300px;
}

.dm-works-gallery-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
	padding: 1px;
}

/* Видео элемент в галерее */
.dm-works-gallery-video {
    position: relative;
    background: #000;
}

.dm-works-gallery-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Разные размеры элементов для мозаичного эффекта */
.dm-works-gallery-item:nth-child(3n+1) {
    flex: 2 1 auto;
    min-width: 400px;
}

.dm-works-gallery-item:nth-child(3n+2) {
    flex: 1.5 1 auto;
    min-width: 300px;
}

.dm-works-gallery-item:nth-child(3n+3) {
    flex: 1.8 1 auto;
    min-width: 350px;
}

/* Для видео элемента особые правила */
.dm-works-gallery-video {
    flex: 1.5 1 auto;
    min-width: 300px;
}

/* Swiper Modal */
.dm-works-swiper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
}

.dm-works-swiper-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-works-swiper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.dm-works-swiper .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.dm-works-swiper .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dm-works-swiper-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.dm-works-swiper-video {
    width: 100%;
    max-width: 1000px;
    position: relative;
    padding-bottom: 56.25%;
}

.dm-works-swiper-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dm-works-swiper .swiper-button-next,
.dm-works-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.dm-works-swiper .swiper-button-next:after,
.dm-works-swiper .swiper-button-prev:after {
    font-size: 20px;
}

.dm-works-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
}

.dm-works-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: #fff;
}

.dm-works-swiper-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.dm-works-swiper-close:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.8);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .dm-works-col-3,
    .dm-works-col-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dm-works-gallery-item {
        min-width: 33.333%;
        height: 280px;
    }
    
    .dm-works-gallery-item:nth-child(3n+1),
    .dm-works-gallery-item:nth-child(3n+2),
    .dm-works-gallery-item:nth-child(3n+3) {
        min-width: 33.333%;
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .dm-works-col-3,
    .dm-works-col-4,
    .dm-works-col-2 {
        grid-template-columns: 1fr;
    }
    
    .dm-works-single {
        padding: 20px 15px;
		margin: 0px 1%;
    }
	
    
    .dm-works-single-title {
        font-size: 1.8rem;
		margin: 30px 0px;
    }
    
    .dm-works-gallery-item {
        min-width: 50%;
        height: 250px;
    }
    
    .dm-works-gallery-item:nth-child(3n+1),
    .dm-works-gallery-item:nth-child(3n+2),
    .dm-works-gallery-item:nth-child(3n+3) {
        min-width: 50%;
        flex: 1 1 auto;
    }
    
    .dm-works-gallery-video {
        min-width: 50%;
    }
	
	.dm-works-single-container__wrapper{
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
	.dm-works-single-description,
	.dm-works-link,
	.dm-works-single-address{
		text-align: center;
	}
	
	.dm-works-single-description{
		font-size: 22px;
	}
	
	.dm-works-link {
		width: 100%;
		margin: 0px 0px 20px 0px;
	}
}

@media (max-width: 480px) {
    .dm-works-gallery-item {
        min-width: 100%;
        height: 220px;
    }
    
    .dm-works-gallery-item:nth-child(3n+1),
    .dm-works-gallery-item:nth-child(3n+2),
    .dm-works-gallery-item:nth-child(3n+3) {
        min-width: 100%;
    }
    
    .dm-works-gallery-video {
        min-width: 100%;
    }
}



/* Archive страница - альтернативный вариант без смещения */
.dm-works-archive-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
    border-radius: 12px;
    padding: 10px;
    margin: -10px;
}

.dm-works-archive-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dm-works-archive-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 8px;
	padding: 10px;
}

.dm-works-archive-title {
    margin: 5px 0px 10px 0px;
    font-size: 1rem;
    text-align: center;
    color: #333;
    transition: color 0.3s ease;
}

/* Эффект при наведении */
.dm-works-archive-item:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dm-works-archive-item:hover .dm-works-archive-image {
    /*transform: scale(1.05);*/
}

.dm-works-archive-item:hover .dm-works-archive-title {
    /*color: var(--e-global-color-4de8dbf);*/
}