/* CUSTOM TILES SHORTCODE STYLES */

.custom-tiles-wrapper {
    width: 100%;
    margin: 40px 0;
}

@media screen and (min-width: 1251px) {
	.custom-tiles-grid {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 0;
	}
	
	.custom-tiles-nav {
		display: none !important;
	}
}

.custom-tile-item {
    position: relative;
    width: 100%;
	aspect-ratio: 640 / 330; 
    cursor: pointer;
    overflow: hidden;
    background-color: #f0f0f0;
}

.custom-tile-item:after {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0;
	top: 0;
	background: linear-gradient(180deg, rgba(0, 1, 1, 0) 0%, rgba(0, 1, 1, 0.7) 68.75%);
	transition: all 0.3s ease;
}

.custom-tile-item:hover:after {
	opacity: 0.6;
	transition: all 0.3s ease;
}
	
.custom-tile-item .tile-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.custom-tile-item:hover .tile-img {
    transform: scale(1.05);
}

.custom-tile-item .tile-content {
    position: absolute;
	z-index: 5;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 35px;
    box-sizing: border-box;
    display: flex;
	gap: 50px;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    pointer-events: none;
}

.custom-tile-item .tile-title {
    font-size: 26px;
    font-weight: 600;
	flex-grow: 1;
	line-height: 1.3;
}

.custom-tile-item .tile-more {
	display: flex;
	align-items: center;
	gap: 8px;
	
	flex-basis: max-content;
	min-width: max-content;
	text-align: right;
    font-size: 16px;
    font-weight: 400;
	text-transform: lowercase;
	line-height: 1.2;
	padding: 0 2px 4px 2px;
	border-bottom: 1px solid var(--green);
	transition: all 0.3s ease;
}

.custom-tile-item:hover .tile-more {
	background: #8ABB224D;
	transition: all 0.3s ease;
}

/* POPUP STYLES */
.custom-tiles-popup {
    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s ease;

    /* Full screen overlay */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    
    /* Blur and Dim */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* Centering the modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-tiles-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-inner {
    display: flex;
    width: 100%;
    height: 80vh;
    background: #013A31;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* Animation initial state */
    transform: translateY(20px) scale(0.98);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-tiles-popup.active .popup-inner {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.popup-left {
    width: 50%;
    height: 100%;
    background: #000;
}

.popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popup-right {
    width: 50%;
    height: 100%;
    background: #013A31;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 3% 5%;
    box-sizing: border-box;
    position: relative;
}

@media screen and (max-width: 1200px) {
	.popup-right {
		padding: 3% 30px;
	}
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.popup-counter {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
	letter-spacing: 1px;
}

.popup-close {
    cursor: pointer;
	width: 44px;
	height: 44px;
    transition: transform 0.3s;
}
.popup-close:hover {
    transform: rotate(90deg);
}

.popup-content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 40px;
    padding-right: 20px;
}

.popup-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.popup-description {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
}

.popup-navigation {
    display: flex;
    justify-content: space-between;
}

.nav-prev, .nav-next {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #fff;
    max-width: 45%;
	padding: 0 3px;
	border-bottom: 1px solid var(--green);
	line-height: 1.4;
    transition: all 0.3s;
}

.nav-prev:hover,
.nav-next:hover {
	background: #8ABB224D;
    transition: all 0.3s;
}

.nav-label-title {
    font-weight: 600;
    margin: 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


@media screen and (max-width: 1250px) {
    .custom-tiles-nav {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 15px;
        margin-top: 20px;
		padding: 0 3%;
		box-sizing: border-box;
    }

    .custom-tiles-nav .swiper-button-next,
    .custom-tiles-nav .swiper-button-prev {
		position: relative;
		left: unset;
		top: unset;
		right: unset;
		margin: unset;
		
		display: flex;
		align-items: center;
		justify-content: center;
		width: 50px;
		height: 25px;
		box-sizing: border-box;
		border: 1px solid #B1CD38;
		border-radius: 32px;
		background: transparent;
		cursor: pointer;
		transition: background 0.3s;
	}

    .custom-tiles-nav .swiper-button-next:hover,
    .custom-tiles-nav .swiper-button-prev:hover {
		background-color: rgba(177, 205, 56, 0.1);
	}

    .custom-tiles-nav .swiper-button-next {
		background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.33325 3.55545L10.6666 7.99989L5.33325 12.4443' stroke='%23042520' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center;
	}

    .custom-tiles-nav .swiper-button-prev {
		background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.33325 3.55545L10.6666 7.99989L5.33325 12.4443' stroke='%23042520' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center;
		transform: rotate(180deg);
	}
	
    .custom-tiles-nav .swiper-button-next:after,
    .custom-tiles-nav .swiper-button-prev:after {
		display: none !important;
	}
		
	
    .custom-tiles-nav .swiper-button-next svg,
    .custom-tiles-nav .swiper-button-prev svg {
		display: none !important;
	}
		
}

@media screen and (max-width: 1000px) {
	.popup-inner {
		height: 65vh;
	}
	
	.custom-tile-item .tile-content {
		padding: 20px;
	}
	
	.custom-tile-item .tile-title {
		font-size: 20px;
	}
	
	/* Removed old horizontal scroll styles */
	
	.popup-left {
		display: none;
	}
	
	.popup-right {
		width: 100%;
	}
	
	.popup-title {
    font-size: clamp(26px, 7vw, 36px);
}

	
}

@media screen and (max-width: 750px) {
    /* Removed old width overrides, handled by Swiper */
	
	.nav-label-title {
		display: none;
	}
	
	.nav-prev, .nav-next {
		border-bottom: 0;
	}
	.nav-prev svg, .nav-next svg {
		width: 12px;
		height: 20px;
	}
	
	.popup-header {
		margin-bottom: 20px;
	}
	
	.popup-close {
		width: 36px;
		height: 36px;
	}
	
	.popup-close svg {
		width: 36px;
		height: 36px;
	}
	
	.popup-right {
		padding: 20px 5%;
	}
	
}

@media screen and (max-width: 550px) {
	.custom-tile-item {
		width: 60vw;
		min-width: 300px;
		aspect-ratio: 640 / 500;
	}
}