/*
 * Rachel Mizrahi — עמוד הגלריה (page-gallery.php).
 *
 * רצועת כותרת בהירה + גריד "מסונרי" (CSS columns, מתאים לתערובת של תמונות
 * לאורך ולרוחב) + לייטבוקס. נשען על הטוקנים של brand.css. RTL-safe, מובייל-first.
 */

/* Astra פורש את .ast-container כ-flex; ה-<main> החשוף היה מתכווץ לצד. */
#main.rm-gallery-page {
	width: 100%;
	max-width: 100%;
	flex: 1 1 100%;
}

/* ==========================================================================
   רצועת הכותרת
   ========================================================================== */
.rm-gallery-hero {
	position: relative;
	overflow: hidden;
	background: var(--rm-cream, #EFEAE5);
	text-align: center;
	padding: 72px 24px 44px;
	width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.rm-gallery-hero__motif {
	position: absolute;
	inset-inline-start: -120px;
	top: -100px;
	width: 380px;
	opacity: 0.08;
	pointer-events: none;
}

.rm-gallery-hero__latin {
	display: block;
	margin-bottom: 12px;
	font-family: var(--rm-font-latin-serif, 'Cormorant Garamond', Georgia, serif);
	font-style: italic;
	font-size: 1rem;
	letter-spacing: 0.24em;
	color: var(--rm-taupe, #725C4E);
}

.rm-gallery-hero h1 {
	margin: 0 0 12px;
	font-family: var(--rm-font-display, 'Frank Ruhl Libre', Georgia, serif) !important;
	font-size: clamp(1.7rem, 4vw, 2.6rem);
	font-weight: 400;
	color: var(--rm-espresso, #422B1C);
}

.rm-gallery-hero p {
	max-width: 560px;
	margin: 0 auto;
	color: var(--rm-body, #4A4038);
	font-weight: 300;
	line-height: 1.8;
}

/* ==========================================================================
   הגריד
   ========================================================================== */
.rm-gallery-wrap {
	background: var(--rm-paper, #F7F3EF);
	padding: clamp(28px, 4vw, 56px) clamp(16px, 4vw, 40px) clamp(48px, 6vw, 88px);
	width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.rm-gallery-grid {
	max-width: 1200px;
	margin-inline: auto;
	padding: 0;
	list-style: none;
	column-count: 1;
	column-gap: clamp(12px, 2vw, 20px);
}

@media (min-width: 600px) {
	.rm-gallery-grid { column-count: 2; }
}

@media (min-width: 960px) {
	.rm-gallery-grid { column-count: 3; }
}

.rm-gallery-item {
	break-inside: avoid;
	margin: 0 0 clamp(12px, 2vw, 20px);
}

.rm-gallery-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--rm-cream-warm, #E7DFDD);
	border-radius: var(--rm-radius, 2px);
	overflow: hidden;
	cursor: zoom-in;
	line-height: 0;
	box-shadow: var(--rm-shadow-soft, 0 18px 40px -24px rgba(66, 43, 28, 0.35));
}

.rm-gallery-btn img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.7s var(--rm-ease, ease), opacity 0.3s ease;
}

.rm-gallery-btn:hover img,
.rm-gallery-btn:focus-visible img {
	transform: scale(1.04);
}

.rm-gallery-btn:focus-visible {
	outline: 2px solid var(--rm-taupe, #725C4E);
	outline-offset: 3px;
}

/* ==========================================================================
   לייטבוקס
   ========================================================================== */
.rm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(42, 27, 16, 0.88);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.rm-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s;
}

.rm-lightbox__img {
	max-width: 100%;
	max-height: 86vh;
	width: auto;
	height: auto;
	border-radius: var(--rm-radius, 2px);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}

body.rm-lightbox-open {
	overflow: hidden;
}

.rm-lightbox__close,
.rm-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.25s ease, transform 0.25s ease;
}

.rm-lightbox__close {
	inset-block-start: clamp(12px, 3vw, 28px);
	inset-inline-end: clamp(12px, 3vw, 28px);
	width: 44px;
	height: 44px;
	font-size: 1.7rem;
}

.rm-lightbox__nav {
	inset-block-start: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 2rem;
}

.rm-lightbox__nav--prev { inset-inline-end: clamp(8px, 2vw, 24px); }
.rm-lightbox__nav--next { inset-inline-start: clamp(8px, 2vw, 24px); }

.rm-lightbox__close:hover,
.rm-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.2);
}

.rm-lightbox__nav:hover {
	transform: translateY(-50%) scale(1.06);
}

@media (max-width: 600px) {
	.rm-lightbox__nav { width: 40px; height: 40px; font-size: 1.6rem; }
	.rm-lightbox__img { max-height: 78vh; }
}

@media (prefers-reduced-motion: reduce) {
	.rm-gallery-btn img,
	.rm-lightbox,
	.rm-lightbox__nav { transition: none; }
	.rm-gallery-btn:hover img { transform: none; }
}
