/* =========================================================================
   RM Gallery — Elementor widget styles
   Namespaced under .rmg-root to avoid collisions with theme CSS.
   ========================================================================= */

@import url("https://fonts.cdnfonts.com/css/thegoodmonolith");

@font-face {
	font-family: "PPNeueMontreal";
	src: url("https://assets.codepen.io/7558/PPNeueMontreal-Variable.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "DuruSans";
	src: url("../fonts/DuruSans-Regular.ttf") format("truetype");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

/* -------------------------------------------------------------------------
   Root + tokens
   ------------------------------------------------------------------------- */
.rmg-root {
	--rmg-bg: #FFFFFF;
	--rmg-text-primary: #000000;
	--rmg-text-secondary: #3E4148;
	--rmg-accent-1: #AF2769;
	--rmg-accent-2: #3D3615;
	--rmg-border: rgba(0, 0, 0, 0.12);
	--rmg-radius: 12px;
	--rmg-cell-bg: #F4F4F2;
	--rmg-item-min: 320px;
	--rmg-gap: 16px;
	position: relative;
	width: 100%;
	height: 100vh;
	font-family: "PPNeueMontreal", sans-serif;
	background: var(--rmg-bg);
	color: var(--rmg-text-primary);
	overflow: hidden;
}

.rmg-root *,
.rmg-root *::before,
.rmg-root *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Trigger modes
   selector/button render the gallery as a viewport-fixed overlay, hidden
   until .rmg-open is toggled by JS open()/closeLightbox().
   trigger=auto keeps the in-flow 100vh container above.
   ------------------------------------------------------------------------- */
.rmg-root[data-rmg-trigger="selector"],
.rmg-root[data-rmg-trigger="button"] {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99999;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.rmg-root[data-rmg-trigger="selector"].rmg-open,
.rmg-root[data-rmg-trigger="button"].rmg-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

body.rmg-modal-open {
	overflow: hidden;
}

/* Elementor editor: force the overlay variants visible in editor canvas
   so the user can actually see what they're editing. */
body.elementor-editor-active .rmg-root[data-rmg-trigger="selector"],
body.elementor-editor-active .rmg-root[data-rmg-trigger="button"],
body.elementor-edit-mode .rmg-root[data-rmg-trigger="selector"],
body.elementor-edit-mode .rmg-root[data-rmg-trigger="button"] {
	position: relative;
	width: 100%;
	height: 100vh;
	z-index: auto;
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* -------------------------------------------------------------------------
   Preloader
   ------------------------------------------------------------------------- */
.rmg-preloader-overlay {
	background: var(--rmg-bg);
}

/* -------------------------------------------------------------------------
   Lightbox = the scrollable container that fills the root
   ------------------------------------------------------------------------- */
.rmg-lightbox {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overflow-x: hidden;
	background: var(--rmg-bg);
	padding: 5vh 5vw;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
	opacity: 0;
}

.rmg-lightbox::-webkit-scrollbar {
	width: 8px;
}

.rmg-lightbox::-webkit-scrollbar-track {
	background: transparent;
}

.rmg-lightbox::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.18);
	border-radius: 4px;
}

.rmg-lightbox::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.32);
}

/* -------------------------------------------------------------------------
   Grid — responsive auto-fill
   ------------------------------------------------------------------------- */
.rmg-grid-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--rmg-item-min), 1fr));
	gap: var(--rmg-gap);
	width: 100%;
}

/* -------------------------------------------------------------------------
   Grid items
   ------------------------------------------------------------------------- */
.rmg-grid-item {
	position: relative;
	aspect-ratio: 1;
	background: var(--rmg-cell-bg);
	border-radius: var(--rmg-radius);
	overflow: hidden;
	cursor: pointer;
	outline: 1px solid transparent;
	outline-offset: -1px;
	transition: outline-color 0.2s ease, opacity 0.6s ease;
}

.rmg-grid-item-image:hover,
.rmg-grid-item-video:hover {
	outline-color: var(--rmg-accent-1);
}

.rmg-grid-item.rmg-out-of-view {
	opacity: 0.35;
}

.rmg-grid-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

/* Text cell */
.rmg-grid-item-text {
	background: #FFFFFF;
	color: var(--rmg-accent-1);
	border: 2px solid var(--rmg-accent-1);
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: left;
	transition: background 0.3s ease, color 0.3s ease;
}

.rmg-grid-item-text:hover {
	outline-color: transparent !important;
	background: var(--rmg-accent-1);
	color: #FFFFFF;
}

.rmg-grid-text-title {
	font-family: "DuruSans", sans-serif;
	font-size: 1.5em;
	font-weight: 600;
	line-height: 1.15;
	margin-bottom: 12px;
	letter-spacing: -0.01em;
}

.rmg-grid-text-body {
	font-family: "PPNeueMontreal", sans-serif;
	font-size: 0.82em;
	font-weight: 400;
	line-height: 1.45;
	opacity: 0.92;
	white-space: pre-line;
}

/* -------------------------------------------------------------------------
   Video grid tile play overlay
   ------------------------------------------------------------------------- */
.rmg-play-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.15);
	transition: background 0.3s ease;
	pointer-events: none;
}

.rmg-play-overlay::before {
	content: "";
	position: absolute;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	transition: transform 0.3s ease, background 0.3s ease;
}

.rmg-play-icon {
	position: relative;
	width: 28px;
	height: 28px;
	z-index: 1;
	transform: translateX(2px);
	transition: transform 0.3s ease;
}

.rmg-grid-item-video:hover .rmg-play-overlay {
	background: rgba(0, 0, 0, 0.3);
}

.rmg-grid-item-video:hover .rmg-play-overlay::before {
	background: rgba(0, 0, 0, 0.85);
	transform: scale(1.1);
}

.rmg-grid-item-video:hover .rmg-play-icon {
	transform: translateX(2px) scale(1.1);
}

/* -------------------------------------------------------------------------
   Lightbox close (top-right) — exits the whole gallery
   ------------------------------------------------------------------------- */
.rmg-lightbox-close {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	width: 48px;
	height: 48px;
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--rmg-text-primary);
	z-index: 100;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.rmg-lightbox-close:hover {
	opacity: 0.6;
	transform: rotate(90deg);
}

.rmg-lightbox-close svg {
	width: 32px;
	height: 32px;
}

/* -------------------------------------------------------------------------
   Expand backdrop — overlays the gallery when an item is clicked
   ------------------------------------------------------------------------- */
.rmg-expand-backdrop {
	position: absolute;
	inset: 0;
	background: var(--rmg-bg);
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}

.rmg-expand-backdrop.rmg-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.rmg-expand-stage {
	width: min(90vw, 1280px);
	height: min(85vh, 900px);
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rmg-expand-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	border-radius: var(--rmg-radius);
}

.rmg-expand-video {
	max-width: 100%;
	max-height: 100%;
	background: #000;
	display: block;
	border-radius: var(--rmg-radius);
}

.rmg-expand-text {
	width: min(680px, 92%);
	max-height: 100%;
	overflow-y: auto;
	padding: clamp(20px, 4vw, 56px);
	background: #FFFFFF;
	border: 2px solid var(--rmg-accent-1);
	border-radius: var(--rmg-radius);
	scrollbar-width: thin;
}

/* -------------------------------------------------------------------------
   Prev / Next arrows
   ------------------------------------------------------------------------- */
.rmg-expand-prev,
.rmg-expand-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 56px;
	height: 56px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--rmg-text-primary);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0.55;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.rmg-expand-prev { left: 2rem; }
.rmg-expand-next { right: 2rem; }

.rmg-expand-prev:hover,
.rmg-expand-next:hover {
	opacity: 1;
}

.rmg-expand-prev:hover { transform: translateY(-50%) translateX(-4px); }
.rmg-expand-next:hover { transform: translateY(-50%) translateX(4px); }

.rmg-expand-close {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--rmg-text-primary);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	opacity: 0.55;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.rmg-expand-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

/* -------------------------------------------------------------------------
   Text expand body — typography
   ------------------------------------------------------------------------- */
.rmg-text-expanded-body {
	font-family: "DuruSans", sans-serif;
	color: var(--rmg-accent-1);
}

.rmg-text-paragraph {
	font-family: "DuruSans", sans-serif;
	font-size: clamp(0.95rem, 1.2vw, 1.1rem);
	line-height: 1.65;
	margin-bottom: 1.75rem;
	color: var(--rmg-accent-1);
}

.rmg-text-paragraph:last-child {
	margin-bottom: 0;
}

.rmg-text-greeting {
	font-family: "DuruSans", sans-serif;
	font-size: clamp(1.1rem, 1.4vw, 1.35rem);
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 1.25rem;
	color: var(--rmg-accent-1);
}

.rmg-text-rule {
	width: 60px;
	height: 2px;
	background: var(--rmg-accent-1);
	margin: 0 0 1rem 0;
	border: none;
}

.rmg-text-attribution {
	font-family: "PPNeueMontreal", sans-serif;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--rmg-accent-2);
	line-height: 1.5;
}

.rmg-text-attribution-author {
	font-weight: 600;
	display: block;
	color: var(--rmg-accent-1);
	margin-bottom: 0.25rem;
}

.rmg-text-attribution-date {
	font-weight: 400;
	display: block;
	color: var(--rmg-accent-2);
}

/* Artist list block (kind=list) */
.rmg-text-list-title {
	font-family: "DuruSans", sans-serif;
	font-size: clamp(1.4rem, 2vw, 1.85rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.15;
	margin-bottom: 0.4rem;
	color: var(--rmg-accent-1);
}

.rmg-text-list-meta {
	font-family: "TheGoodMonolith", monospace;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--rmg-accent-2);
	margin-bottom: 1.75rem;
	display: block;
}

.rmg-text-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: rg-artist;
}

.rmg-text-list li {
	font-family: "DuruSans", sans-serif;
	font-size: clamp(0.85rem, 1vw, 0.95rem);
	font-weight: 400;
	color: var(--rmg-accent-1);
	padding: 0.55rem 0;
	border-bottom: 1px solid rgba(175, 39, 105, 0.18);
	display: flex;
	align-items: baseline;
	gap: 0.65rem;
	transition: padding-left 0.25s ease, color 0.25s ease;
	counter-increment: rg-artist;
}

.rmg-text-list li::before {
	content: counter(rg-artist, decimal-leading-zero);
	font-family: "TheGoodMonolith", monospace;
	font-size: 0.65rem;
	font-weight: 400;
	letter-spacing: 0.05em;
	color: var(--rmg-accent-2);
	opacity: 0.7;
	min-width: 2.2em;
}

.rmg-text-list li:hover {
	padding-left: 0.5rem;
	color: var(--rmg-accent-2);
}

/* -------------------------------------------------------------------------
   Trigger button (trigger_mode=button)
   ------------------------------------------------------------------------- */
.rmg-trigger-button {
	display: inline-block;
	padding: 12px 24px;
	background: var(--rmg-accent-1);
	color: #fff;
	border: 1px solid var(--rmg-accent-1);
	border-radius: 4px;
	font-family: "TheGoodMonolith", monospace;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.rmg-trigger-button:hover {
	background: transparent;
	color: var(--rmg-accent-1);
}

/* -------------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------------- */
@media (max-width: 720px) {
	.rmg-lightbox {
		padding: 3vh 4vw;
	}

	.rmg-lightbox-close {
		top: 0.75rem;
		right: 0.75rem;
		width: 40px;
		height: 40px;
	}

	.rmg-lightbox-close svg {
		width: 24px;
		height: 24px;
	}

	.rmg-expand-stage {
		width: 96vw;
		height: 90vh;
	}

	.rmg-expand-prev,
	.rmg-expand-next {
		width: 44px;
		height: 44px;
		opacity: 0.85;
	}

	.rmg-expand-prev { left: 0.25rem; }
	.rmg-expand-next { right: 0.25rem; }

	.rmg-expand-close {
		top: 0.75rem;
		right: 0.75rem;
		width: 36px;
		height: 36px;
	}

	.rmg-text-list {
		grid-template-columns: 1fr;
		gap: 0;
	}
}
