/**
 * Gallery Modal Styles
 *
 * Layout: categories top, then images (~71%) + description (~24%) below.
 * Matches Figma "pop-up v2" (1920x768 with 80px padding).
 * Uses theme.json tokens -- no hardcoded values.
 */

/* --- Dialog overlay --- */
.gallery-modal {
	position: fixed;
	inset: 0;
	width: 95vw;
	max-width: none;
	height: auto;
	max-height: 90vh;
	margin: auto;
	padding: var(--wp--preset--spacing--80);
	border: none;
	border-radius: var(--wp--custom--border--rounded-small);
	background-color: var(--wp--preset--color--theme-01);
	overflow: hidden;
}

.gallery-modal::backdrop {
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-02) 70%, transparent);
}

.gallery-modal[open] {
	display: flex;
}

/* --- Content wrapper --- */
.gallery-modal__content {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	position: relative;
	gap: var(--wp--preset--spacing--40);
}

/* --- Categories row at top --- */
.gallery-modal__categories {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--50);
}

.gallery-modal__category {
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--extra-wide);
	line-height: var(--wp--custom--line-height--normal);
	text-transform: uppercase;
	color: var(--wp--preset--color--theme-03);
}

/* --- Close button (top right) --- */
.gallery-modal__close {
	position: absolute;
	top: 0;
	right: 0;
	width: 67px;
	height: 67px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--wp--preset--color--theme-06);
	border: none;
	border-radius: 0;
	cursor: pointer;
	color: var(--wp--preset--color--theme-03);
	transition: color 0.2s ease, background-color 0.2s ease;
	z-index: 10;
}

.gallery-modal__close:hover {
	color: var(--wp--preset--color--theme-02);
}

.gallery-modal__close svg {
	width: 30px;
	height: 30px;
}

/* --- Body: images + description side by side --- */
.gallery-modal__body {
	display: flex;
	gap: var(--wp--preset--spacing--80);
	flex: 1;
	min-height: 0;
	align-items: center;
}

/* --- Images section (~71%) --- */
.gallery-modal__images {
	position: relative;
	display: flex;
	flex: 0 0 71%;
	height: 520px;
}

.gallery-modal__before,
.gallery-modal__after {
	flex: 1;
	position: relative;
	overflow: hidden;
}

.gallery-modal__before img,
.gallery-modal__after img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gallery-modal__placeholder {
	width: 100%;
	height: 100%;
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-02) 15%, transparent);
}

.gallery-modal__after .gallery-modal__placeholder {
	background-color: color-mix(in srgb, var(--wp--preset--color--theme-02) 8%, transparent);
}

/* --- BEFORE / AFTER label bar --- */
.gallery-modal__labels {
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	background-color: #fff;
	z-index: 2;
}

.gallery-modal__label {
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--extra-wide);
	line-height: var(--wp--custom--line-height--normal);
	text-transform: uppercase;
	color: var(--wp--preset--color--theme-02);
	padding: var(--wp--custom--spacing--4) var(--wp--preset--spacing--40);
}

/* --- Description (~24%, remaining space) --- */
.gallery-modal__description {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 300;
	line-height: 1.55;
	letter-spacing: 0.01em;
	color: var(--wp--preset--color--theme-02);
}

.gallery-modal__description p {
	margin: 0 0 1em 0;
}

.gallery-modal__description p:last-child {
	margin-bottom: 0;
}

/* --- Responsive: stack on mobile/tablet --- */
@media (max-width: 900px) {
	.gallery-modal {
		width: 100%;
		max-height: 100vh;
		height: 100vh;
		border-radius: 0;
		padding: var(--wp--preset--spacing--40);
	}

	.gallery-modal__content {
		overflow-y: auto;
		gap: var(--wp--preset--spacing--30);
	}

	.gallery-modal__categories {
		gap: var(--wp--preset--spacing--30);
	}

	.gallery-modal__category {
		font-size: var(--wp--preset--font-size--small);
	}

	.gallery-modal__close {
		width: 44px;
		height: 44px;
	}

	.gallery-modal__close svg {
		width: 20px;
		height: 20px;
	}

	.gallery-modal__body {
		flex-direction: column;
		gap: var(--wp--preset--spacing--30);
	}

	.gallery-modal__images {
		flex: 0 0 auto;
		height: 35vh;
		min-height: 200px;
	}

	.gallery-modal__description {
		justify-content: flex-start;
	}
}
