/* PU Gallery — frontend v1.1 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

.pu-gallery {
	--pu-gap: 1.35rem;
	--pu-radius: 10px;
	--pu-text: #141414;
	--pu-muted: #5a5a5a;
	--pu-line: rgba(20, 20, 20, 0.1);
	--pu-soft: #f3f1ec;
	--pu-accent: #0d7377;
	--pu-ink: #0b1f1f;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	color: var(--pu-text);
	font-family: "DM Sans", system-ui, sans-serif;
}

.pu-gallery *,
.pu-gallery *::before,
.pu-gallery *::after {
	box-sizing: border-box;
}

/* —— Section headers (Images / Videos alag) —— */
.pu-gallery__section {
	width: 100%;
}

.pu-gallery__section + .pu-gallery__section {
	margin-top: 3.5rem;
	padding-top: 3.25rem;
	border-top: 1px solid var(--pu-line);
	position: relative;
}

.pu-gallery__section + .pu-gallery__section::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 50%;
	transform: translateX(-50%);
	width: 72px;
	height: 3px;
	background: var(--pu-accent);
	border-radius: 2px;
}

.pu-gallery__header {
	margin-bottom: 1.75rem;
	text-align: center;
}

.pu-gallery__eyebrow {
	display: inline-block;
	margin-bottom: 0.4rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--pu-accent);
}

.pu-gallery__heading {
	margin: 0;
	font-family: Fraunces, Georgia, serif;
	font-size: clamp(1.75rem, 3vw, 2.35rem);
	font-weight: 600;
	line-height: 1.15;
	color: var(--pu-ink);
	letter-spacing: -0.02em;
}

/* —— Grids —— */
.pu-gallery__grid {
	display: grid;
	gap: var(--pu-gap);
	width: 100%;
}

/* Images: 4 per row */
.pu-gallery__grid--images {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Videos: 2 per row (alag section, wider players) */
.pu-gallery__grid--videos {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.75rem;
}

.pu-gallery__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border-radius: calc(var(--pu-radius) + 2px);
	overflow: hidden;
	border: 1px solid black;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pu-gallery__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 36px rgba(11, 31, 31, 0.1);
}

.pu-gallery__media-btn {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
	text-align: left;
	border-radius: 0;
}

.pu-gallery__media {
	display: block;
	position: relative;
	overflow: hidden;
	background: var(--pu-soft);
	aspect-ratio: 4 / 3;
}

.pu-gallery__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.pu-gallery__zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 31, 31, 0.35);
	color: #fff;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.pu-gallery__zoom svg {
	width: 44px;
	height: 44px;
	padding: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	backdrop-filter: blur(4px);
	transform: scale(0.85);
	transition: transform 0.3s ease;
}

.pu-gallery__media-btn:hover .pu-gallery__media img,
.pu-gallery__media-btn:focus-visible .pu-gallery__media img {
	transform: scale(1.06);
}

.pu-gallery__media-btn:hover .pu-gallery__zoom,
.pu-gallery__media-btn:focus-visible .pu-gallery__zoom {
	opacity: 1;
}

.pu-gallery__media-btn:hover .pu-gallery__zoom svg,
.pu-gallery__media-btn:focus-visible .pu-gallery__zoom svg {
	transform: scale(1);
}

.pu-gallery__media--video {
	aspect-ratio: 16 / 9;
	background: #0b0b0b;
}

.pu-gallery__media--video img,
.pu-gallery__media--video video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	background: #0b0b0b;
	pointer-events: none;
}

.pu-gallery__media-btn--video {
	cursor: pointer;
}

.pu-gallery__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 31, 31, 0.28);
	color: #fff;
	transition: background 0.3s ease;
}

.pu-gallery__play svg {
	width: 64px;
	height: 64px;
	padding: 18px 16px 18px 20px;
	border-radius: 50%;
	background: rgba(13, 115, 119, 0.92);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	transition: transform 0.3s ease, background 0.3s ease;
}

.pu-gallery__media-btn--video:hover .pu-gallery__play,
.pu-gallery__media-btn--video:focus-visible .pu-gallery__play {
	background: rgba(11, 31, 31, 0.4);
}

.pu-gallery__media-btn--video:hover .pu-gallery__play svg,
.pu-gallery__media-btn--video:focus-visible .pu-gallery__play svg {
	transform: scale(1.08);
	background: rgba(13, 115, 119, 1);
}

.pu-gallery__meta {
	padding: 1rem 1.1rem 1.2rem;
	background: #fff;
}

.pu-gallery__title {
	margin: 0 0 0.35rem;
	font-family: Fraunces, Georgia, serif;
	font-size: 1.08rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--pu-ink);
}

.pu-gallery__desc {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--pu-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Videos section soft band feel */
.pu-gallery__videos .pu-gallery__card {
	background: var(--pu-soft);
/* 	border-color: transparent; */
}

.pu-gallery__videos .pu-gallery__meta {
	background: var(--pu-soft);
}

/* —— Lightbox —— */
.pu-lightbox[hidden] {
	display: none !important;
}

.pu-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.pu-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 16, 16, 0.88);
	cursor: pointer;
	animation: pu-fade 0.2s ease;
}

.pu-lightbox__dialog {
	position: relative;
	z-index: 1;
	max-width: min(960px, 100%);
	max-height: 92vh;
	width: min(960px, 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	animation: pu-rise 0.28s ease;
}

.pu-lightbox__img,
.pu-lightbox__video {
	max-width: 100%;
	max-height: calc(92vh - 5rem);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--pu-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	background: #000;
}

.pu-lightbox__video {
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: calc(92vh - 5rem);
}

.pu-lightbox__img[hidden],
.pu-lightbox__video[hidden] {
	display: none !important;
}

.pu-lightbox__caption {
	width: 100%;
	max-width: 640px;
	margin-top: 1rem;
	text-align: center;
	color: #f5f5f5;
}

.pu-lightbox__title {
	display: block;
	font-family: Fraunces, Georgia, serif;
	font-size: 1.2rem;
	margin-bottom: 0.3rem;
}

.pu-lightbox__desc {
	margin: 0;
	font-size: 0.95rem;
	opacity: 0.85;
}

.pu-lightbox__close {
	position: absolute;
	top: -0.65rem;
	right: -0.65rem;
	width: 2.6rem;
	height: 2.6rem;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font-size: 1.65rem;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
	transition: background 0.2s ease, transform 0.2s ease;
}

.pu-lightbox__close:hover {
	background: #f0f0f0;
	transform: scale(1.05);
}

@keyframes pu-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pu-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* —— Responsive —— */
@media (max-width: 1100px) {
	.pu-gallery__grid--images {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.pu-gallery__grid--images {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pu-gallery__grid--videos {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.pu-gallery {
		--pu-gap: 1rem;
	}

	.pu-gallery__grid--images {
		grid-template-columns: 1fr;
	}

	.pu-gallery__section + .pu-gallery__section {
		margin-top: 2.5rem;
		padding-top: 2.25rem;
	}

	.pu-gallery__meta {
		padding: 0.85rem 0.95rem 1rem;
	}
}
