/**
 * March AC relay board.
 *
 * Same palette and the same shapes as the membership form, so the two do not
 * look like they came from different websites. Colours come from the theme
 * where it defines them, with the approved design's values as fallbacks.
 *
 * The board itself is two columns on a desktop and one on a phone, which is
 * where most people will look at it — standing in a car park after a Sunday
 * run, deciding whether to put their name down.
 */

.macr {
	--macr-ink: var(--wp--preset--color--ink, #0e1424);
	--macr-navy: var(--wp--preset--color--navy, #1f3864);
	--macr-accent: var(--wp--preset--color--accent, #1428e0);
	--macr-border: var(--wp--preset--color--border, #dde2ee);
	--macr-muted: var(--wp--preset--color--muted, #55607a);
	--macr-surface: var(--wp--preset--color--surface, #ffffff);
	--macr-tint: var(--wp--preset--color--tint, #f4f6fb);
	--macr-ok: var(--wp--preset--color--success, #0f7a4a);
	--macr-warn: var(--wp--preset--color--warning, #a15c00);
	--macr-alert: var(--wp--preset--color--alert, #a4142f);

	color: var(--macr-ink);
	margin-inline: auto;
}

.macr:not(.macr-board) {
	max-width: 46rem;
}

.macr-board {
	max-width: 68rem;
}

/* Honeypot: off-screen rather than display:none, because some bots skip
   hidden fields but not positioned ones. */
.macr-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Forms
 * ---------------------------------------------------------------------- */

.macr-section {
	border: 1px solid var(--macr-border);
	border-radius: 3px;
	background: var(--macr-surface);
	padding: 1.5rem;
	margin: 0 0 1.5rem;
}

.macr-section > legend {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.875rem;
	padding-inline: 0.5rem;
	color: var(--macr-navy);
}

.macr-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0 0 1.1rem;
}

.macr-field > label {
	font-weight: 600;
	font-size: 0.95rem;
}

.macr-field input[type="text"],
.macr-field input[type="email"],
.macr-field select,
.macr-field textarea {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--macr-border);
	border-radius: 3px;
	background: var(--macr-surface);
	color: inherit;
	font: inherit;
}

.macr-field input:focus-visible,
.macr-field select:focus-visible,
.macr-field textarea:focus-visible,
.macr button:focus-visible,
.macr summary:focus-visible {
	outline: 2px solid var(--macr-accent);
	outline-offset: 2px;
}

.macr-hint {
	font-size: 0.85rem;
	color: var(--macr-muted);
}

.macr-hint--block {
	display: block;
	margin: 0 0 1rem;
}

.macr-req {
	color: var(--macr-alert);
}

/* The checkbox and its text sit on one line with the box aligned to the first
   line of the label, not the middle of a wrapped paragraph. Matches both
   shapes: a .macr-check wrapping a label, and a label.macr-check. */
.macr-check,
.macr-radio,
.macr-check label,
.macr-radio label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0 0 0.6rem;
	font-size: 0.95rem;
	line-height: 1.45;
	cursor: pointer;
}

.macr-check input,
.macr-radio input {
	flex: 0 0 auto;
	margin-top: 0.22em;
}

.macr-check em,
.macr-radio em {
	color: var(--macr-muted);
	font-style: normal;
}

.macr-submit {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1.5rem 0 0;
}

.macr button[type="submit"],
.macr .macr-danger {
	align-self: flex-start;
	padding: 0.8rem 1.6rem;
	border: 0;
	border-radius: 3px;
	background: var(--macr-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.macr button[type="submit"]:hover,
.macr .macr-danger:hover {
	filter: brightness(1.12);
}

.macr .macr-danger {
	background: transparent;
	color: var(--macr-alert);
	border: 1px solid var(--macr-alert);
	padding: 0.55rem 1.1rem;
	font-weight: 600;
}

.macr .macr-danger:hover {
	background: var(--macr-alert);
	color: #fff;
	filter: none;
}

/* -------------------------------------------------------------------------
 * Notices
 * ---------------------------------------------------------------------- */

.macr-notice {
	border: 1px solid var(--macr-border);
	border-left-width: 4px;
	border-radius: 3px;
	background: var(--macr-tint);
	padding: 1.1rem 1.25rem;
	margin: 0 0 1.5rem;
}

.macr-notice h3 {
	margin: 0 0 0.4rem;
	font-size: 1.05rem;
}

.macr-notice p:last-child,
.macr-notice ul:last-child {
	margin-bottom: 0;
}

.macr-notice--ok {
	border-left-color: var(--macr-ok);
}

.macr-notice--warn {
	border-left-color: var(--macr-warn);
}

.macr-notice--error {
	border-left-color: var(--macr-alert);
}

.macr-notice--manage {
	border-left-color: var(--macr-navy);
}

/* -------------------------------------------------------------------------
 * The board
 * ---------------------------------------------------------------------- */

.macr-board__head {
	border-bottom: 2px solid var(--macr-border);
	padding-bottom: 0.9rem;
	margin-bottom: 1.5rem;
}

.macr-board__kicker {
	margin: 0 0 0.3rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.8rem;
	color: var(--macr-navy);
}

.macr-board__state {
	margin: 0;
	color: var(--macr-muted);
	font-size: 0.95rem;
}

.macr-board__state--closed {
	color: var(--macr-warn);
	font-weight: 600;
}

.macr-board__cols {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 48rem) {
	.macr-board__cols {
		grid-template-columns: 1fr 1fr;
	}
}

.macr-col__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

.macr-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	background: var(--macr-navy);
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.macr-empty {
	color: var(--macr-muted);
	font-style: italic;
}

.macr-card {
	border: 1px solid var(--macr-border);
	border-radius: 3px;
	background: var(--macr-surface);
	padding: 1.1rem 1.25rem;
	margin: 0 0 1rem;
}

.macr-card__title {
	margin: 0 0 0.2rem;
	font-size: 1.05rem;
}

.macr-card__meta {
	margin: 0 0 0.8rem;
	font-size: 0.85rem;
	color: var(--macr-muted);
}

.macr-card__notes {
	margin: 0.8rem 0 0;
	padding-top: 0.8rem;
	border-top: 1px dashed var(--macr-border);
	font-size: 0.9rem;
	color: var(--macr-muted);
}

/* Legs within a team card */
.macr-legs {
	list-style: none;
	margin: 0;
	padding: 0;
}

.macr-leg {
	display: flex;
	gap: 0.75rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--macr-border);
	font-size: 0.95rem;
}

.macr-leg:last-child {
	border-bottom: 0;
}

.macr-leg__n {
	flex: 0 0 5.5rem;
	font-weight: 600;
	color: var(--macr-navy);
}

.macr-leg__who {
	color: var(--macr-ink);
}

.macr-leg--open .macr-leg__who {
	color: var(--macr-accent);
	font-weight: 600;
}

/* Which legs a runner ticked */
.macr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.macr-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	border: 1px solid var(--macr-border);
	border-radius: 3px;
	background: var(--macr-tint);
	color: var(--macr-muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.macr-chip--on {
	border-color: var(--macr-accent);
	background: var(--macr-accent);
	color: #fff;
}

/* Claim a leg */
.macr-claim {
	margin-top: 1rem;
	border-top: 1px solid var(--macr-border);
	padding-top: 0.8rem;
}

.macr-claim > summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--macr-accent);
	font-size: 0.95rem;
}

.macr-claim[open] > summary {
	margin-bottom: 1rem;
}

.macr-claim .macr-submit {
	margin-top: 1rem;
}

.macr-withdraw {
	margin-top: 1rem;
}

.macr-board__foot {
	margin-top: 2rem;
	padding-top: 1.2rem;
	border-top: 2px solid var(--macr-border);
	font-size: 0.95rem;
}

@media (prefers-reduced-motion: no-preference) {
	.macr button,
	.macr-chip {
		transition: background-color 120ms ease, color 120ms ease, filter 120ms ease;
	}
}

/* -------------------------------------------------------------------------
 * "Lost your link?"
 *
 * Deliberately quieter than the forms above it. Somebody who needs this is
 * looking for it; nobody else should have their eye drawn away from putting
 * their name down.
 * ---------------------------------------------------------------------- */

.macr-resend {
	margin-top: 2rem;
}

.macr-resend__box {
	border: 1px solid var(--macr-border);
	border-radius: 6px;
	padding: 0.9rem 1.1rem;
	background: var(--macr-tint);
}

.macr-resend__box > summary {
	font-weight: 600;
	color: var(--macr-navy);
	cursor: pointer;
}

.macr-resend__box[open] > summary {
	margin-bottom: 0.9rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--macr-border);
}

.macr-resend__box p {
	font-size: 0.95rem;
	color: var(--macr-muted);
}

.macr-resend__box form {
	margin-top: 1rem;
}
