/* fb-page-rail
   Everything is scoped under .fbpr and uses custom properties so each site
   can retheme it from the theme stylesheet without touching this file:

   .fbpr { --fbpr-card-w: 320px; --fbpr-accent: #006B54; }
*/

.fbpr {
	--fbpr-card-w: 340px;
	--fbpr-gap: 1rem;
	--fbpr-radius: 12px;
	--fbpr-border: rgba(0, 0, 0, 0.12);
	--fbpr-surface: #fff;
	--fbpr-text: #1a1a1a;
	--fbpr-muted: #6b6b6b;
	--fbpr-accent: #1877f2;

	width: 100%;
	box-sizing: border-box;
}

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

/* Header ------------------------------------------------------------- */

.fbpr__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.fbpr__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.2;
	font-weight: 600;
	color: var(--fbpr-text);
}

.fbpr__nav {
	display: flex;
	gap: 0.5rem;
	flex-shrink: 0;
}

.fbpr__btn {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--fbpr-border);
	border-radius: 50%;
	background: var(--fbpr-surface);
	color: var(--fbpr-text);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.fbpr__btn:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.05);
}

.fbpr__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.fbpr__btn:focus-visible,
.fbpr__track:focus-visible {
	outline: 2px solid var(--fbpr-accent);
	outline-offset: 2px;
}

/* Track -------------------------------------------------------------- */

.fbpr__track {
	display: flex;
	align-items: stretch;
	gap: var(--fbpr-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.75rem;
}

/* Cards -------------------------------------------------------------- */

.fbpr__card {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	width: var(--fbpr-card-w);
	scroll-snap-align: start;
	overflow: hidden;
	border: 1px solid var(--fbpr-border);
	border-radius: var(--fbpr-radius);
	background: var(--fbpr-surface);
	color: var(--fbpr-text);
	text-decoration: none;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

a.fbpr__card:hover {
	border-color: rgba(0, 0, 0, 0.3);
	transform: translateY(-2px);
}

.fbpr__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}

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

.fbpr__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	padding: 1rem;
}

.fbpr__date {
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--fbpr-muted);
}

.fbpr__text {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;

	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* A text-only post has no image to give the card height, so give the body
   a floor — otherwise a short announcement renders as a stub next to the
   image cards. */
.fbpr__card:not(:has(.fbpr__media)) .fbpr__body {
	min-height: 11rem;
	justify-content: center;
}

.fbpr__card:not(:has(.fbpr__media)) .fbpr__text {
	-webkit-line-clamp: 6;
	font-size: 1rem;
}

/* Fallback ----------------------------------------------------------- */

.fbpr__unavailable {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--fbpr-muted);
}

/* Responsive --------------------------------------------------------- */

@media (max-width: 480px) {
	.fbpr {
		--fbpr-card-w: 85vw;
	}
}

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

	.fbpr__card,
	.fbpr__btn {
		transition: none;
	}

	a.fbpr__card:hover {
		transform: none;
	}
}
