/**
 * /advertise/
 *
 * Loaded for that page only, from afw-advertise.php in mu-plugins rather than
 * the theme's functions.php, which is written to by more than one process.
 * Theme tokens throughout (--space-*, --font-*, --afw-purple); no new scale.
 */

.c-adv {
	margin-top: var(--space-36, 36px);
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */

.c-adv__head {
	max-width: 820px;
	margin-bottom: var(--space-48, 48px);
}

.c-adv__eyebrow {
	margin: 0 0 var(--space-12, 12px);
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-0, 12px);
	letter-spacing: var(--font-letter-spacing-small, 1.2px);
	text-transform: uppercase;
	color: var(--afw-purple, #7C5CFC);
}

.c-adv__title {
	margin: 0;
	font-family: var(--font-family-serif);
	font-weight: 400;
	font-size: clamp(34px, 5vw, 52px);
	line-height: 1.08;
	letter-spacing: var(--font-letter-spacing-negative, -.5px);
	text-wrap: balance;
}

.c-adv__intro {
	margin: var(--space-20, 20px) 0 0;
	max-width: 64ch;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-3, 18px);
	line-height: 1.55;
	opacity: .85;
}

.c-adv__stats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-20, 20px) var(--space-48, 48px);
	margin: var(--space-32, 32px) 0 0;
	padding: var(--space-24, 24px) 0 0;
	border-top: 1px solid rgba(255, 255, 255, .1);
	list-style: none;
}

.c-adv__stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 22ch;
}

.c-adv__stat-n {
	font-family: var(--font-family-serif);
	font-size: var(--font-size-scale-6, 30px);
	line-height: 1;
}

.c-adv__stat-l {
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	line-height: 1.35;
	opacity: .6;
}

/*
 * The "no audience figure" paragraph. Given a rule and a little weight rather
 * than left as body copy: it is the claim on this page most likely to be the
 * reason someone trusts the rest of it.
 */
.c-adv__frank {
	margin: var(--space-24, 24px) 0 0;
	padding-left: var(--space-20, 20px);
	border-left: 2px solid var(--afw-purple, #7C5CFC);
	max-width: 62ch;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	line-height: 1.6;
	opacity: .85;
}

/* ------------------------------------------------------------------ *
 * Paired panels
 * ------------------------------------------------------------------ */

.c-adv__pair {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: var(--space-24, 24px);
	margin-bottom: var(--space-48, 48px);
}

.c-adv__panel {
	padding: var(--space-28, 28px);
	border-radius: var(--border-radius, 4px);
	background: rgba(255, 255, 255, .04);
}

.c-adv__panel--muted {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, .12);
}

.c-adv__panel-title {
	margin: 0 0 var(--space-16, 16px);
	font-family: var(--font-family-serif);
	font-weight: 400;
	font-size: var(--font-size-scale-5, 24px);
	line-height: 1.2;
}

/* ------------------------------------------------------------------ *
 * Lists
 * ------------------------------------------------------------------ */

.c-adv__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-12, 12px);
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	line-height: 1.55;
}

.c-adv__list li {
	position: relative;
	padding-left: var(--space-20, 20px);
	opacity: .85;
}

.c-adv__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .6em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: .45;
}

.c-adv__list--check li::before {
	/* A tick rather than a bullet, drawn with borders so it needs no icon file
	   and no font the strict CSP would have to allow. */
	top: .35em;
	width: 5px;
	height: 9px;
	border: solid var(--afw-purple, #7C5CFC);
	border-width: 0 2px 2px 0;
	border-radius: 0;
	background: none;
	opacity: 1;
	transform: rotate(45deg);
}

/* ------------------------------------------------------------------ *
 * Blocks
 * ------------------------------------------------------------------ */

.c-adv__block {
	margin-bottom: var(--space-48, 48px);
	/*
	 * No max-width on the block itself. The card grids inside it (placements,
	 * creative steps) should use the full column, or four steps wrap as
	 * three-plus-a-lonely-one. Readability is held by capping the PROSE
	 * instead, below, which is the thing that actually needs a measure.
	 */
}

.c-adv__block--rule {
	padding-top: var(--space-32, 32px);
	border-top: 1px solid rgba(255, 255, 255, .1);
}

.c-adv__block > p,
.c-adv__block > .c-adv__list {
	max-width: 68ch;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	line-height: 1.6;
	opacity: .85;
}

/* The theme flattens paragraph margins; two paragraphs of running text in a
   block need the gap back or they read as one. */
.c-adv__block > p + p {
	margin-top: var(--space-16, 16px);
}

.c-adv__h2 {
	margin: 0 0 var(--space-16, 16px);
	font-family: var(--font-family-serif);
	font-weight: 400;
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.15;
}

.c-adv__lede {
	margin: 0 0 var(--space-24, 24px);
}

/* ------------------------------------------------------------------ *
 * Placements
 * ------------------------------------------------------------------ */

.c-adv__slots {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--space-20, 20px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-adv__slot {
	display: flex;
	flex-direction: column;
	padding: var(--space-24, 24px);
	border-radius: var(--border-radius, 4px);
	background: rgba(255, 255, 255, .04);
}

.c-adv__slot-name {
	margin: 0 0 var(--space-8, 8px);
	font-family: var(--font-family-serif);
	font-weight: 400;
	font-size: var(--font-size-scale-4, 20px);
	line-height: 1.2;
}

.c-adv__slot-where {
	margin: 0 0 var(--space-20, 20px);
	flex: 1 1 auto;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	line-height: 1.55;
	opacity: .7;
}

.c-adv__spec {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-8, 8px) var(--space-24, 24px);
	margin: 0;
	padding-top: var(--space-16, 16px);
	border-top: 1px solid rgba(255, 255, 255, .1);
}

.c-adv__spec dt {
	margin: 0 0 2px;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-0, 12px);
	letter-spacing: var(--font-letter-spacing-small, 1.2px);
	text-transform: uppercase;
	opacity: .5;
}

.c-adv__spec dd {
	margin: 0;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ *
 * Numbered steps
 * ------------------------------------------------------------------ */

.c-adv__steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--space-24, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: afw-adv-step;
}

.c-adv__steps li {
	counter-increment: afw-adv-step;
	padding-top: var(--space-16, 16px);
	border-top: 1px solid rgba(255, 255, 255, .12);
}

.c-adv__steps li::before {
	content: counter(afw-adv-step, decimal-leading-zero);
	display: block;
	margin-bottom: var(--space-8, 8px);
	font-family: var(--font-family-serif);
	font-size: var(--font-size-scale-3, 18px);
	color: var(--afw-purple, #7C5CFC);
}

.c-adv__steps h3 {
	margin: 0 0 var(--space-8, 8px);
	font-family: var(--font-family-serif);
	font-weight: 400;
	font-size: var(--font-size-scale-4, 20px);
	line-height: 1.2;
}

.c-adv__steps p {
	margin: 0;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	line-height: 1.55;
	opacity: .75;
}

/* ------------------------------------------------------------------ *
 * Form
 * ------------------------------------------------------------------ */

.c-adv__alert {
	margin: 0 0 var(--space-24, 24px);
	padding: var(--space-16, 16px) var(--space-20, 20px);
	border-radius: var(--border-radius, 4px);
	border-left: 3px solid currentColor;
	background: rgba(255, 255, 255, .05);
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	line-height: 1.55;
	max-width: 68ch;
}

.c-adv__alert.is-ok {
	color: var(--afw-mint, #39D98A);
}

.c-adv__alert.is-error {
	color: #FF8A8A;
}

.c-adv__alert strong {
	display: block;
	margin-bottom: 2px;
}

.c-adv__form {
	max-width: 720px;
}

.c-adv__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--space-20, 20px);
}

.c-adv__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-8, 8px);
	margin: 0 0 var(--space-20, 20px);
}

.c-adv__field label,
.c-adv__fieldset legend {
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-0, 12px);
	letter-spacing: var(--font-letter-spacing-small, 1.2px);
	text-transform: uppercase;
	opacity: .6;
}

.c-adv__opt {
	text-transform: none;
	letter-spacing: 0;
	opacity: .7;
}

.c-adv__field input,
.c-adv__field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--border-radius, 4px);
	background: rgba(255, 255, 255, .04);
	color: inherit;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-2, 16px);
	line-height: 1.4;
}

.c-adv__field textarea {
	resize: vertical;
	min-height: 110px;
}

.c-adv__field input::placeholder,
.c-adv__field textarea::placeholder {
	color: inherit;
	opacity: .4;
}

.c-adv__field input:focus-visible,
.c-adv__field textarea:focus-visible {
	outline: 2px solid var(--afw-purple, #7C5CFC);
	outline-offset: 1px;
	border-color: transparent;
}

/*
 * Chrome paints its own near-white background on an autofilled field, which is
 * unreadable against inherited light text. There is no property to switch it
 * off; a very long inset shadow in the field's own colour is the only thing
 * that covers it, and -webkit-text-fill-color the only thing that restores the
 * text. Same fix as the ToneGrid forms.
 */
.c-adv__field input:-webkit-autofill,
.c-adv__field input:-webkit-autofill:hover,
.c-adv__field input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 1000px #1C1C1E inset;
	-webkit-text-fill-color: #FFF;
	caret-color: #FFF;
}

.c-adv__fieldset {
	margin: 0 0 var(--space-20, 20px);
	padding: 0;
	border: 0;
}

.c-adv__fieldset legend {
	padding: 0;
	margin-bottom: var(--space-12, 12px);
}

.c-adv__checks {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-8, 8px);
}

.c-adv__check {
	display: inline-flex;
	align-items: center;
	gap: var(--space-8, 8px);
	padding: 10px 14px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 999px;
	cursor: pointer;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	/* Overrides the uppercase label rule above: these read as options, not as
	   field names. */
	text-transform: none;
	letter-spacing: 0;
	opacity: 1;
	transition: border-color .15s ease, background-color .15s ease;
}

.c-adv__check:hover,
.c-adv__check:focus-within {
	border-color: var(--afw-purple, #7C5CFC);
}

.c-adv__check input {
	accent-color: var(--afw-purple, #7C5CFC);
	width: 16px;
	height: 16px;
	margin: 0;
}

.c-adv__check:has(input:checked) {
	border-color: var(--afw-purple, #7C5CFC);
	background: rgba(124, 92, 252, .16);
}

.c-adv__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-16, 16px);
	margin-top: var(--space-8, 8px);
}

.c-adv__actions-note {
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	opacity: .7;
}

.c-adv__actions-note a {
	color: var(--afw-purple, #7C5CFC);
}

/*
 * The honeypot. Moved off-screen rather than display:none, because a headless
 * browser filling "every visible field" still fills a field that is technically
 * painted, and a bot that trips this is told it succeeded.
 */
.c-adv__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------------ *
 * Foot
 * ------------------------------------------------------------------ */

.c-adv__foot {
	margin: 0;
	padding-top: var(--space-24, 24px);
	border-top: 1px solid rgba(255, 255, 255, .1);
	max-width: 68ch;
	font-family: var(--font-family-sansSerif);
	font-size: var(--font-size-scale-1, 14px);
	line-height: 1.6;
	opacity: .65;
}

.c-adv__foot a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

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

@media (max-width: 46.24em) {
	.c-adv__stats {
		gap: var(--space-16, 16px) var(--space-28, 28px);
	}

	.c-adv__panel {
		padding: var(--space-20, 20px);
	}

	.c-adv__row {
		/* One field per row. Two 240px minimums fit side by side on a 390px
		   viewport only by shrinking below the point where the labels read. */
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
}
