/*
 * Experience group. Figma 357:649 (Experiences): three groups 200px apart,
 * starting 140px after the intro text; each a heading (ExtraLight 100, colour
 * per group) and, 108px below its cap top, a 900 x 900 big card next to four
 * 430 x 430 small cards (2 x 2, 40px apart). The big card sits left, right,
 * left. Cards: radius 4, content at the bottom (padding 20): title,
 * availability, arrow and, on the big card, the text; overlay 30% big, 20%
 * small. The first card in the list is the big one.
 */

.xp-group {
	color: var(--color-forest-a);
}

.xp-group + .xp-group {
	margin-top: var(--space-200);
}

.xp-group:last-of-type {
	padding-bottom: var(--space-140);
}

.xp-group--cooper {
	--xp-heading: var(--color-cooper-1);
}

.xp-group--forest {
	--xp-heading: var(--color-forest-a);
}

.xp-group--olive {
	--xp-heading: var(--color-olive);
}

/* A fixed box of Brando's cap height, so the cards start 108px below the cap top whatever the font. */
.xp-group__heading {
	height: calc(var(--fs-100) * 0.68);
	color: var(--xp-heading);
	font-size: var(--fs-100);
	font-weight: var(--fw-extralight);
	line-height: var(--lh-subheadline);
	letter-spacing: var(--ls-subheadline);
	text-box: trim-both cap alphabetic;
}

.xp-group__cards {
	display: grid;
	grid-template-columns: minmax(0, 900fr) minmax(0, 430fr) minmax(0, 430fr);
	gap: var(--space-40);
	margin-top: var(--space-40);
	padding: 0;
	list-style: none;
}

.xp-group--big-right .xp-group__cards {
	grid-template-columns: minmax(0, 430fr) minmax(0, 430fr) minmax(0, 900fr);
}

.xp-card {
	--xp-overlay: rgb(0 0 0 / 0.2);

	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	aspect-ratio: 1;
	padding: var(--space-20);
	overflow: hidden;
	border-radius: var(--radius);
	color: var(--color-white);
}

/* experience-group.js moves focus to the new big card. */
.xp-card:focus {
	outline: none;
}

.xp-card:focus-visible {
	outline: 2px solid var(--xp-heading);
	outline-offset: 4px;
}

/* Swapped in by a tap or click: focus moves for screen readers, without the ring. */
.xp-card[data-pointer-focus]:focus-visible {
	outline: none;
}

.xp-card:first-child {
	--xp-overlay: rgb(0 0 0 / 0.3);

	grid-row: 1 / span 2;
	grid-column: 1;
}

.xp-group--big-right .xp-card:first-child {
	grid-column: 3;
}

.xp-card > img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xp-card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--xp-overlay);
}

.xp-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-10);
}

.xp-card:first-child .xp-card__body {
	gap: clamp(10px, 0.8333vw, 16px);
}

.xp-card__title,
.xp-card__availability,
.xp-card__arrow {
	font-size: var(--fs-35);
	line-height: var(--lh-body);
	text-box: trim-both cap alphabetic;
}

.xp-card__title {
	font-weight: var(--fw-text);
}

.xp-card__availability,
.xp-card__arrow {
	font-weight: var(--fw-light);
}

/*
 * Figma clips the small card's block through the arrow's cap box (88px for a
 * one-line title, so the title starts 322px down a 430px card). The arrow box
 * reaches into the padding by the same amount; the glyph stays inside.
 */
.xp-card__arrow {
	margin-bottom: -0.14em;
}

/* Big card: the arrow turns down inside a 24 x 35 box (Figma 333:257). */
.xp-card:first-child .xp-card__arrow {
	display: flex;
	margin-bottom: 0;
	align-items: center;
	justify-content: center;
	width: 0.6857em;
	height: 1em;
	text-box: none;
}

.xp-card:first-child .xp-card__arrow > span {
	transform: rotate(90deg);
}

.xp-card__text {
	display: none;
	font-family: var(--font-sans);
	font-size: var(--fs-20);
	line-height: var(--lh-sans);
	letter-spacing: 0.01em;
	text-box: trim-both cap alphabetic;
}

.xp-card:first-child .xp-card__text {
	display: block;
}

.xp-card__text p + p {
	margin-top: 1lh;
}

.xp-card__text em {
	font-style: italic;
}

.xp-card__text strong {
	font-weight: var(--fw-semibold);
}

/* The whole small card is the button (experience-group.js shows it); the big card has none. */
.xp-card__open {
	position: absolute;
	inset: 0;
	z-index: 1;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	appearance: none;
}

.xp-card__open:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: -6px;
}

.xp-card:first-child .xp-card__open {
	display: none;
}

/* The swap (experience-group.js): each card morphs from its old box to its new one. */
::view-transition-group(.xp-card) {
	animation-duration: 0.5s;
	animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Provisional until the mobile design: big card on top, the small ones two per row. */
@media (max-width: 767px) {
	.xp-group__cards,
	.xp-group--big-right .xp-group__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.xp-card:first-child,
	.xp-group--big-right .xp-card:first-child {
		grid-row: auto;
		grid-column: 1 / -1;
	}
}
