/*
Block Name: Posters
Description: Displays a grid of exhibition poster era cards. Clicking a card opens a lightbox slider of poster images.
*/

/* ============================================================
   GRID
   Three columns on desktop.
   ============================================================ */
.block-posters .posters-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

/* ============================================================
   CARD
   ============================================================ */
.block-posters .poster-card {
	border-radius: var(--border-radius, 1rem);
	overflow: hidden;
	cursor: pointer;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.block-posters .poster-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.block-posters .poster-card:focus {
	outline: 3px solid var(--brand-1);
	outline-offset: 2px;
}

/* ============================================================
   COVER IMAGE
   Portrait aspect ratio to match poster proportions.
   ============================================================ */
.block-posters .poster-cover-wrap {
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--brand-8, #f0f0f0);
}

.block-posters .poster-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
    border-radius: 1rem 1rem 0 0;
}

.block-posters .poster-card:hover .poster-cover-img {
	transform: scale(1.03);
}

.block-posters .poster-cover-placeholder {
	width: 100%;
	height: 100%;
	background: var(--brand-8, #e8e8e8);
}

/* ============================================================
   LABEL BAR
   Brand-coloured bar at the bottom of each card.
   ============================================================ */
.block-posters .poster-label {
	background: var(--brand-2);
	color: #fff;
	padding: 2.4rem 2.6rem;

}

/* ============================================================
   CTA BUTTON
   Full-width brand-coloured block link below the grid.
   ============================================================ */
.block-posters .posters-cta-btn {
	display: block;
	margin-top: 2rem;
	background: var(--brand-2);
	color: #fff;
	text-align: center;
	padding: 2.2rem 2rem;
	border-radius: var(--border-radius, 1rem);
	text-decoration: none;
	transition: background 0.2s ease;
}

.block-posters .posters-cta-btn:hover {
	background: var(--brand-1);
	color: #fff;
}

/* ============================================================
   LIGHTBOX OVERLAY
   Covers the full viewport. Uses a high z-index to sit above
   all page content. Hidden by default via [hidden] attribute;
   JS removes [hidden] and adds .is-open to show it.
   ============================================================ */
.posters-lightbox {
	display: none; /* Hidden until JS removes [hidden] */
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.92);
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	padding: 4rem 2rem;
}

/* JS adds .is-open to show the lightbox */
.posters-lightbox.is-open {
	display: flex;
}

/* ============================================================
   LIGHTBOX CLOSE BUTTON
   ============================================================ */
.posters-lightbox-close {
	position: absolute;
	top: 2rem;
	right: 2rem;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0.5rem;
	line-height: 1;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}

.posters-lightbox-close:hover {
	opacity: 1;
}

/* ============================================================
   LIGHTBOX TITLE
   ============================================================ */
.posters-lightbox-title {
	color: #fff;
	margin: 0;
	text-align: center;
}

/* ============================================================
   SWIPER SLIDER INSIDE LIGHTBOX
   Max width keeps the poster images at a readable size.
   ============================================================ */
.posters-lightbox .posters-swiper {
	width: 100%;
	max-width: 50rem;
}

.posters-lightbox .swiper-slide img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--border-radius, 1rem);
	max-height: 70vh;
	object-fit: contain;
}

.posters-lightbox .swiper-slide p.poster-slide-caption {
	color: rgba(255, 255, 255, 0.7);
	text-align: center;
	margin: 1rem 0 0;
}

/* ============================================================
   LIGHTBOX NAV
   ============================================================ */
.posters-lightbox-nav {
	display: flex;
	align-items: center;
	gap: 2.4rem;
}

.posters-lightbox-nav button {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: #fff;
	border-radius: var(--border-radius, 1rem);
	padding: 0.8rem 2rem;
	cursor: pointer;
	font-size: 2rem;
	transition: background 0.2s ease;
}

.posters-lightbox-nav button:hover {
	background: rgba(255, 255, 255, 0.28);
}

.posters-counter {
	color: rgba(255, 255, 255, 0.7);
	min-width: 6rem;
	text-align: center;
}

/* ============================================================
   RESPONSIVE
   Two columns on tablet, one on mobile.
   ============================================================ */
@media screen and (max-width: 900px) {
	.block-posters .posters-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 576px) {
	.block-posters .posters-grid {
		grid-template-columns: 1fr;
	}

	.posters-lightbox .posters-swiper {
		max-width: 100%;
	}
}
