/* Reservoir Airtable Events — cards styled after reservoir.co's event cards. */

.rae-events,
.rae-carousel,
.rae-single-details {
	--rae-ink: #102e52;
	--rae-card-bg: #fcfbf3;
	--rae-radius: 12px;
	--rae-button-font: "Roboto Mono", ui-monospace, monospace;
	--rae-page: rgba(255, 255, 255, 0.3);
	--rae-page-active: #fff;
}

.rae-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.rae-error {
	padding: 0.75rem 1rem;
	background: #fee2e2;
	color: #b91c1c;
	border-radius: 8px;
}

/* Card */

.rae-event {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--rae-card-bg);
	border-radius: var(--rae-radius);
	overflow: hidden;
	color: var(--rae-ink);
}

.rae-event__media {
	aspect-ratio: 16 / 9;
}

.rae-event__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rae-event__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	padding: 20px;
}

.rae-events .rae-event p {
	margin: 0;
}

.rae-event__date {
	padding: 5px 16px;
	border: 1px solid currentColor;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	text-transform: uppercase;
}

.rae-events .rae-event__title {
	margin: 0;
	color: inherit;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.35;
	text-transform: none;
}

.rae-event__location {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	line-height: 1.5;
}

.rae-event__pin {
	flex: none;
	width: 24px;
	height: 24px;
}

.rae-event__desc {
	font-size: 15px;
}

.rae-event__actions {
	margin-top: auto;
}

.rae-events .rae-event__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 20px;
	background: var(--rae-ink);
	color: #fff;
	font-family: var(--rae-button-font);
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.rae-event__cta svg {
	flex: none;
	width: 0.8em;
	height: 0.8em;
}

.rae-events .rae-event__cta:hover,
.rae-events .rae-event__cta:focus-visible {
	color: #fff;
	opacity: 0.85;
}

/* Grid (events page) */

.rae-events--grid {
	--rae-columns: 3;
	display: grid;
	grid-template-columns: repeat(var(--rae-columns), minmax(0, 1fr));
	/* Every row as tall as the tallest card, so all cards match. */
	grid-auto-rows: 1fr;
	gap: 42px 20px;
}

@media (max-width: 960px) {
	.rae-events--grid {
		grid-template-columns: repeat(min(var(--rae-columns), 2), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.rae-events--grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
}

/* Carousel (home page) */

/* Fill the column, but never make a page builder's column grow to fit every card. */
.rae-carousel {
	contain: inline-size;
	width: 100%;
	min-width: 0;
}

.rae-events--carousel {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.rae-events--carousel::-webkit-scrollbar {
	display: none;
}

.rae-events--carousel.is-jumping {
	scroll-snap-type: none;
	scroll-behavior: auto;
}

.rae-events--carousel.is-dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

.rae-events--carousel:focus-visible {
	outline: 2px solid var(--rae-page-active);
	outline-offset: 4px;
}

.rae-events--carousel .rae-event {
	flex: 0 0 min(550px, 85%);
	scroll-snap-align: start;
}

.rae-events--carousel .rae-event__body {
	padding: 30px;
}

.rae-events--carousel .rae-event__title {
	font-size: 32px;
	font-weight: 700;
}

.rae-carousel__pages {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 24px;
}

.rae-carousel__pages[hidden] {
	display: none;
}

/* Page bars. `all: unset` first so theme button styles (padding, borders,
   backgrounds, min-heights) can't hide or reshape them. */
.rae-carousel .rae-carousel__page {
	all: unset;
	box-sizing: content-box;
	display: block;
	width: 36px;
	height: 3px;
	/* Taller hit area without changing the bar's look. */
	padding: 10px 0;
	background-color: var(--rae-page);
	background-clip: content-box;
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.rae-carousel .rae-carousel__page:hover {
	background-color: rgba(255, 255, 255, 0.6);
}

.rae-carousel .rae-carousel__page[aria-current="true"] {
	width: 110px;
	background-color: var(--rae-page-active);
}

.rae-carousel .rae-carousel__page:focus-visible {
	outline: 2px solid var(--rae-page-active);
	outline-offset: 2px;
}

/* Phones: both layouts. */
@media (max-width: 640px) {
	.rae-events--carousel .rae-event__body {
		padding: 20px;
	}

	.rae-events .rae-event__title,
	.rae-events--carousel .rae-event__title {
		font-size: 18px;
	}

	.rae-event__date {
		font-size: 14px;
	}

	.rae-event__actions {
		align-self: stretch;
	}

	.rae-events .rae-event__cta {
		display: flex;
		width: 100%;
		box-sizing: border-box;
		font-size: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rae-events--carousel {
		scroll-behavior: auto;
	}
}

/* Single event details (built-in post type) */

.rae-single-details {
	display: grid;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	padding: 1.25rem;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
}

.rae-single-details p {
	margin: 0;
}
