/**
 * Gallery library page — /thu-vien/
 */

.mph-gallery-hero {
	position: relative;
	isolation: isolate;
	min-height: 480px;
	display: flex;
	align-items: flex-end;
	color: #fff;
	overflow: hidden;
	background: var(--mph-color-primary-dark, #03281f);
}

.mph-gallery-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.mph-gallery-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mph-gallery-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(3, 40, 31, 0.5) 0%,
		rgba(3, 40, 31, 0.78) 55%,
		rgba(3, 40, 31, 0.9) 100%
	);
}

.mph-gallery-hero__content {
	position: relative;
	z-index: 1;
	width: min(var(--mph-container-max, 1320px), calc(100% - 64px));
	padding: calc(var(--mph-header-height, 92px) + 64px) 0 56px;
}

.mph-gallery-hero__breadcrumbs {
	margin-bottom: 1.1rem;
}

.mph-gallery-hero .mph-breadcrumbs,
.mph-gallery-hero .mph-breadcrumbs a,
.mph-gallery-hero .mph-breadcrumbs__item,
.mph-gallery-hero .rank-math-breadcrumb,
.mph-gallery-hero .rank-math-breadcrumb a,
.mph-gallery-hero .mph-breadcrumbs--yoast,
.mph-gallery-hero .mph-breadcrumbs--yoast a {
	color: var(--mph-color-accent, #f2bd3e) !important;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.mph-gallery-hero .mph-breadcrumbs__item[aria-current="page"],
.mph-gallery-hero .rank-math-breadcrumb .last {
	color: #fff !important;
}

.mph-gallery-hero__title {
	margin: 0 0 0.85rem;
	font-family: var(--mph-font-heading, "Playfair Display", Georgia, serif);
	font-size: clamp(2.1rem, 4vw, 3.25rem);
	font-weight: 600;
	line-height: 1.2;
}

.mph-gallery-hero__title-plain {
	display: block;
	color: #fff;
}

.mph-gallery-hero__title-accent {
	display: block;
	color: var(--mph-color-accent, #f2bd3e);
}

.mph-gallery-hero__subtitle {
	margin: 0;
	max-width: 34rem;
	font-size: 1.05rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.88);
}

.mph-gallery-page {
	background: var(--mph-color-background, #f7f3eb);
	padding-top: 72px;
	padding-bottom: 88px;
}

.mph-gallery-page__header {
	max-width: 40rem;
	margin-bottom: 2.5rem;
}

.mph-gallery-page__lead {
	margin: 0.75rem 0 0;
	color: var(--mph-color-muted, #6f756f);
	line-height: 1.75;
	font-size: 0.9875rem;
}

.mph-gallery-page__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 16px;
}

.mph-gallery-page__item {
	position: relative;
	isolation: isolate;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--mph-radius, 12px);
	overflow: hidden;
	cursor: pointer;
	background: var(--mph-color-primary, #073b2d);
	box-shadow: var(--mph-shadow-sm, 0 4px 20px rgba(3, 40, 31, 0.08));
	grid-column: span 4;
	min-height: 240px;
	text-align: left;
}

.mph-gallery-page__item--0,
.mph-gallery-page__item--3 {
	grid-column: span 6;
	min-height: 320px;
}

.mph-gallery-page__item--1,
.mph-gallery-page__item--2,
.mph-gallery-page__item--4,
.mph-gallery-page__item--5 {
	grid-column: span 3;
}

.mph-gallery-page__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.55s ease;
}

.mph-gallery-page__item:hover img,
.mph-gallery-page__item:focus-visible img {
	transform: scale(1.05);
}

.mph-gallery-page__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	padding: 2.5rem 1rem 0.9rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #fff;
	background: linear-gradient(180deg, transparent, rgba(3, 40, 31, 0.82));
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.mph-gallery-page__item:hover .mph-gallery-page__caption,
.mph-gallery-page__item:focus-visible .mph-gallery-page__caption {
	opacity: 1;
	transform: translateY(0);
}

.mph-gallery-page__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 2.5rem;
}

@media (max-width: 1024px) {
	.mph-gallery-page__item,
	.mph-gallery-page__item--0,
	.mph-gallery-page__item--1,
	.mph-gallery-page__item--2,
	.mph-gallery-page__item--3,
	.mph-gallery-page__item--4,
	.mph-gallery-page__item--5 {
		grid-column: span 6;
		min-height: 260px;
	}
}

@media (max-width: 640px) {
	.mph-gallery-hero {
		min-height: 400px;
	}

	.mph-gallery-hero__content {
		width: min(var(--mph-container-max, 1320px), calc(100% - 32px));
		padding-bottom: 44px;
	}

	.mph-gallery-page {
		padding-top: 48px;
		padding-bottom: 64px;
	}

	.mph-gallery-page__item,
	.mph-gallery-page__item--0,
	.mph-gallery-page__item--1,
	.mph-gallery-page__item--2,
	.mph-gallery-page__item--3,
	.mph-gallery-page__item--4,
	.mph-gallery-page__item--5 {
		grid-column: span 12;
		min-height: 220px;
	}

	.mph-gallery-page__caption {
		opacity: 1;
		transform: none;
	}

	.mph-gallery-page__actions {
		flex-direction: column;
	}

	.mph-gallery-page__actions .mph-btn {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}
