/**
 * VM Gallery block styles.
 */

.vm-cb-main.vm-gallery {
	background: #fff;
	padding: 72px 30px;
}

.vm-cb-main.vm-gallery .vm-cb-inner {
	display: flex;
	flex-direction: column;
	max-width: 1300px;
	padding: 0;
}

.vm-cb-main.vm-gallery .vm-cb-inner:has(.vm-gallery-grid--fit) {
	height: 85vh;
	max-height: 85vh;
}

.vm-gallery-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-shrink: 0;
	gap: 32px;
	margin-bottom: 20px;
}

.vm-gallery-header-text {
	max-width: 720px;
}

.vm-gallery-eyebrow {
	margin: 0 0 14px;
	color: #8e837b;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.18em;
	line-height: 1.2;
	text-transform: uppercase;
}

h2.vm-gallery-title {
	margin: 0;
	color: #4a3728;
	font-size: clamp(36px, 5vw, 58px);
	font-weight: 400;
	line-height: 1.08;

	font-size: 60px;
    font-weight: 400;
    line-height: 1;
	font-family: "TMA Josefin Regular" !important;
}

.vm-gallery-cta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	padding: 12px 22px;
	border: 1px solid #4a3728;
	border-radius: 999px;
	color: #4a3728;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.16em;
	line-height: 1;
	text-decoration: none !important;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.vm-gallery-cta:hover,
.vm-gallery-cta:focus {
	background: #4a3728;
	color: #fff !important;
}

.vm-gallery-cta-arrow {
	font-size: 16px;
	line-height: 1;
}

.vm-gallery-grid {
	display: grid;
	grid-template-columns: 1.15fr 1fr 1fr 1.15fr;
	grid-auto-rows: 520px;
	gap: 12px;
}

.vm-gallery-grid--fit {
	flex: 1 1 auto;
	min-height: 0;
	grid-auto-rows: minmax(0, 1fr);
}

.vm-gallery-col {
	min-height: 0;
}

.vm-gallery-col--span-2 {
	grid-column: span 2;
}

.vm-gallery-col--video-end {
	grid-column: 3 / 5;
}

.vm-gallery-col--stack {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: 12px;
}

.vm-gallery-item {
	position: relative;
	overflow: hidden;
	min-height: 0;
	height: 100%;
	background: #e8e2dc;
}

.vm-gallery-image {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vm-gallery-thumb-video {
	pointer-events: none;
	background: #1a1511;
}

.vm-gallery-trigger--video {
	cursor: pointer;
}

.vm-gallery-trigger {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

.vm-gallery-trigger:focus-visible {
	outline: 2px solid #4a3728;
	outline-offset: 2px;
}

.vm-gallery-trigger--video::after,
.vm-gallery-item--video .vm-gallery-trigger::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 35%, rgba(0, 0, 0, 0.45) 100%);
	pointer-events: none;
}

.vm-gallery-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.96);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.vm-gallery-video-play-icon {
	display: block;
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 9px solid transparent;
	border-bottom: 9px solid transparent;
	border-left: 14px solid #4a3728;
}

body.vm-gallery-lightbox-open {
	overflow: hidden;
}

.vm-gallery-lightbox {
	--vm-gallery-sticky-offset: 120px;
	--vm-gallery-lightbox-top-padding: 24px;
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.vm-gallery-lightbox__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 14, 10, 0.88);
}

.vm-gallery-lightbox__dialog {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: calc(var(--vm-gallery-sticky-offset) + var(--vm-gallery-lightbox-top-padding)) 88px 72px;
	box-sizing: border-box;
}

.vm-gallery-lightbox__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 1200px;
	height: 100%;
	margin: 0;
}

.vm-gallery-lightbox__image,
.vm-gallery-lightbox__video,
.vm-gallery-lightbox__embed {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - var(--vm-gallery-sticky-offset) - var(--vm-gallery-lightbox-top-padding) - 120px);
	width: auto;
	height: auto;
	object-fit: contain;
	background: #000;
}

.vm-gallery-lightbox__video,
.vm-gallery-lightbox__embed {
	width: min(100%, 1200px);
}

.vm-gallery-lightbox__embed {
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
}

.vm-gallery-lightbox__image[hidden],
.vm-gallery-lightbox__video[hidden],
.vm-gallery-lightbox__embed[hidden] {
	display: none;
}

.vm-gallery-lightbox__counter {
	margin-top: 18px;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
}

.vm-gallery-lightbox__close,
.vm-gallery-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.vm-gallery-lightbox__close span,
.vm-gallery-lightbox__nav span {
	height: fit-content;
	width: fit-content;
}

.vm-gallery-lightbox__nav .dashicons,
.vm-gallery-lightbox__close .dashicons {
	width: 24px;
	height: 24px;
	font-size: 24px;
	line-height: 1;
}

.vm-gallery-lightbox__close:hover,
.vm-gallery-lightbox__close:focus,
.vm-gallery-lightbox__nav:hover,
.vm-gallery-lightbox__nav:focus {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.65);
}

.vm-gallery-lightbox__close {
	top: calc(var(--vm-gallery-sticky-offset) + var(--vm-gallery-lightbox-top-padding));
	right: 24px;
}

.vm-gallery-lightbox__nav--prev {
	top: 50%;
	left: 24px;
	transform: translateY(-50%);
}

.vm-gallery-lightbox__nav--next {
	top: 50%;
	right: 24px;
	transform: translateY(-50%);
}

.vm-gallery-lightbox__data {
	display: none;
}

@media (max-width: 767px) {
	.vm-gallery-lightbox {
		--vm-gallery-lightbox-top-padding: 16px;
	}

	.vm-gallery-lightbox__dialog {
		padding: calc(var(--vm-gallery-sticky-offset) + var(--vm-gallery-lightbox-top-padding)) 20px 88px;
	}

	.vm-gallery-lightbox__close {
		top: calc(var(--vm-gallery-sticky-offset) + var(--vm-gallery-lightbox-top-padding));
		right: 16px;
	}

	.vm-gallery-lightbox__nav--prev {
		left: 12px;
	}

	.vm-gallery-lightbox__nav--next {
		right: 12px;
	}

	.vm-gallery-lightbox__image,
	.vm-gallery-lightbox__video,
	.vm-gallery-lightbox__embed {
		max-height: calc(100vh - var(--vm-gallery-sticky-offset) - var(--vm-gallery-lightbox-top-padding) - 140px);
	}
}

@media (max-width: 1000px) {
	.vm-cb-main.vm-gallery {
		padding: 56px 22px 64px;
	}

	.vm-cb-main.vm-gallery .vm-cb-inner {
		display: block;
		height: auto;
		max-height: none;
	}

	.vm-cb-main.vm-gallery .vm-cb-inner:has(.vm-gallery-grid--fit) {
		height: auto;
		max-height: none;
	}

	.vm-gallery-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		margin-bottom: 32px;
	}

	.vm-gallery-grid {
		display: grid;
		flex: none;
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: minmax(170px, auto);
		grid-auto-flow: dense;
		gap: 10px;
		height: auto;
		max-height: none;
		min-height: 0;
	}

	.vm-gallery-col--tall,
	.vm-gallery-col--stack,
	.vm-gallery-col--video {
		grid-row: span 2;
		min-height: 0;
	}

	.vm-gallery-col--span-2,
	.vm-gallery-col--video-end {
		grid-column: auto;
	}

	.vm-gallery-col--video:last-child {
		grid-column: 2;
	}

	.vm-gallery-item {
		height: 100%;
		min-height: 160px;
		aspect-ratio: auto;
	}

	.vm-gallery-col--tall .vm-gallery-item,
	.vm-gallery-col--video .vm-gallery-item {
		height: 100%;
		min-height: 340px;
		aspect-ratio: 3 / 4;
	}

	.vm-gallery-image {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.vm-gallery-video-play {
		width: 52px;
		height: 52px;
	}
}

@media (max-width: 640px) {
	.vm-gallery-grid {
		grid-template-columns: 1fr;
		grid-auto-rows: auto;
	}

	.vm-gallery-col--tall,
	.vm-gallery-col--stack,
	.vm-gallery-col--video {
		grid-row: auto;
	}

	.vm-gallery-col--video:last-child {
		grid-column: auto;
	}

	.vm-gallery-item,
	.vm-gallery-col--stack .vm-gallery-item {
		height: auto;
		min-height: 220px;
		aspect-ratio: 4 / 3;
	}

	.vm-gallery-col--tall .vm-gallery-item,
	.vm-gallery-col--video .vm-gallery-item {
		height: auto;
		min-height: 280px;
		aspect-ratio: 3 / 4;
	}

	.vm-gallery-cta {
		width: 100%;
		justify-content: center;
	}
}
