/* ============================================================
   Rist Gallery – Frontend (Shortcode)
   Professional layout: large featured + title + masonry gallery
   ============================================================ */

.rist-gallery-archive {
	display: flex;
	flex-direction: column;
	gap: 3.5rem;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
}

.rist-gallery-item-block {
	width: 100%;
}

/* ---------- Hero: Featured image + Title ---------- */
.rist-gallery-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: center;
	margin-bottom: 1.75rem;
}

.rist-gallery-hero-image {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
	background: #f0f0f1;
}

.rist-gallery-hero-image a {
	display: block;
	position: relative;
	line-height: 0;
}

.rist-hero-img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.rist-gallery-hero-image a:hover .rist-hero-img {
	transform: scale(1.03);
}

.rist-gallery-hero-content {
	padding: 0.5rem 0;
}

.rist-gallery-title {
	margin: 0;
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 700;
	line-height: 1.2;
	color: #1a56db; /* matches the blue in the reference image */
	letter-spacing: -0.02em;
}

.rist-gallery-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rist-gallery-title a:hover,
.rist-gallery-title a:focus {
	color: #0f3a9e;
	outline: none;
}

/* Date tag below title */
.rist-gallery-date {
	display: inline-block;
	margin-top: 0.75rem;
	padding: 0.35rem 0.9rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.4;
	color: #1a56db;
	background: rgba(26, 86, 219, 0.08);
	border: 1px solid rgba(26, 86, 219, 0.18);
	border-radius: 999px;
	white-space: nowrap;
}

/* ---------- Masonry gallery ---------- */
.rist-gallery-masonry {
	display: grid;
	grid-template-columns: repeat(var(--rist-cols, 4), 1fr);
	gap: 12px;
	width: 100%;
}

.rist-masonry-item {
	margin: 0;
	position: relative;
	border-radius: 6px;
	overflow: hidden;
	background: #f0f0f1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	aspect-ratio: 4 / 3;
}

.rist-masonry-item a {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	line-height: 0;
}

.rist-masonry-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.rist-masonry-item a:hover .rist-masonry-img,
.rist-masonry-item a:focus .rist-masonry-img {
	transform: scale(1.06);
	filter: brightness(0.92);
}

/* Zoom icon overlay */
.rist-gallery-zoom {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.rist-gallery-zoom::after {
	content: '';
	width: 36px;
	height: 36px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.rist-gallery-hero-image a:hover .rist-gallery-zoom,
.rist-masonry-item a:hover .rist-gallery-zoom,
.rist-gallery-hero-image a:focus .rist-gallery-zoom,
.rist-masonry-item a:focus .rist-gallery-zoom {
	opacity: 1;
}

/* ---------- Lightbox ---------- */
.rist-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(10, 12, 18, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	padding: 20px;
	box-sizing: border-box;
}

.rist-lightbox-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.rist-lightbox-content {
	position: relative;
	max-width: 95vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.rist-lightbox-content img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	user-select: none;
}

.rist-lightbox-caption {
	margin-top: 12px;
	color: #e0e0e0;
	font-size: 0.95rem;
	text-align: center;
	max-width: 600px;
}

.rist-lightbox-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s;
	padding: 0;
}

.rist-lightbox-close:hover,
.rist-lightbox-close:focus {
	opacity: 1;
	outline: none;
}

.rist-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	padding: 0;
}

.rist-lightbox-nav:hover,
.rist-lightbox-nav:focus {
	background: rgba(255, 255, 255, 0.3);
	outline: none;
}

.rist-lightbox-prev {
	left: -60px;
}

.rist-lightbox-next {
	right: -60px;
}

.rist-lightbox-counter {
	position: absolute;
	bottom: -36px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.rist-gallery-hero {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.rist-gallery-title {
		text-align: left;
	}

	.rist-gallery-masonry {
		grid-template-columns: repeat(3, 1fr);
	}

	.rist-lightbox-prev {
		left: 8px;
	}

	.rist-lightbox-next {
		right: 8px;
	}
}

@media (max-width: 600px) {
	.rist-gallery-archive {
		gap: 2.5rem;
	}

	.rist-gallery-masonry {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.rist-lightbox-close {
		top: 8px;
		right: 8px;
	}
}

/* Empty state */
.rist-gallery-empty {
	text-align: center;
	padding: 2rem;
	color: #666;
}


/* ---------- Divider between gallery posts ---------- */
.rist-gallery-divider {
	border: 0;
	height: 2px;
	margin: 2.5rem 0;
	background: #e2e4e7;
	width: 100%;
}

/* ---------- Pagination ---------- */
.rist-gallery-pagination {
	margin-top: 2.5rem;
	text-align: center;
}

.rist-gallery-pagination .page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rist-gallery-pagination .page-numbers li {
	margin: 0;
	padding: 0;
}

.rist-gallery-pagination .page-numbers a,
.rist-gallery-pagination .page-numbers span {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background: #fff;
	color: #1a56db;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rist-gallery-pagination .page-numbers a:hover,
.rist-gallery-pagination .page-numbers a:focus {
	background: #1a56db;
	border-color: #1a56db;
	color: #fff;
	outline: none;
}

.rist-gallery-pagination .page-numbers .current {
	background: #1a56db;
	border-color: #1a56db;
	color: #fff;
	cursor: default;
}

.rist-gallery-pagination .page-numbers .dots {
	border: none;
	background: transparent;
	color: #666;
}
