/**
 * Azurix Smart Media Slider — frontend styles.
 *
 * All selectors are namespaced under .azurix-sms to avoid theme/plugin clashes.
 *
 * @package AzurixSmartMediaSlider
 */

.azurix-sms {
	--azurix-cols: 3;
	--azurix-cols-t: 2;
	--azurix-cols-m: 1;
	--azurix-gap: 16px;
	--azurix-ratio: 1 / 1;
	--azurix-row-height: 220px;
	--azurix-accent: #2563eb;
	position: relative;
	box-sizing: border-box;
	max-width: 100%;
}

.azurix-sms *,
.azurix-sms *::before,
.azurix-sms *::after {
	box-sizing: border-box;
}

.azurix-sms__item {
	margin: 0;
	overflow: hidden;
	border-radius: 8px;
	background: #f1f1f1;
	position: relative;
}

.azurix-sms__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.azurix-sms__lb,
.azurix-sms__link {
	display: block;
	width: 100%;
	height: 100%;
	cursor: pointer;
}

.azurix-sms__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 14px 10px;
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.7 ), rgba( 0, 0, 0, 0 ) );
}

/* ------------------------------------------------------------------ Grid */
.azurix-sms__grid {
	display: grid;
	grid-template-columns: repeat( var(--azurix-cols), minmax( 0, 1fr ) );
	gap: var(--azurix-gap);
}

.azurix-sms--grid .azurix-sms__item,
.azurix-sms--filterable .azurix-sms__item {
	aspect-ratio: var(--azurix-ratio);
}

/* --------------------------------------------------------------- Masonry */
.azurix-sms__masonry {
	column-count: var(--azurix-cols);
	column-gap: var(--azurix-gap);
}

.azurix-sms__masonry .azurix-sms__item {
	break-inside: avoid;
	margin-bottom: var(--azurix-gap);
	display: inline-block;
	width: 100%;
}

.azurix-sms__masonry .azurix-sms__img {
	height: auto;
}

.azurix-load-hidden {
	display: none !important;
}

.azurix-sms__more-wrap {
	text-align: center;
	margin-top: 24px;
}

.azurix-sms__more {
	appearance: none;
	border: 0;
	cursor: pointer;
	padding: 11px 26px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--azurix-accent);
	transition: opacity 0.2s ease;
}

.azurix-sms__more:hover {
	opacity: 0.88;
}

/* ------------------------------------------------------------- Justified */
.azurix-sms__justified {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
}

.azurix-sms__justified .azurix-just-item {
	margin-right: var(--azurix-gap);
	height: var(--azurix-row-height);
	flex: 0 0 auto;
}

.azurix-sms__justified .azurix-just-item .azurix-sms__img {
	height: 100%;
	width: 100%;
}

/* ------------------------------------------------------------ Filterable */
.azurix-sms__filters {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.azurix-filter-left {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 28px;
	align-items: start;
}

.azurix-filter-left .azurix-sms__filters {
	flex-direction: column;
	margin: 0;
}

.azurix-filter-btn {
	appearance: none;
	border: 1px solid #e2e4e7;
	background: #fff;
	color: #1e1e1e;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.18s ease;
}

.azurix-filter-btn:hover,
.azurix-filter-btn.is-active {
	background: var(--azurix-accent);
	border-color: var(--azurix-accent);
	color: #fff;
}

.azurix-filter-item {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.azurix-filtered-out {
	display: none !important;
}

/* --------------------------------------------------------------- Pagination */
.azurix-paged-hidden {
	display: none !important;
}

.azurix-sms__pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 24px;
}

.azurix-page-btn {
	appearance: none;
	min-width: 38px;
	height: 38px;
	border: 1px solid #e2e4e7;
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
}

.azurix-page-btn.is-active {
	background: var(--azurix-accent);
	border-color: var(--azurix-accent);
	color: #fff;
}

/* ---------------------------------------------------------------- Carousel */
.azurix-sms--carousel .azurix-swiper {
	overflow: hidden;
}

.azurix-sms--carousel .swiper-slide {
	height: auto;
}

.azurix-sms--carousel .azurix-sms__item {
	height: 100%;
}

.azurix-sms--vertical .azurix-swiper {
	height: var(--azurix-carousel-height, 380px);
}

/* Natural / random-height carousel: keep each image's aspect ratio (capped at
   a max height) so slides vary in height, aligned along a common baseline. */
.azurix-imgheight-natural .swiper-wrapper {
	align-items: flex-end; /* default = bottom */
}

.azurix-imgheight-natural.azurix-align-top .swiper-wrapper {
	align-items: flex-start;
}

.azurix-imgheight-natural.azurix-align-center .swiper-wrapper {
	align-items: center;
}

.azurix-imgheight-natural.azurix-align-bottom .swiper-wrapper {
	align-items: flex-end;
}

.azurix-imgheight-natural .swiper-slide,
.azurix-imgheight-natural .azurix-sms__item,
.azurix-imgheight-natural .azurix-sms__lb,
.azurix-imgheight-natural .azurix-sms__link {
	height: auto;
}

.azurix-imgheight-natural .azurix-sms__item {
	aspect-ratio: auto;
}

.azurix-imgheight-natural .azurix-sms__img {
	width: 100%;
	height: auto;
	max-height: var(--azurix-max-height, 420px);
	object-fit: cover;
}

.azurix-sms__arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	z-index: 5;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #1e1e1e;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.15 );
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s ease, opacity 0.18s ease;
}

.azurix-sms__arrow:hover {
	background: #fff;
}

.azurix-sms__prev {
	left: 8px;
}

.azurix-sms__next {
	right: 8px;
}

.azurix-sms__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

.azurix-sms__dots {
	position: static;
	margin-top: 16px;
	text-align: center;
}

.azurix-sms__dots .swiper-pagination-bullet-active {
	background: var(--azurix-accent);
}

.azurix-sms__progress {
	height: 4px;
	margin-top: 16px;
	border-radius: 999px;
	background: #e6e8eb;
	overflow: hidden;
}

.azurix-sms__progress-bar {
	display: block;
	height: 100%;
	width: 100%;
	transform-origin: left center;
	transform: scaleX( 0 );
	background: var(--azurix-accent);
	transition: transform 0.1s linear;
}

/* ----------------------------------------------------------- Hover effects */
.azurix-hover-zoom-in .azurix-sms__img,
.azurix-hover-zoom-out .azurix-sms__img,
.azurix-hover-grayscale .azurix-sms__img,
.azurix-hover-fade .azurix-sms__img {
	transition: transform 0.45s ease, filter 0.45s ease, opacity 0.35s ease;
}

.azurix-hover-zoom-in:hover .azurix-sms__img {
	transform: scale( 1.08 );
}

.azurix-hover-zoom-out .azurix-sms__img {
	transform: scale( 1.08 );
}

.azurix-hover-zoom-out:hover .azurix-sms__img {
	transform: scale( 1 );
}

.azurix-hover-grayscale .azurix-sms__img {
	filter: grayscale( 100% );
}

.azurix-hover-grayscale:hover .azurix-sms__img {
	filter: grayscale( 0 );
}

.azurix-hover-fade:hover .azurix-sms__img {
	opacity: 0.78;
}

.azurix-hover-lift {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.azurix-hover-lift:hover {
	transform: translateY( -6px );
	box-shadow: 0 14px 30px rgba( 0, 0, 0, 0.18 );
}

/* ------------------------------------------------------ Entrance animation */
@keyframes azurixFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes azurixSlideUp { from { opacity: 0; transform: translateY( 24px ); } to { opacity: 1; transform: none; } }
@keyframes azurixZoom { from { opacity: 0; transform: scale( 0.94 ); } to { opacity: 1; transform: none; } }

.azurix-anim-fade .azurix-sms__item { animation: azurixFade 0.6s ease both; }
.azurix-anim-slide-up .azurix-sms__item { animation: azurixSlideUp 0.6s ease both; }
.azurix-anim-zoom .azurix-sms__item { animation: azurixZoom 0.6s ease both; }

/* --------------------------------------------------------- Lightbox caption */
.azurix-pswp-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 20px;
	color: #fff;
	font-size: 14px;
	text-align: center;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.6 ), transparent );
	pointer-events: none;
}

/* --------------------------------------------------------------- Responsive */
@media ( max-width: 1023px ) {
	.azurix-sms__grid { grid-template-columns: repeat( var(--azurix-cols-t), minmax( 0, 1fr ) ); }
	.azurix-sms__masonry { column-count: var(--azurix-cols-t); }
}

@media ( max-width: 767px ) {
	.azurix-sms__grid { grid-template-columns: repeat( var(--azurix-cols-m), minmax( 0, 1fr ) ); }
	.azurix-sms__masonry { column-count: var(--azurix-cols-m); }
	.azurix-filter-left { grid-template-columns: 1fr; }
}

@media ( prefers-reduced-motion: reduce ) {
	.azurix-sms__item,
	.azurix-sms__img,
	.azurix-filter-item {
		animation: none !important;
		transition: none !important;
	}
}
