/*
 * All Classes (templates/classes.php): the filter chips and the eighteen cards.
 *
 * The grid is set by how many cards fit, not by a breakpoint per device: four across on a desktop,
 * three on a laptop, two on a tablet, one on a phone. Cards in a row are one object — same edges,
 * same baselines — so the Book button sits on the same line across a row however long a class's
 * name runs, which is what `grid-template-rows` on the card does.
 */

.all-classes {
	padding-bottom: 4rem;
}

/* ── The banner ─────────────────────────────────────────────────────────────────────────────── */

/* The band sets white text; the intro inherits it rather than the body's charcoal. */
.all-classes-banner p {
	margin: 1rem 0 0;
	font-size: 1.05rem;
	line-height: 1.55;
}

.all-classes-banner .subtitle {
	display: block;
	margin-bottom: .35rem;
}

/* ── The chips ──────────────────────────────────────────────────────────────────────────────── */

/* The chips and the date picker are one row of controls, wrapping together when it runs out. */
.all-classes-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .9rem 1.75rem;
	margin: 2.5rem 0 1.25rem;
}

/*
 * The filter row, with the date chip last in it.
 *
 * margin-bottom, not 0. It was zero at every width above the phone breakpoint, so the row and the
 * "18 classes" line underneath sat flush against each other — and when the date control was a
 * separate box above the row, that same missing gap is what let the two collide. The phone rule
 * further down sets its own .9rem; this is the one for everywhere else.
 */
.all-classes-filters {
	display: flex;
	flex-wrap: wrap;
	gap: .625rem;
	margin: 0 0 1.1rem;
}

.all-classes-chip {
	display: inline-flex;
	align-items: baseline;
	gap: .45rem;
	padding: .6rem 1.15rem;
	border: 2px solid #ece5e6;
	border-radius: 2rem;
	background: #fff;
	color: #231f20;
	font-family: inherit;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.all-classes-chip:hover {
	border-color: #ffc3c9;
}

.all-classes-chip[aria-pressed="true"] {
	border-color: #fe415f;
	background: #fe415f;
	color: #fff;
}

.all-classes-chip-count {
	font-size: .8em;
	font-weight: 600;
	opacity: .55;
}

/*
 * On a phone the five chips wrap onto three rows and cost about 100px before the first photo.
 * One scrolling row instead — inside the column, so the PAGE never scrolls sideways, only the
 * rail does. The last chip is deliberately clipped at the edge rather than fitted: a half-visible
 * chip is what tells you there is more to swipe to.
 */
@media (max-width: 575.98px) {
	.all-classes-controls {
		display: block;
	}

	.all-classes-filters {
		margin-bottom: .9rem;
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		/* Room for the chips' focus ring, which an overflow container would otherwise cut off. */
		padding: 3px 0;
	}

	.all-classes-filters::-webkit-scrollbar {
		display: none;
	}

	.all-classes-chip {
		flex: 0 0 auto;
	}
}

.all-classes-count {
	margin: 0 0 1.5rem;
	color: #6b6466;
	font-size: .95rem;
}

/* ── The grid ───────────────────────────────────────────────────────────────────────────────── */

.all-classes-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 576px) {
	.all-classes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
	.all-classes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
	.all-classes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.all-classes-item[hidden] {
	display: none;
}

/* ── The card ───────────────────────────────────────────────────────────────────────────────── */

.all-classes-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid #ece5e6;
	border-radius: 18px;
	background: #fff;
}

.all-classes-photo {
	display: block;
	position: relative;
	line-height: 0;
}

.all-classes-photo img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Only where it is getting tight, so it means something when it appears. */
.all-classes-pill {
	position: absolute;
	top: .75rem;
	left: .75rem;
	padding: .3rem .7rem;
	border-radius: 2rem;
	background: #fe415f;
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1.3;
}

/*
 * The body is a grid of four rows, not a flex column: name, price line, next-class box, button.
 * Rows two and three are sized to their content and row one takes the slack, so a two-line name
 * does not push the button of its own card below its neighbours'.
 */
.all-classes-body {
	display: grid;
	grid-template-rows: 1fr auto auto auto;
	gap: .7rem;
	flex-grow: 1;
	padding: 1.1rem 1.1rem 1.2rem;
}

.all-classes-name {
	margin: 0;
	font-family: inherit;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	text-wrap: balance;
}

.all-classes-name a {
	color: inherit;
	text-decoration: none;
}

.all-classes-name a:hover {
	text-decoration: underline;
}

.all-classes-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 .5rem;
	margin: 0;
	color: #5c5557;
	font-size: .95rem;
}

.all-classes-price {
	color: #231f20;
	font-size: 1.05rem;
	font-weight: 800;
}

.all-classes-dot {
	color: #d8cfd1;
}

/* The one tinted block on the card, because the date is what the page is for. */
.all-classes-next {
	padding: .7rem .8rem;
	border-radius: 12px;
	background: #fff1f4;
}

.all-classes-next p {
	margin: 0;
}

/* Inline, so the date reads as a sentence: "Next class: Sat 28 Nov, 9:00am". */
.all-classes-next-label {
	font-weight: 600;
	color: #8a7a7e;
}

.all-classes-next-when {
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.35;
}

.all-classes-seats {
	color: #6b6466;
	font-size: .82rem;
}

.all-classes-seats.is-low {
	color: #d9304b;
	font-weight: 700;
}

.all-classes-book {
	width: 100%;
	text-align: center;
}

/* ── Nothing in that craft ──────────────────────────────────────────────────────────────────── */

.all-classes-empty {
	margin: 2rem 0 0;
	color: #6b6466;
}

.all-classes-reset {
	border: 0;
	padding: 0;
	background: none;
	color: #fe415f;
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	cursor: pointer;
}

/*
 * A price that is more than a figure — a sale, or the private lessons' own sentence — takes the
 * line, and the length goes underneath. See the note in inc/all-classes.php.
 */
.all-classes-meta.is-stacked {
	display: block;
}

.all-classes-meta.is-stacked .all-classes-price {
	display: block;
	line-height: 1.5;
}

.all-classes-meta.is-stacked .all-classes-duration {
	display: block;
	margin-top: .1rem;
}

/* ── THE ORDER OF THE LAST TWO BLOCKS IS LOAD-BEARING ──────────────────────────────────────────
 *
 * The phone rules were written above the card rules first time, and the card rules — same
 * specificity, further down the file — simply won. The page kept its full-width photos and 12,400
 * pixels of scrolling, while the one declaration with no later rival (the date line going
 * horizontal) did apply, which made it look as though the media query were working.
 *
 * So the phone block stays at the END. Nothing after it may restate a property it sets.
 */
/* ── A phone: compact cards, so all eighteen can be scanned ────────────────────────────────────
 *
 * The full-width 4:3 photo made each card about 420px tall and the eighteen of them 13,400px — a
 * page you scroll rather than scan. The same markup turns sideways here: a small square photo on
 * the left and everything else stacked beside it, which is about a quarter of the height.
 *
 * The corner pill goes, because on a 92px thumbnail it covers the photo; the seats line is
 * already pink and bold when it is getting tight, which says the same thing in the place the eye
 * is already reading.
 */
@media (max-width: 575.98px) {
	.all-classes-grid {
		gap: .75rem;
	}

	.all-classes-card {
		flex-direction: row;
		align-items: stretch;
		border-radius: 14px;
	}

	/* A square, centred against however many lines the card has, rather than a tall strip whose
	   height changes from card to card. */
	.all-classes-photo {
		flex: 0 0 92px;
		align-self: center;
		margin: .6rem 0 .6rem .6rem;
		border-radius: 10px;
		overflow: hidden;
	}

	.all-classes-photo img {
		width: 92px;
		height: 92px;
		aspect-ratio: 1 / 1;
	}

	.all-classes-pill {
		display: none;
	}

	.all-classes-body {
		/* Name, price line, date line, button — the button sits with them rather than being
		   pushed to the bottom of a tall card. */
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: .2rem;
		padding: .6rem .75rem .65rem;
		min-width: 0;
	}

	.all-classes-name {
		font-size: 1rem;
	}

	.all-classes-meta {
		font-size: .85rem;
	}

	.all-classes-price {
		font-size: .95rem;
	}

	/* No tinted box at this size: it is one line, and a panel around one line is just inset. */
	.all-classes-next {
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		/* A gap, not a separator. A "·" between them is stranded at the start of the second
		   line the moment the two wrap, which on these names is most of them. */
		gap: 0 .65rem;
		padding: 0;
		background: none;
	}

	.all-classes-next-when,
	.all-classes-seats {
		font-size: .82rem;
	}

	.all-classes-next-when {
		font-weight: 600;
	}

	.all-classes-book {
		width: auto;
		margin-top: .35rem;
		padding: .4rem 1.1rem;
		font-size: .85rem;
	}
}


/* ── The search copy, below the class list ───────────────────────────────────────────────────────
   A footnote to the list, not a new chapter: it stays inside the beige section and a hairline
   above it does the separating, so there is no second colour band and no seam between two. The
   measure is set here rather than by the column, which is as wide as a four-up grid of cards and
   far too wide to read a paragraph across. */
.classes-seo {
	max-width: 46rem;
	/* Left, not centred: everything above it on this page starts at the column's left edge. */
	margin: 3.5rem auto 0 0;
	padding-top: 2rem;
	border-top: 1px solid rgba(0, 0, 0, .12);
}

.classes-seo-title {
	margin: 0 0 .75rem;
	font-size: 1.35rem;
	font-weight: 700;
	text-wrap: balance;
}

.classes-seo-text {
	color: rgba(0, 0, 0, .72);
	font-size: .95rem;
	line-height: 1.65;
}

.classes-seo-text p {
	margin: 0 0 .85rem;
}

.classes-seo-text p:last-child {
	margin-bottom: 0;
}

/* The links are the reason this block exists, so they have to look like links. Underlined rather
   than coloured alone: the body text here is already grey, and a colour-only difference against
   grey is the weakest signal available. */
.classes-seo-text a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .15em;
}

.classes-seo-text a:is(:hover, :focus-visible) {
	color: var(--red, #e4536c);
}

@media (max-width: 575px) {
	.classes-seo {
		margin-top: 2.5rem;
		padding-top: 1.5rem;
	}

	.classes-seo-title {
		font-size: 1.15rem;
	}
}
