/**
 * Facilities & Amenities — home teaser + both detail pages.
 *
 * One stylesheet serves all three (see bananchal_assets()), so the namespaces
 * are kept apart: .bf-fac-teaser__* belongs to the front page only, while
 * .bf-fac-intro / .bf-fac-cat / .bf-fac-cross belong to the two detail pages.
 * Nothing is shared between the two halves, so a change to one cannot reach the
 * other. Depends on the tokens in assets/css/style.css, enqueued first.
 *
 * 1. Home teaser — groups
 * 2. Home teaser — tiles
 * 3. Page intro
 * 4. Page category panels
 * 5. Page cross-link band
 * 6. Responsive
 * 7. Reduced motion
 */

/* ==========================================================================
   1. Home teaser — groups
   ========================================================================== */

.bf-fac-teaser__lead {
	margin-bottom: 0;
}

.bf-fac-teaser__group + .bf-fac-teaser__group {
	margin-top: 3.25rem;
}

/*
 * Centred rule with the group name sitting in it — the two groups need a clear
 * separator, and a plain left-aligned h3 read as a page heading rather than a
 * label for the row underneath.
 */
.bf-fac-teaser__group-title {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	font-size: 1.35rem;
	letter-spacing: 0.01em;
	color: var(--bf-green-dark);
}

.bf-fac-teaser__group-title::before,
.bf-fac-teaser__group-title::after {
	content: '';
	flex: 1 1 auto;
	height: 1px;
	background-color: var(--bf-line);
}

/* ==========================================================================
   2. Home teaser — tiles
   ========================================================================== */

/*
 * Two up on the narrowest phone for both rows. From there they diverge so that
 * neither row ever ends on a stranded single tile: the six-tile row goes 3 up at
 * 576px and 6 up at 992px, the four-tile row goes 4 up at 768px. Six across is
 * held back to 992px because below it the column falls under ~150px and the
 * longer labels wrap to two lines. Measured at 320, 576, 768, 992 and 1366.
 *
 * Every tile clears the 44px minimum target several times over — 141 x 118 at
 * the narrowest, and the vertical padding alone is 1.2rem.
 */
.bf-fac-teaser__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.bf-fac-teaser__cell {
	display: flex;
}

.bf-fac-teaser__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.85rem;
	width: 100%;
	min-height: 100%;
	padding: 1.4rem 0.85rem 1.5rem;
	border: 1px solid var(--bf-line);
	border-radius: var(--bf-radius-lg);
	background-color: var(--bf-white);
	box-shadow: var(--bf-shadow-sm);
	text-align: center;
	transition: transform var(--bf-transition), box-shadow var(--bf-transition),
		border-color var(--bf-transition);
}

/* Interactive, so it earns the theme's established lift. */
.bf-fac-teaser__tile:hover,
.bf-fac-teaser__tile:focus-visible {
	transform: translateY(-6px);
	border-color: var(--bf-amber);
	box-shadow: var(--bf-shadow);
}

/* The lift already reads as focus; the ring makes it unmistakable. */
.bf-fac-teaser__tile:focus-visible {
	outline: 2px solid var(--bf-amber);
	outline-offset: 3px;
}

.bf-fac-teaser__disc {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: var(--bf-cream);
	color: var(--bf-amber);
	font-size: 1.5rem;
	line-height: 1;
	transition: background-color var(--bf-transition), color var(--bf-transition);
}

.bf-fac-teaser__tile:hover .bf-fac-teaser__disc,
.bf-fac-teaser__tile:focus-visible .bf-fac-teaser__disc {
	background-color: var(--bf-green);
	color: var(--bf-white);
}

.bf-fac-teaser__label {
	font-family: var(--bf-font-body);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.45;
	color: var(--bf-charcoal);
	transition: color var(--bf-transition);
}

.bf-fac-teaser__tile:hover .bf-fac-teaser__label,
.bf-fac-teaser__tile:focus-visible .bf-fac-teaser__label {
	color: var(--bf-green-dark);
}

/* ==========================================================================
   3. Page intro
   ========================================================================== */

.bf-fac-intro__text {
	margin-bottom: 0;
}

/* ==========================================================================
   4. Page category panels
   ========================================================================== */

/*
 * Belt and braces behind html { scroll-padding-top } in style.css: any browser
 * that ignores the ancestor rule still lands clear of the sticky header.
 *
 * Guarded, because the two properties add up rather than override: with both
 * live a deep link landed 224px down the viewport instead of 112px, dropping the
 * list itself below the fold on a laptop. Measured in the browser, front page
 * tile to #wellness. So the fallback fires only where scroll-padding is not
 * understood, and the anchored sections carry it in every other respect.
 */
@supports not (scroll-padding-top: 1px) {
	.bf-fac-cat {
		scroll-margin-top: calc(var(--bf-header-h) + 20px);
	}
}

.bf-fac-cat__panel {
	padding: clamp(1.5rem, 3.5vw, 2.75rem);
	border: 1px solid var(--bf-line);
	border-radius: var(--bf-radius-lg);
	background-color: var(--bf-white);
	/* Presentational panel — the smaller shadow, and no hover lift. */
	box-shadow: var(--bf-shadow-sm);
}

.bf-fac-cat__head {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	margin-bottom: 1.75rem;
	padding-bottom: 1.35rem;
	border-bottom: 1px solid var(--bf-line);
}

.bf-fac-cat__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background-color: var(--bf-sand);
	color: var(--bf-green);
	font-size: 1.4rem;
	line-height: 1;
}

.bf-fac-cat__title {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	line-height: 1.15;
}

/*
 * A real <ul> for semantics, laid out as a two-column checklist. The bullets go
 * and the amber check takes over, so it reads as a spec sheet rather than a list.
 */
.bf-fac-cat__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 3rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.bf-fac-cat__item {
	display: flex;
	align-items: baseline;
	gap: 0.85rem;
	padding: 0.8rem 0;
	border-top: 1px solid var(--bf-line);
}

.bf-fac-cat__item:first-child {
	border-top: 0;
	padding-top: 0;
}

.bf-fac-cat__check {
	flex: 0 0 auto;
	color: var(--bf-amber-dark);
	font-size: 1rem;
	line-height: 1;
}

.bf-fac-cat__text {
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--bf-ink);
}

/* ==========================================================================
   5. Page cross-link band
   ========================================================================== */

.bf-fac-cross__title {
	margin-bottom: 1rem;
}

.bf-fac-cross__text {
	max-width: 40rem;
	margin: 0 auto;
	color: rgba(255, 255, 255, 0.8);
}

.bf-fac-cross__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin-top: 2rem;
}

.bf-fac-cross__link {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

/* The arrow leans into the direction of travel on hover. */
.bf-fac-cross__link i {
	transition: transform var(--bf-transition);
}

.bf-fac-cross__link:hover i,
.bf-fac-cross__link:focus-visible i {
	transform: translateX(4px);
}

/* ==========================================================================
   6. Responsive
   ========================================================================== */

@media (min-width: 576px) {
	.bf-fac-teaser__grid {
		gap: 1rem;
	}

	/*
	 * The six-tile row goes three up here; the four-tile row deliberately stays
	 * two up, because three columns would leave its fourth tile stranded alone on
	 * a second row. 2 x 2 stays balanced until there is room for all four.
	 */
	.bf-fac-teaser__grid--six {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.bf-fac-teaser__grid--four {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	/*
	 * Two columns, with the rule moved to the top edge of every item so the
	 * separators line up across both columns. Anchored to the first two children
	 * rather than :nth-last-child: an odd item count leaves a lone item in the
	 * final row, which would otherwise strip the rule from its row-mate.
	 */
	.bf-fac-cat__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bf-fac-cat__item:first-child {
		border-top: 1px solid var(--bf-line);
		padding-top: 0.8rem;
	}

	.bf-fac-cat__item:nth-child(-n + 2) {
		border-top: 0;
		padding-top: 0;
	}
}

@media (min-width: 992px) {
	.bf-fac-teaser__grid--six {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media (max-width: 575.98px) {
	.bf-fac-teaser__group + .bf-fac-teaser__group {
		margin-top: 2.5rem;
	}

	.bf-fac-teaser__group-title {
		font-size: 1.2rem;
		gap: 0.75rem;
	}

	.bf-fac-teaser__tile {
		padding: 1.2rem 0.6rem 1.3rem;
		gap: 0.7rem;
	}

	.bf-fac-teaser__disc {
		width: 48px;
		height: 48px;
		font-size: 1.3rem;
	}

	.bf-fac-teaser__label {
		font-size: 0.74rem;
		letter-spacing: 0.07em;
	}

	.bf-fac-cat__head {
		gap: 0.85rem;
		margin-bottom: 1.4rem;
		padding-bottom: 1.1rem;
	}

	.bf-fac-cat__icon {
		width: 44px;
		height: 44px;
		font-size: 1.2rem;
	}
}

/* ==========================================================================
   7. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.bf-fac-teaser__tile,
	.bf-fac-teaser__disc,
	.bf-fac-teaser__label,
	.bf-fac-cross__link i {
		transition: none;
	}

	.bf-fac-teaser__tile:hover,
	.bf-fac-teaser__tile:focus-visible {
		transform: none;
	}

	.bf-fac-cross__link:hover i,
	.bf-fac-cross__link:focus-visible i {
		transform: none;
	}

	/* Beats the inline stagger, which would otherwise hold the second group back. */
	.bf-fac-teaser__group {
		transition-delay: 0s !important;
	}
}
