/*
 * TradeKit Gallery block styles.
 */

.tk-gallery {
	--tk-gallery-bg: var(--wp--preset--color--light);
	--tk-gallery-heading: var(--wp--preset--color--dark);
	--tk-gallery-body: var(--wp--preset--color--neutral-600);
	--tk-gallery-accent: var(--wp--preset--color--accent);
	--tk-gallery-card-bg: #fff;
	--tk-gallery-card-text: var(--wp--preset--color--dark);
	--tk-gallery-overlay: #0f172a;
	--tk-gallery-overlay-opacity: 0.52;
	--tk-gallery-radius: var(--tk-radius-default);
	--tk-features-carousel-arrow-color: var(--tk-gallery-heading);
	--tk-features-carousel-arrow-bg: color-mix(in srgb, var(--tk-gallery-card-bg) 90%, transparent);
	--tk-features-carousel-arrow-border: color-mix(in srgb, var(--tk-gallery-heading) 20%, transparent);
	--tk-features-carousel-dot-color: color-mix(in srgb, var(--tk-gallery-heading) 26%, transparent);
	--tk-features-carousel-dot-active-color: var(--tk-gallery-accent);
	--tk-features-per-view: 1;
	--tk-gallery-gap: clamp(14px, 1.8vw, 24px);
	background: var(--tk-gallery-bg);
	color: var(--tk-gallery-heading);
}

.wp-block-tradekit-gallery,
.tk-gallery {
	max-inline-size: 100%;
	width: 100%;
}

.wp-block-tradekit-gallery.alignfull,
.tk-gallery.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: none;
	width: auto;
}

.tk-gallery .tk-section-block__background-overlay {
	background-color: var(--tk-gallery-overlay);
	opacity: var(--tk-gallery-overlay-opacity);
}

.tk-gallery :where(.tk-section-intro__eyebrow) {
	--tk-section-accent: var(--tk-gallery-accent);
}

.tk-gallery :where(.tk-section-intro__headline) {
	--tk-section-heading: var(--tk-gallery-heading);
}

.tk-gallery :where(.tk-section-intro__copy) {
	--tk-section-body: var(--tk-gallery-body);
}

.tk-gallery__grid {
	display: grid;
	gap: var(--tk-gallery-gap);
}

.tk-gallery--columns-2 .tk-gallery__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tk-gallery--columns-3 .tk-gallery__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tk-gallery--columns-4 .tk-gallery__grid {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tk-gallery__item {
	background: var(--tk-gallery-card-bg);
	border: 1px solid color-mix(in srgb, var(--tk-gallery-heading) 12%, transparent);
	border-radius: var(--tk-gallery-radius);
	display: grid;
	overflow: hidden;
}

.tk-gallery__media {
	aspect-ratio: 4 / 3;
	margin: 0;
	overflow: hidden;
}

.tk-gallery--ratio-landscape .tk-gallery__media {
	aspect-ratio: 4 / 3;
}

.tk-gallery--ratio-widescreen .tk-gallery__media {
	aspect-ratio: 16 / 9;
}

.tk-gallery--ratio-square .tk-gallery__media {
	aspect-ratio: 1 / 1;
}

.tk-gallery--ratio-portrait .tk-gallery__media {
	aspect-ratio: 3 / 4;
}

.tk-gallery--ratio-original .tk-gallery__media {
	aspect-ratio: auto;
}

.tk-gallery__media-link {
	display: block;
	height: 100%;
	width: 100%;
}

.tk-gallery__image {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.tk-gallery__content {
	display: grid;
	gap: 8px;
	padding: clamp(14px, 1.8vw, 20px);
}

.tk-gallery__title {
	color: var(--tk-gallery-card-text);
	font-size: var(--wp--preset--font-size--h4);
	line-height: 1.2;
	margin: 0;
}

.tk-gallery__caption {
	color: color-mix(in srgb, var(--tk-gallery-card-text) 80%, transparent);
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.5;
}

.tk-gallery__caption p {
	margin: 0;
}

.tk-gallery--layout-masonry .tk-gallery__media {
	aspect-ratio: auto;
}

.tk-gallery--card-outline-none .tk-gallery__item {
	border: 0;
}

.tk-gallery--geometry-cut .tk-gallery__item {
	clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.tk-gallery--layout-spotlight .tk-gallery__grid {
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
}

.tk-gallery--layout-spotlight .tk-gallery__item:first-child {
	grid-row: span 2;
}

.tk-gallery--layout-spotlight.tk-gallery--ratio-landscape .tk-gallery__item:first-child .tk-gallery__media {
	aspect-ratio: 16 / 10;
}

.tk-gallery--layout-spotlight.tk-gallery--ratio-widescreen .tk-gallery__item:first-child .tk-gallery__media {
	aspect-ratio: 16 / 9;
}

.tk-gallery--layout-spotlight.tk-gallery--ratio-square .tk-gallery__item:first-child .tk-gallery__media {
	aspect-ratio: 1 / 1;
}

.tk-gallery--layout-spotlight.tk-gallery--ratio-portrait .tk-gallery__item:first-child .tk-gallery__media {
	aspect-ratio: 3 / 4;
}

.tk-gallery--layout-spotlight.tk-gallery--ratio-original .tk-gallery__item:first-child .tk-gallery__media {
	aspect-ratio: auto;
}

.tk-gallery--surface-dark {
	--tk-gallery-bg: var(--wp--preset--color--dark);
	--tk-gallery-heading: var(--wp--preset--color--light);
	--tk-gallery-body: var(--wp--preset--color--neutral-100);
	--tk-gallery-card-bg: color-mix(in srgb, var(--wp--preset--color--dark) 80%, #1e293b 20%);
	--tk-gallery-card-text: var(--wp--preset--color--light);
}

.tk-gallery--surface-brand {
	--tk-gallery-bg: var(--wp--preset--color--primary);
	--tk-gallery-heading: var(--wp--preset--color--light);
	--tk-gallery-body: var(--wp--preset--color--neutral-100);
	--tk-gallery-accent: var(--wp--preset--color--light);
	--tk-gallery-card-bg: color-mix(in srgb, var(--wp--preset--color--light) 94%, var(--wp--preset--color--primary) 6%);
	--tk-gallery-card-text: var(--wp--preset--color--dark);
}

.tk-gallery--geometry-clean {
	--tk-gallery-radius: var(--tk-radius-clean);
}

.tk-gallery--geometry-soft {
	--tk-gallery-radius: var(--tk-radius-soft);
}

.tk-gallery--geometry-cut {
	--tk-gallery-radius: var(--tk-radius-cut);
}

.tk-gallery--intro-center .tk-section-intro {
	justify-items: center;
	margin-inline: auto;
	text-align: center;
}

.tk-gallery--carousel-active .tk-features__carousel {
	padding-inline: clamp(52px, 5.5vw, 76px);
	position: relative;
}

.tk-gallery--carousel-active .tk-features__viewport {
	overflow: hidden;
	width: 100%;
}

.tk-gallery--carousel-active .tk-features__items--carousel {
	display: flex;
	gap: var(--tk-gallery-gap);
	padding: 4px 0;
	transform: translate3d(0, 0, 0);
	will-change: transform;
}

.tk-gallery--carousel-active .tk-features__slide {
	flex: 0 0 calc((100% - (var(--tk-gallery-gap) * (var(--tk-features-per-view) - 1))) / var(--tk-features-per-view));
	max-width: calc((100% - (var(--tk-gallery-gap) * (var(--tk-features-per-view) - 1))) / var(--tk-features-per-view));
}

.tk-gallery .tk-features__carousel-arrow {
	align-items: center;
	background: var(--tk-features-carousel-arrow-bg);
	border: 1px solid var(--tk-features-carousel-arrow-border);
	border-radius: 999px;
	color: var(--tk-features-carousel-arrow-color);
	display: inline-flex;
	height: 2.6rem;
	justify-content: center;
	width: 2.6rem;
}

.tk-gallery .tk-features__carousel-dots {
	display: flex;
	gap: 8px;
}

.tk-gallery .tk-features__carousel-dot {
	background: var(--tk-features-carousel-dot-color);
	border: 0;
	border-radius: 999px;
	height: 8px;
	padding: 0;
	width: 8px;
}

.tk-gallery .tk-features__carousel-dot.is-active {
	background: var(--tk-features-carousel-dot-active-color);
}

@media (max-width: 1023px) {

	.tk-gallery--columns-4 .tk-gallery__grid,
	.tk-gallery--columns-3 .tk-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tk-gallery--layout-spotlight .tk-gallery__grid {
		grid-template-columns: 1fr;
	}

	.tk-gallery--layout-spotlight .tk-gallery__item:first-child {
		grid-row: auto;
	}
}

@media (max-width: 782px) {

	.tk-gallery__grid,
	.tk-gallery--columns-2 .tk-gallery__grid,
	.tk-gallery--columns-3 .tk-gallery__grid,
	.tk-gallery--columns-4 .tk-gallery__grid {
		grid-template-columns: 1fr;
	}
}
