/**
 * Celebrity A-Z index (/celebrities/).
 *
 * Three full-width bands carry the page, the same way the homepage is built:
 * ground for the masthead and photography, deep emerald for the sticky letter
 * rail, white for the index itself. Without that rhythm the page is one flat
 * field of ground colour from the header to the footer, which is what a
 * directory of 227 names should never look like.
 *
 * The dark band re-points the colour tokens rather than overriding each rule by
 * hand, so the label, the input, the letters and their states all invert on
 * their own. Same technique inc/homepage.php uses for its emerald section.
 *
 * Loaded on the Celebrity A-Z Index template only, from inc/celebrities.php.
 *
 * @package GeneratePress_Child
 */

/* Release GeneratePress's constrained container so the bands can run edge to
   edge. ID selectors outrank the theme's .grid-container without !important. */
.ha-az-page #page,
.ha-az-page #content {
	max-width: none;
	margin: 0;
	padding: 0;
}

.ha-az-page #content {
	display: block;
}

.ha-az-page .site-main {
	margin: 0;
	padding: 0;
}

.ha-az {
	width: 100%;
}

/* --- Bands --------------------------------------------------------------- */

.ha-az__band {
	width: 100%;
}

.ha-az__inner {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding-left: clamp(1rem, 4vw, 2.5rem);
	padding-right: clamp(1rem, 4vw, 2.5rem);
}

.ha-az__band--head {
	padding-top: clamp(2rem, 5vw, 3.5rem);
	padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.ha-az__band--index {
	background-color: var(--ha-surface);
	padding-top: clamp(1.5rem, 4vw, 2.5rem);
	padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

/* --- Masthead ------------------------------------------------------------ */

.ha-az__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: var(--ha-gap);
	padding-bottom: var(--ha-gap);
	border-bottom: var(--ha-border-width) solid var(--ha-rule-strong);
}

.ha-az__title {
	grid-column: 1;
	margin: 0;
	font-family: var(--ha-font-display);
	font-size: clamp(2.5rem, 6vw, 4.25rem);
	line-height: 1.04;
	font-weight: 500;
	letter-spacing: var(--ha-track-tight);
	color: var(--ha-ink);
}

.ha-az__lead {
	grid-column: 1;
	margin: 0;
	max-width: var(--ha-measure);
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-body);
	line-height: var(--ha-leading-body);
	color: var(--ha-ink-muted);
}

.ha-az__figure {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: end;
	margin: 0;
	text-align: right;
}

.ha-az__figure-value {
	display: block;
	font-family: var(--ha-font-display);
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1;
	font-weight: 500;
	color: var(--ha-accent);
	font-variant-numeric: tabular-nums;
}

.ha-az__figure-label {
	display: block;
	margin-top: 0.25rem;
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-label);
	font-weight: 600;
	letter-spacing: var(--ha-track-label);
	text-transform: uppercase;
	color: var(--ha-ink-soft);
}

/* --- Photography --------------------------------------------------------- */

.ha-az__recent {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--ha-gap);
	margin-top: var(--ha-gap-lg);
}

.ha-az__recent-item {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ha-az__recent-media {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background-color: var(--ha-accent-soft);
}

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

.ha-az__recent-name {
	display: block;
	margin-top: 0.6rem;
	font-family: var(--ha-font-display);
	font-size: var(--ha-size-h3);
	line-height: 1.2;
	color: var(--ha-ink);
}

.ha-az__recent-item:hover .ha-az__recent-name,
.ha-az__recent-item:focus-visible .ha-az__recent-name {
	color: var(--ha-accent-deep);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

/* --- The letter rail ----------------------------------------------------- */

/* Deep ground, sticky. Tokens are re-pointed rather than each rule overridden,
   so everything inside inverts on its own. The literal hex is deliberate:
   --ha-surface is repointed here, so reading it back would resolve wrong. */
.ha-az__band--tools {
	position: sticky;
	top: 0;
	z-index: 5;
	background-color: #0A3C30;
	padding-top: 0.85rem;
	padding-bottom: 0.35rem;

	--ha-surface: #0A3C30;
	--ha-ink: #FFFFFF;
	--ha-ink-muted: #A9D2C6;
	--ha-ink-soft: #A9D2C6;
	--ha-rule: #2A5A4C;
	--ha-rule-strong: #2F7A67;
	--ha-accent: #73E6CB;
	--ha-accent-mid: #73E6CB;
	--ha-accent-deep: #FFFFFF;
}

.ha-az__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.75rem;
}

.ha-az__filter-label {
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-label);
	font-weight: 600;
	letter-spacing: var(--ha-track-label);
	text-transform: uppercase;
	color: var(--ha-accent);
	white-space: nowrap;
}

/* Qualified by input type so it outranks GeneratePress's attribute-selector
   form styling, which otherwise paints a filled box here. */
input[type="search"].ha-az__filter-input {
	flex: 1 1 16rem;
	min-width: 0;
	padding: 0.35rem 0;
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-body);
	color: var(--ha-ink);
	background-color: transparent;
	border: 0;
	border-bottom: var(--ha-border-width) solid var(--ha-rule-strong);
	border-radius: var(--ha-radius);
	box-shadow: none;
	appearance: none;
}

input[type="search"].ha-az__filter-input:focus {
	outline: none;
	background-color: transparent;
	border-bottom-color: var(--ha-accent);
}

input[type="search"].ha-az__filter-input::placeholder {
	color: var(--ha-ink-soft);
	opacity: 1;
}

.ha-az__status {
	flex: 0 0 100%;
	margin: 0;
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-small);
	color: var(--ha-ink-soft);
}

.ha-az__status:empty {
	display: none;
}

.ha-az__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.15rem 0.5rem;
	margin-top: 0.7rem;
	padding: 0.55rem 0;
	border-top: var(--ha-border-width) solid var(--ha-rule);
}

.ha-az__nav-item {
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-label);
	font-weight: 600;
	letter-spacing: var(--ha-track-label);
	text-transform: uppercase;
	color: var(--ha-accent);
	text-decoration: none;
}

.ha-az__nav-item:hover,
.ha-az__nav-item:focus-visible {
	color: var(--ha-ink);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.ha-az__nav-item--empty {
	color: var(--ha-ink-soft);
	opacity: 0.35;
}

/* --- Letter groups ------------------------------------------------------- */

.ha-az__group {
	display: grid;
	grid-template-columns: 5.5rem minmax(0, 1fr);
	gap: var(--ha-gap-lg);
	padding: var(--ha-gap-lg) 0;
	border-bottom: var(--ha-border-width) solid var(--ha-rule);
	/* Anchor jumps land below the sticky rail rather than under it. */
	scroll-margin-top: 8rem;
}

.ha-az__group:last-child {
	border-bottom: 0;
}

.ha-az__letter {
	margin: 0;
	font-family: var(--ha-font-display);
	font-size: clamp(3rem, 6vw, 4.5rem);
	line-height: 0.85;
	font-weight: 500;
	color: var(--ha-accent);
}

.ha-az__count {
	margin: 0.5rem 0 0;
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-label);
	font-weight: 600;
	letter-spacing: var(--ha-track-label);
	color: var(--ha-ink-soft);
	font-variant-numeric: tabular-nums;
}

.ha-az__list {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: 4 13rem;
	column-gap: var(--ha-gap-lg);
}

.ha-az__item {
	break-inside: avoid;
	margin: 0 0 0.4rem;
}

.ha-az__link {
	font-family: var(--ha-font-body);
	font-size: var(--ha-size-body);
	line-height: 1.45;
	color: var(--ha-ink);
	text-decoration: none;
}

.ha-az__link:hover,
.ha-az__link:focus-visible {
	color: var(--ha-accent-deep);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.ha-az__note {
	margin-top: var(--ha-gap-lg);
	max-width: var(--ha-measure);
}

/* Filtering hides rows and whole groups; nothing animates. */
.ha-az__item[hidden],
.ha-az__group[hidden] {
	display: none;
}

/* --- Narrow -------------------------------------------------------------- */

@media (max-width: 47.9375em) {
	.ha-az__head {
		grid-template-columns: minmax(0, 1fr);
	}

	.ha-az__figure {
		grid-column: 1;
		grid-row: auto;
		text-align: left;
		margin-top: 0.5rem;
	}

	/* One photograph running full width, rather than three postage stamps. */
	.ha-az__recent {
		grid-template-columns: minmax(0, 1fr);
	}

	.ha-az__recent-item:nth-child(n+2) {
		display: none;
	}

	.ha-az__group {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.75rem;
		scroll-margin-top: 10rem;
	}

	.ha-az__marker {
		display: flex;
		align-items: baseline;
		gap: 0.75rem;
	}

	.ha-az__count {
		margin-top: 0;
	}

	.ha-az__list {
		columns: 2 9rem;
	}
}