/*
 * Single event detail page (single-event.php): featured-image hero,
 * eyebrow/title header, prose content, optional gallery grid, closing
 * CTA row. Visual language borrowed from .pf-event-feature and
 * .pf-archive-card (upcoming-event.css / laporan-kegiatan.css) rather
 * than invented fresh. Top clearance matches .pf-page-header's 150px
 * convention (pages.css) since there's no header element here to
 * supply it.
 */

.pf-single-event__hero-wrap {
	padding: 150px 0 0;
}

.pf-single-event__hero {
	position: relative;
	display: grid;
	place-items: center;
	max-height: 900px;
	border-radius: 30px;
	overflow: hidden;
	background: linear-gradient(135deg, #f2f5f2, #e8f1eb);
	box-shadow: 0 1px 2px rgba(30, 30, 30, .04), 0 40px 90px -50px rgba(30, 30, 30, .45);
}

.pf-single-event__hero img.pf-image-slot {
	position: static;
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 900px;
	object-fit: contain;
}

.pf-single-event__hero .pf-image-slot--empty {
	position: static;
	width: 100%;
	height: auto;
	min-height: clamp(260px, 45vw, 520px);
}

.pf-single-event__badge {
	position: absolute;
	top: 20px;
	left: 20px;
	padding: 8px 15px;
	border-radius: 999px;
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .04em;
	box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
}

.pf-single-event__header {
	margin-top: 40px;
}

.pf-single-event__title {
	font-family: var(--pf-font-display);
	font-weight: 800;
	font-size: clamp(2rem, 4.4vw, 3.2rem);
	line-height: 1.08;
	letter-spacing: -.025em;
	color: var(--pf-ink);
}

.pf-single-event__content {
	margin-top: 28px;
	max-width: 720px;
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--pf-muted);
	font-weight: 450;
}

.pf-single-event__content p {
	margin-bottom: 22px;
}

.pf-single-event__content p:last-child {
	margin-bottom: 0;
}

.pf-single-event__gallery {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-top: 40px;
}

.pf-single-event__gallery-item {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	aspect-ratio: 1 / 1;
	border: 0;
	border-radius: 16px;
	overflow: hidden;
	background: #0a2a1a;
	color: inherit;
	font: inherit;
	cursor: zoom-in;
	-webkit-appearance: none;
	appearance: none;
}

.pf-single-event__gallery-item img,
.pf-single-event__gallery-item .pf-image-slot {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 240ms ease, filter 240ms ease;
}

.pf-single-event__gallery-item:focus-visible {
	outline: 3px solid var(--pf-green, #009b4d);
	outline-offset: 4px;
}

.pf-single-event__gallery-item.is-broken::after {
	content: "Image unavailable";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	background: #eef3ef;
	color: var(--pf-muted);
	font-size: .82rem;
	font-weight: 700;
	text-align: center;
}

@media (hover: hover) and (pointer: fine) {
	.pf-single-event__gallery-item:hover img,
	.pf-single-event__gallery-item:hover .pf-image-slot {
		transform: scale(1.035);
		filter: brightness(1.06);
	}
}

/* Event-gallery lightbox. The JS only creates this inside single event pages. */
.pf-event-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	background: rgba(5, 9, 7, .88);
	opacity: 0;
	visibility: hidden;
	transition: opacity 220ms ease, visibility 220ms ease;
	overscroll-behavior: contain;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.pf-event-lightbox[hidden] {
	display: none;
}

.pf-event-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.pf-event-lightbox__viewport,
.pf-event-lightbox__stage {
	position: absolute;
	inset: 0;
}

.pf-event-lightbox__stage {
	display: grid;
	place-items: center;
	padding: 32px 88px;
	touch-action: pan-y;
}

.pf-event-lightbox__media {
	position: relative;
	display: grid;
	place-items: center;
	max-width: min(1600px, calc(100vw - 176px));
	max-height: calc(100svh - 64px);
	border-radius: 8px;
	transform: scale(.965);
	opacity: .7;
	transition: transform 240ms cubic-bezier(.2, .75, .25, 1), opacity 220ms ease;
	filter: drop-shadow(0 28px 70px rgba(0, 0, 0, .38));
}

.pf-event-lightbox.is-open .pf-event-lightbox__media {
	transform: scale(1);
	opacity: 1;
}

.pf-event-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: min(1600px, calc(100vw - 176px));
	max-height: calc(100svh - 64px);
	border-radius: 8px;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.pf-event-lightbox__media[aria-busy="true"]::before {
	content: "";
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, .28);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pf-event-lightbox-spin .7s linear infinite;
}

.pf-event-lightbox__error {
	min-width: min(320px, calc(100vw - 48px));
	margin: 0;
	padding: 24px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 12px;
	background: rgba(255, 255, 255, .09);
	color: rgba(255, 255, 255, .88);
	font-size: .92rem;
	font-weight: 650;
	text-align: center;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
}

.pf-event-lightbox__toolbar {
	position: absolute;
	top: max(16px, env(safe-area-inset-top));
	right: max(16px, env(safe-area-inset-right));
	left: max(16px, env(safe-area-inset-left));
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	pointer-events: none;
}

.pf-event-lightbox__counter {
	padding: 7px 11px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .28);
	color: rgba(255, 255, 255, .76);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: .06em;
	pointer-events: auto;
}

.pf-event-lightbox__button {
	z-index: 2;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 50%;
	background: rgba(8, 14, 11, .54);
	color: #fff;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.pf-event-lightbox__button:hover {
	background: rgba(255, 255, 255, .17);
	border-color: rgba(255, 255, 255, .4);
	transform: scale(1.04);
}

.pf-event-lightbox__button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.pf-event-lightbox__close {
	width: 48px;
	height: 48px;
}

.pf-event-lightbox__previous,
.pf-event-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.pf-event-lightbox__previous:hover,
.pf-event-lightbox__next:hover {
	transform: translateY(-50%) scale(1.04);
}

.pf-event-lightbox__previous {
	left: max(16px, env(safe-area-inset-left));
}

.pf-event-lightbox__next {
	right: max(16px, env(safe-area-inset-right));
}

@keyframes pf-event-lightbox-spin {
	to { transform: rotate(360deg); }
}

.pf-single-event__actions {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 40px;
}

@media (max-width: 880px) {
	.pf-single-event__hero {
		border-radius: 22px;
	}

	.pf-single-event__hero img.pf-image-slot {
		max-height: 78svh;
	}
}

@media (max-width: 640px) {
	.pf-single-event__gallery {
		grid-template-columns: repeat(2, 1fr);
	}

	.pf-single-event__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.pf-single-event__actions .pf-btn {
		justify-content: center;
	}

	.pf-event-lightbox__stage {
		padding: 72px 12px 28px;
	}

	.pf-event-lightbox__media,
	.pf-event-lightbox__image {
		max-width: calc(100vw - 24px);
		max-height: calc(100svh - 100px);
	}

	.pf-event-lightbox__button {
		width: 56px;
		height: 56px;
	}

	.pf-event-lightbox__previous,
	.pf-event-lightbox__next {
		top: auto;
		bottom: max(16px, env(safe-area-inset-bottom));
		transform: none;
	}

	.pf-event-lightbox__previous:hover,
	.pf-event-lightbox__next:hover {
		transform: scale(1.04);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pf-single-event__gallery-item img,
	.pf-single-event__gallery-item .pf-image-slot,
	.pf-event-lightbox,
	.pf-event-lightbox__media,
	.pf-event-lightbox__button {
		animation: none !important;
		transition: none !important;
	}
}
