/* Events Cart ("Pure Café") page — reproduces the live Shopify page's layout.
 *
 * Loaded only on that page (see inc/events-cart.php). It depends on
 * hero-carousel.css being loaded first for the shared hero: only the pieces
 * that differ from the homepage hero are redefined here.
 *
 * The page uses Kadence's fullwidth/unboxed layout (set as post meta by
 * scripts/rebuild-events-cart-page.php), so the content container supplies no
 * max-width or padding. Each band below owns its own horizontal padding and
 * centres an inner container at the global content width — the same rhythm
 * `.po-section` uses on the homepage, which is what keeps sections from
 * overrunning the page padding.
 */

.po-events-section {
	padding-block: clamp(2.5rem, 5vw, 4.5rem);
	padding-inline: clamp(1.25rem, 4vw, 3rem);
	background: var(--global-palette8, #dbdbce);
}

.po-events-section__inner {
	max-width: var(--global-content-width, 1290px);
	margin-inline: auto;
}

/* --- Hero ---------------------------------------------------------------- */

/* The homepage hero is a near-full-viewport opener with the transparent header
 * over it. This one sits below a normal solid header and is shorter, matching
 * the Shopify events page. */
/* Taller than before (15/10): the photos are portrait and fill the width, so
 * every extra pixel of height is more of the cart kept in the crop. */
.po-hero--events {
	min-height: min(88vh, 820px);
}
@media (max-width: 781px) {
	.po-hero--events {
		min-height: 70vh;
	}
}

/* The homepage hero carries no text, so its overlay clears through the middle.
 * This one has a centred title over the photo and needs even coverage for the
 * text to stay legible across both slides. */
.po-hero--events .po-hero-overlay {
	background: linear-gradient(
		180deg,
		rgba(24, 24, 18, 0.42) 0%,
		rgba(24, 24, 18, 0.34) 45%,
		rgba(24, 24, 18, 0.46) 100%
	);
}

.po-events-hero__copy {
	position: relative;
	z-index: 3;
	text-align: center;
	padding-inline: 1.5rem;
	color: #fff;
}

.po-events-hero__title {
	margin: 0;
	color: #fff;
	font-size: clamp(2.25rem, 6vw, 4.5rem);
	line-height: 1.15;
	/* Syne's descenders clip at large sizes against a tight line-box — the same
	 * fix applied to headings site-wide in style.css. */
	padding-bottom: 0.12em;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.po-events-hero__subtitle {
	margin: 0.75rem 0 0;
	color: #fff;
	font-size: clamp(0.95rem, 1.6vw, 1.15rem);
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* --- Booking CTA --------------------------------------------------------- */

/* Black pill, centred — matching the Shopify button (#000, 30px radius). It
 * appears twice on the page, above the intro and above the gallery.
 *
 * `display`/`padding` are declared explicitly because Kadence styles every
 * button and .btn with its own padding and inline-block display; inheriting
 * those misaligns the label (the bug already fixed twice in the gift-box CSS
 * and once in the countdown bar). */
.po-events-cta {
	display: flex;
	justify-content: center;
	padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
	padding-inline: clamp(1.25rem, 4vw, 3rem);
	background: var(--global-palette8, #dbdbce);
}

.po-events-cta__btn,
.po-events-cta__btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1.9rem;
	border-radius: 0;
	background: #000;
	color: #fff;
	font-size: clamp(0.9rem, 1.4vw, 1rem);
	font-weight: 600;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.po-events-cta__btn:hover,
.po-events-cta__btn:focus-visible {
	background: var(--global-palette1, #747c34);
	color: #fff;
	transform: translateY(-2px);
}

/* --- Intro: copy left, photo right --------------------------------------- */

.po-events-intro__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1.75rem, 4vw, 3.5rem);
	align-items: center;
}

@media (max-width: 781px) {
	.po-events-intro__grid {
		grid-template-columns: 1fr;
	}
}

.po-events-intro__title {
	margin: 0 0 1.25rem;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.15;
	padding-bottom: 0.1em;
}

.po-events-intro__copy p {
	margin: 0 0 1.1rem;
	font-size: clamp(1rem, 1.3vw, 1.1rem);
	line-height: 1.7;
}

.po-events-intro__copy p:last-child {
	margin-bottom: 0;
}

.po-events-intro__media img {
	display: block;
	width: 100%;
	height: auto;
	/* The source photo is portrait (a phone shot); the Shopify page crops it to
	 * a landscape panel beside the text rather than letting it tower over the
	 * copy. */
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 2px;
}

/* --- Our Offerings ------------------------------------------------------- */

.po-events-offerings__title {
	margin: 0 0 clamp(1.75rem, 3.5vw, 2.75rem);
	text-align: center;
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.15;
	padding-bottom: 0.1em;
}

.po-events-offerings__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(1.25rem, 2.5vw, 2.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.po-events-offerings__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.po-events-offerings__grid {
		grid-template-columns: 1fr;
	}
}

.po-events-offering {
	margin: 0;
}

.po-events-offering__media {
	overflow: hidden;
	border-radius: 2px;
}

.po-events-offering__media img {
	display: block;
	width: 100%;
	height: auto;
	/* Square, as on the Shopify page — the sources are a mix of portrait phone
	 * photos and landscape shots, so a fixed ratio is what keeps the row tidy. */
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.po-events-offering:hover .po-events-offering__media img {
	transform: scale(1.04);
}

.po-events-offering__name {
	margin: 1rem 0 0;
	font-size: clamp(1.15rem, 1.9vw, 1.5rem);
	line-height: 1.3;
	padding-bottom: 0.08em;
}

.po-events-offering__sub {
	margin: 0.35rem 0 0;
	font-size: 0.95rem;
	opacity: 0.85;
}

/* --- Gallery carousel ---------------------------------------------------- */

/* The band keeps its inner container for the heading row, but the scrolling
 * track runs the full width of the page so photos bleed off both edges, the
 * way the Shopify carousel does. The track's own inline padding lines its
 * first photo up with the heading above it. */
.po-events-gallery {
	padding-inline: 0;
}

.po-events-gallery .po-events-section__inner {
	padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.po-events-gallery__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.po-events-gallery__title {
	margin: 0;
	font-size: clamp(1.5rem, 3.5vw, 2.5rem);
	line-height: 1.2;
	padding-bottom: 0.08em;
}

.po-events-gallery__nav {
	display: flex;
	flex-shrink: 0;
	gap: 0.75rem;
}

/* Bare arrow glyphs, no chip — matching the Shopify gallery. `display` and
 * `padding` are set explicitly for the same Kadence-button reason noted above:
 * without them the SVG sits off-centre. */
.po-events-gallery__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--global-palette3, #3c3423);
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.po-events-gallery__arrow:hover:not(:disabled) {
	background: rgba(60, 52, 35, 0.08);
}

.po-events-gallery__arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

/* In Arabic the row reads right-to-left, so the arrow glyphs have to point the
 * other way for "previous" to still mean "back toward the first photo". The
 * scroll direction itself is handled in the JS. */
[dir="rtl"] .po-events-gallery__arrow svg {
	transform: scaleX(-1);
}

.po-events-gallery__track {
	display: flex;
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
	padding-inline: clamp(1.25rem, 4vw, 3rem);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	/* Hide the scrollbar; the arrows and touch/trackpad drag are the controls. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.po-events-gallery__track::-webkit-scrollbar {
	display: none;
}

.po-events-gallery__item {
	flex: 0 0 auto;
	width: min(46vw, 620px);
	margin: 0;
	scroll-snap-align: start;
}

@media (max-width: 781px) {
	.po-events-gallery__item {
		width: 80vw;
	}
}

.po-events-gallery__item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 3;
	object-fit: cover;
	border-radius: 2px;
}

/* Wide photos (wider than 5:3) keep their own ratio rather than being cropped:
 * the same height as a 5:3 slide, proportionally wider. The ratio comes from
 * the attachment's real dimensions, set inline by inc/events-cart.php.
 *
 * An explicit aspect-ratio, not `auto` — see the note on
 * .po-collection-band__media--source in collection-pages.css: with
 * WordPress's sizes="auto" on lazy images, `auto` leaves Chrome without an
 * intrinsic size. */
.po-events-gallery__item--wide {
	width: min(calc(min(46vw, 620px) * 0.6 * var(--po-slide-w) / var(--po-slide-h)), 92vw);
}

@media (max-width: 781px) {
	.po-events-gallery__item--wide {
		width: min(calc(80vw * 0.6 * var(--po-slide-w) / var(--po-slide-h)), 92vw);
	}
}

.po-events-gallery__item--wide img {
	aspect-ratio: var(--po-slide-w) / var(--po-slide-h);
}

/* Respect the reduced-motion preference for the decorative bits. */
@media (prefers-reduced-motion: reduce) {
	.po-events-offering__media img,
	.po-events-cta__btn {
		transition: none;
	}
	.po-events-offering:hover .po-events-offering__media img {
		transform: none;
	}
	.po-events-gallery__track {
		scroll-behavior: auto;
	}
}
