/* Joy in the City — Gallery page */

:root {
	--jitc-max-width: 1200px;
}

.jitc-gallery {
	width: 100%;
}

/* Hero */

.jitc-gallery-hero {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	height: 440px;
	min-height: 440px;
	overflow: hidden;
}

.jitc-gallery-hero__background {
	position: absolute;
	inset: 0;
	background-color: #1a1a1a;
	background-position: center 45%;
	background-repeat: no-repeat;
	background-size: cover;
}

.jitc-gallery-hero__background::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.jitc-gallery-hero__overlay {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 440px;
	padding: 24px 24px;
}

.jitc-gallery-hero__title {
	margin: 0;
	color: var(--jitc-white);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(2.5rem, 4.5vw, 3.25rem);
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
}

@media (max-width: 768px) {
	.jitc-gallery-hero {
		width: 100%;
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
		height: auto;
		min-height: 280px;
	}

	.jitc-gallery-hero__overlay {
		min-height: 280px;
		padding: 48px 24px;
	}

	.jitc-gallery-hero__title {
		font-size: clamp(2rem, 8vw, 2.75rem);
	}
}

.jitc-container {
	width: 100%;
	max-width: var(--jitc-max-width);
	margin: 0 auto;
	padding: 0 48px;
}

/* Intro */

.jitc-gallery-intro {
	padding: 64px 0 80px;
	background-color: var(--jitc-page-bg);
}

.jitc-gallery-intro__text {
	max-width: 900px;
	margin: 0 auto 40px;
	color: var(--jitc-text);
	font-family: var(--jitc-sans);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.7;
	text-align: center;
}

.jitc-gallery-artists {
	max-width: 900px;
	margin: 0 auto;
}

.jitc-gallery-artists__toggle {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	color: var(--jitc-text);
	font-family: var(--jitc-sans);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.7;
	text-align: center;
	list-style: none;
	cursor: pointer;
}

.jitc-gallery-artists__toggle::-webkit-details-marker {
	display: none;
}

.jitc-gallery-artists__arrow {
	flex-shrink: 0;
	display: inline-block;
	margin-top: 2px;
	font-size: 0.75rem;
	line-height: 1;
	transition: transform 0.2s ease;
}

.jitc-gallery-artists[open] .jitc-gallery-artists__arrow {
	transform: rotate(180deg);
}

.jitc-gallery-artists__toggle-text {
	text-align: center;
}

.jitc-gallery-artists__panel {
	padding-top: 24px;
}

.jitc-gallery-artists__header,
.jitc-gallery-artists__row {
	margin: 0 0 4px;
	color: var(--jitc-text);
	font-family: var(--jitc-sans);
	font-size: 0.9375rem;
	font-weight: 400;
	line-height: 1.6;
	text-align: center;
}

.jitc-gallery-artists__header {
	margin-bottom: 8px;
	font-weight: 600;
}

@media (max-width: 768px) {
	.jitc-container {
		padding: 0 24px;
	}

	.jitc-gallery-intro {
		padding: 48px 0 64px;
	}

	.jitc-gallery-intro__text,
	.jitc-gallery-artists__toggle {
		font-size: 0.9375rem;
	}

	.jitc-gallery-artists__header,
	.jitc-gallery-artists__row {
		font-size: 0.875rem;
	}
}

/* Year galleries (FooGallery) */

.jitc-gallery-years {
	padding: 0 0 96px;
	background-color: var(--jitc-page-bg);
}

.jitc-gallery-year {
	margin-bottom: 80px;
}

.jitc-gallery-year:last-child {
	margin-bottom: 0;
}

.jitc-gallery-year__heading {
	margin: 0 0 32px;
	color: var(--jitc-text);
	font-family: var(--jitc-sans);
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.jitc-gallery-year__heading::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin: 16px auto 0;
	background-color: var(--jitc-text);
	border-radius: 999px;
	opacity: 0.25;
}

.jitc-gallery-year__foogallery {
	margin: 0;
}

.jitc-gallery-year__foogallery .foogallery {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	width: 100%;
	margin: 0;
}

.jitc-gallery-year__foogallery .fg-item {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.jitc-gallery-year__foogallery .fg-item:first-child {
	grid-column: 1 / -1;
}

.jitc-gallery-year__foogallery .fg-item-inner {
	margin: 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	height: 100%;
}

.jitc-gallery-year__foogallery .fg-item:first-child .fg-item-inner {
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.jitc-gallery-year__foogallery .fg-thumb {
	display: block;
	position: relative;
	overflow: hidden;
	line-height: 0;
	width: 100%;
}

.jitc-gallery-year__foogallery .fg-item:first-child .fg-thumb {
	aspect-ratio: 21 / 9;
	max-height: 520px;
}

.jitc-gallery-year__foogallery .fg-item:not(:first-child) .fg-thumb {
	aspect-ratio: 4 / 3;
}

/* Fill nested FooGallery wrappers so images don't leave empty gaps */
.jitc-gallery-year__foogallery .fg-thumb > a,
.jitc-gallery-year__foogallery .fg-thumb .fg-image-wrap,
.jitc-gallery-year__foogallery .fg-thumb .fg-image-container {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.jitc-gallery-year__foogallery .fg-image,
.jitc-gallery-year__foogallery .fg-item img {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: center center;
	transition: transform 0.25s ease;
}

.jitc-gallery-year__foogallery .fg-item:hover .fg-image,
.jitc-gallery-year__foogallery .fg-item:hover img {
	transform: scale(1.03);
}

.jitc-gallery-year__foogallery .fg-caption {
	display: none;
}

@media (max-width: 768px) {
	.jitc-gallery-years {
		padding-bottom: 72px;
	}

	.jitc-gallery-year {
		margin-bottom: 56px;
	}

	.jitc-gallery-year__foogallery .foogallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}
}

@media (max-width: 480px) {
	.jitc-gallery-year__foogallery .foogallery {
		grid-template-columns: 1fr;
	}

	.jitc-gallery-year__foogallery .fg-item:first-child .fg-thumb {
		aspect-ratio: 16 / 10;
		max-height: none;
	}
}
