.an-social {
	background: var(--wp--preset--color--base);
	padding-block: var(--wp--preset--spacing--xl);
}

.an-social__head {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m);
	justify-content: space-between;
	margin-block-end: var(--wp--preset--spacing--l);
}

.an-social__eyebrow {
	margin-block-end: var(--wp--preset--spacing--m);
}

/* Six across, three from 68.75rem down, a swipe row on a phone. */
.an-social__grid {
	display: grid;
	gap: var(--wp--preset--spacing--s);
	grid-template-columns: repeat(6, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.an-social__grid > * {
	margin: 0;
	min-inline-size: 0;
}

.an-social__tile {
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--base);
	display: block;
	overflow: hidden;
	position: relative;
	text-decoration: none;
}

/* The global link hover colour is a stronger selector than the tile's. */
a.an-social__tile:hover,
a.an-social__tile:focus-visible {
	color: var(--wp--preset--color--base);
}

.an-social__tile img {
	block-size: 100%;
	inline-size: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--an-easing);
}

.an-social__tile .an-social__logo {
	object-fit: contain;
	padding: 18%;
}

.an-social__badge {
	align-items: center;
	background: rgb(255 255 255 / 0.9);
	block-size: 2rem;
	border-radius: var(--an-radius-pill);
	color: var(--wp--preset--color--contrast);
	display: flex;
	inline-size: 2rem;
	inset-block-start: 0.6rem;
	inset-inline-end: 0.6rem;
	justify-content: center;
	position: absolute;
}

.an-social__badge .icon {
	block-size: 0.9rem;
	fill: currentColor;
	inline-size: 0.9rem;
}

.an-social__cap {
	background: linear-gradient(transparent, rgb(27 40 32 / 0.82));
	font-size: var(--wp--preset--font-size--xs);
	inset: auto 0 0;
	line-height: 1.3;
	opacity: 0;
	padding: 2.5rem 0.8rem 0.8rem;
	position: absolute;
	transition: opacity 0.3s var(--an-easing);
}

.an-social__tile:hover img,
.an-social__tile:focus-visible img {
	transform: scale(1.05);
}

.an-social__tile:hover .an-social__cap,
.an-social__tile:focus-visible .an-social__cap {
	opacity: 1;
}

.an-social__tile:focus-visible {
	outline: var(--an-focus-width) solid var(--wp--preset--color--primary);
	outline-offset: var(--an-focus-offset);
}

@media (prefers-reduced-motion: reduce) {
	.an-social__tile img {
		transition: none;
	}

	.an-social__tile:hover img,
	.an-social__tile:focus-visible img {
		transform: none;
	}
}

@media (max-width: 68.74rem) {
	.an-social__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* A phone has no hover: the captions show, the row scrolls sideways. */
@media (max-width: 47.99rem) {
	.an-social__grid {
		grid-auto-columns: 62%;
		grid-auto-flow: column;
		grid-template-columns: none;
		margin-inline: calc(-1 * var(--wp--preset--spacing--gutter));
		overflow-x: auto;
		padding-inline: var(--wp--preset--spacing--gutter);
		scroll-padding-inline: var(--wp--preset--spacing--gutter);
		scroll-snap-type: x mandatory;
	}

	.an-social__grid > * {
		scroll-snap-align: start;
	}

	.an-social__cap {
		opacity: 1;
	}
}

/* --- A reel that plays here (its video is on this site) --- */

.an-social__tile--video {
	cursor: pointer;
}

.an-social__tile video {
	background: var(--wp--preset--color--deep);
	block-size: 100%;
	inline-size: 100%;
	object-fit: cover;
}

.an-social__play {
	align-items: center;
	background: rgb(255 255 255 / 0.9);
	block-size: 3.5rem;
	border: 0;
	border-radius: 50%;
	color: var(--wp--preset--color--contrast);
	display: flex;
	inline-size: 3.5rem;
	inset: 50% auto auto 50%;
	justify-content: center;
	min-height: 0;
	padding: 0;
	position: absolute;
	transform: translate(-50%, -50%);
	transition: transform 0.3s var(--an-easing);
}

/* A long caption reaches up over the button (mosaic: large type, tall padding) and
   took its clicks, so that reel did not play. The caption lets clicks through and
   the button sits above its shade. */
.an-social__tile--video .an-social__play {
	z-index: 1;
}

.an-social__tile--video .an-social__cap {
	pointer-events: none;
}

.an-social__play:hover,
.an-social__play:focus-visible {
	transform: translate(-50%, -50%) scale(1.08);
}

.an-social__play .icon {
	block-size: 1.3rem;
	fill: currentColor;
	inline-size: 1.3rem;
	margin-inline-start: 0.2rem;
}

.an-social__ig {
	align-items: center;
	background: rgb(255 255 255 / 0.9);
	block-size: 2rem;
	border-radius: var(--an-radius-pill);
	color: var(--wp--preset--color--contrast);
	display: flex;
	inline-size: 2rem;
	inset-block-start: 0.6rem;
	inset-inline-end: 0.6rem;
	justify-content: center;
	position: absolute;
	z-index: 1;
}

.an-social__ig .icon {
	block-size: 1rem;
	inline-size: 1rem;
}

.an-social__tile.is-playing .an-social__play,
.an-social__tile.is-playing .an-social__cap {
	display: none;
}

/* --- A text card between the tiles --- */

.an-social__note {
	background: var(--wp--preset--color--paper);
	border: var(--an-border-width) solid var(--wp--preset--color--line);
	block-size: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--s);
	justify-content: center;
	margin: 0;
	padding: var(--wp--preset--spacing--m);
}

.an-social__quote {
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xxl);
	line-height: 0.6;
}

.an-social__note-text {
	border: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--m);
	line-height: var(--an-leading-snug);
	margin: 0;
	padding: 0;
}

.an-social__note-by {
	align-items: center;
	display: flex;
	font-size: var(--wp--preset--font-size--s);
	gap: 0.6rem;
}

.an-social__note-by img {
	background: var(--wp--preset--color--base);
	border: var(--an-border-width) solid var(--wp--preset--color--line);
	border-radius: 50%;
	block-size: 2.5rem;
	inline-size: 2.5rem;
	object-fit: contain;
	padding: 0.35rem;
}

/* --- Mosaic: tiles of different sizes with text cards (Ruben, 11-13) --- */

.an-social--mosaic .an-social__eyebrow {
	align-items: center;
	display: flex;
	gap: 0.5rem;
}

.an-social--mosaic .an-social__eyebrow .icon {
	block-size: 1.1rem;
	inline-size: 1.1rem;
}

/*
 * The mockup's golden brush stroke (Ruben, 11-13): under the heading's first
 * words, and short under each caption. A colour of its own, not in the
 * palette: it appears only here.
 */
.an-social--mosaic {
	--an-social-gold: #d9a535;
}

.an-social--mosaic .an-social__title {
	font-style: italic;
}

.an-social--mosaic .an-social__title::after {
	background: no-repeat left center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 8.5C48 3.5 118 2.5 197 6' fill='none' stroke='%23d9a535' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E");
	block-size: 0.22em;
	content: "";
	display: block;
	inline-size: min(5.6em, 60%);
	margin-block-start: 0.12em;
}

@media (min-width: 48rem) {
	.an-social--mosaic .an-social__grid {
		grid-auto-flow: dense;
		grid-auto-rows: 15rem;
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	/* The first tile is tall, the rest fill the rows: seven fill four by two. */
	.an-social--mosaic .an-social__grid > :first-child {
		grid-row: span 2;
	}

	.an-social--mosaic .an-social__tile {
		aspect-ratio: auto;
		block-size: 100%;
		border-radius: var(--an-radius-m);
	}

	.an-social--mosaic .an-social__note {
		border-radius: var(--an-radius-m);
	}

	.an-social--mosaic .an-social__cap {
		font-family: var(--wp--preset--font-family--heading);
		font-size: var(--wp--preset--font-size--l);
		line-height: 1.15;
		opacity: 1;
		padding: 4rem var(--wp--preset--spacing--m) var(--wp--preset--spacing--m);
	}

	.an-social--mosaic .an-social__cap::after {
		background: var(--an-social-gold);
		border-radius: 2px;
		block-size: 3px;
		content: "";
		display: block;
		inline-size: 3rem;
		margin-block-start: 0.6rem;
	}
}

@media (min-width: 48rem) and (max-width: 68.74rem) {
	.an-social--mosaic .an-social__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/*
 * Seven items on a wide screen: the mockup's arrangement (Ruben, 11-13; owner,
 * 11-14 "not all the other ones square"). Four columns of different rhythm on
 * twelve fine rows: a tall tile; the card over a tall tile; a tall tile over a
 * low one; two of nearly equal height. The order in the markup is unchanged
 * (it reads top row, then bottom row). Any other count keeps the even rows above,
 * and so does a browser without :has().
 */
@media (min-width: 68.75rem) {
	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) {
		block-size: 38rem;
		grid-auto-flow: row;
		grid-auto-rows: auto;
		grid-template-rows: repeat(12, minmax(0, 1fr));
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(1) {
		grid-area: 1 / 1 / 13 / 2;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(2) {
		grid-area: 1 / 2 / 6 / 3;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(3) {
		grid-area: 1 / 3 / 9 / 4;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(4) {
		grid-area: 1 / 4 / 8 / 5;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(5) {
		grid-area: 6 / 2 / 13 / 3;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(6) {
		grid-area: 9 / 3 / 13 / 4;
	}

	.an-social--mosaic .an-social__grid:has(> :nth-child(7):last-child) > :nth-child(7) {
		grid-area: 8 / 4 / 13 / 5;
	}
}

.an-social__more {
	margin: var(--wp--preset--spacing--l) 0 0;
	text-align: center;
}

.an-social__follow-btn {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	border-radius: var(--an-radius-pill);
	gap: 0.6rem;
	padding-inline: var(--wp--preset--spacing--l);
}

.an-social__follow-btn:hover {
	background-color: var(--wp--preset--color--deep);
	border-color: var(--wp--preset--color--deep);
}

.an-social__follow-btn .icon {
	block-size: 1.1rem;
	inline-size: 1.1rem;
}
