/*
 * Site footer: the contact band that used to close the home page, at footer size,
 * then the newsletter band, then the thin black bar the agenda frames draw.
 *
 * The band's text is ink rather than the white the home page used. At footer size
 * white on sky measures 2.8:1, below the 4.5:1 that small text needs; ink measures
 * 7:1.
 *
 * The bar's #888 is drawn in the gray colour, which is lighter and keeps its small
 * text above 4.5:1 on black, where the meta colour would fall short.
 */

[class^="ageca-footer"] {
	box-sizing: border-box;
}

/*
 * Core spaces the top-level children of .wp-site-blocks by the block gap, which
 * would open a white stripe between the page and the footer.
 */
.wp-site-blocks > .ageca-footer-part {
	margin-block-start: 0;
}

/*
 * On a page shorter than the window, such as MailPoet's confirmation page in a tall
 * window, the footer ended where the content did and left white under it. The page
 * column now fills the window and the main area takes the spare height, so the
 * footer sits on the window's bottom edge. Measured on every template before this
 * went in: pages taller than the window do not move.
 */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

.ageca-footer {
	--ageca-footer-inset: clamp(1rem, 0.5rem + 2vw, 2rem);
}

/* ------------------------------------------------------------ contact band */

.ageca-footer__main {
	padding: 2.5rem var(--ageca-footer-inset);
	background-color: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--ink);
}

.ageca-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	max-width: 80rem;
	margin: 0 auto;
}

@media (min-width: 700px) {

	.ageca-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/*
 * The map's track is sized explicitly. An auto track beside an image whose width
 * is a percentage resolves circularly and collapses the text columns.
 */
@media (min-width: 1000px) {

	.ageca-footer__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 16rem;
		align-items: start;
	}
}

.ageca-footer__tag {
	display: inline-block;
	margin: 0 0 0.75rem;
	padding: 0.25rem 0.625rem;
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--meta);
	letter-spacing: 0.1em;
	line-height: 1.5;
	text-transform: uppercase;
}

/* Bold, so it stands out from the hours without being a second label. */
.ageca-footer__note {
	margin: 0;
	font-size: var(--wp--preset--font-size--body);
	font-weight: 700;
	line-height: 1.5;
}

/* Set well apart from the hours, so it does not read as one more line of them. */
.ageca-footer__hours + .ageca-footer__note {
	margin-top: 2rem;
}

.ageca-footer__lines {
	font-style: normal;
}

.ageca-footer__lines p,
.ageca-footer__hours {
	margin: 0 0 0.25rem;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.5;
	overflow-wrap: break-word;
}

.ageca-footer__lines a {
	color: inherit;
	text-decoration: none;
}

.ageca-footer__lines a:hover,
.ageca-footer__lines a:focus-visible {
	text-decoration: underline;
}

.ageca-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.ageca-footer__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	transition: background-color 150ms ease, color 150ms ease;
}

.ageca-footer__social-link:hover,
.ageca-footer__social-link:focus-visible {
	background-color: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--ink);
}

.ageca-footer__social-link svg {
	width: 1.125rem;
	height: 1.125rem;
}

.ageca-footer__map {
	display: block;
	max-width: 20rem;
	border: 3px solid var(--wp--preset--color--yellow);
}

.ageca-footer__map-img {
	display: block;
	width: 100%;
	height: auto;
}

/* --------------------------------------------------------- newsletter band */

.ageca-footer__news {
	padding: 1.5rem var(--ageca-footer-inset);
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}

.ageca-footer__news-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	margin: 0 auto;
}

.ageca-footer__news-title {
	margin: 0;
	font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.5rem);
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ageca-footer__news-text {
	margin: 0.25rem 0 0;
	font-size: var(--wp--preset--font-size--body-small);
	font-weight: 300;
	line-height: 1.5;
}

/* Empty until a sign-up comes back, and then says how it went. */
.ageca-footer__news-status {
	margin: 0.5rem 0 0;
	font-size: var(--wp--preset--font-size--body-small);
	font-weight: 600;
	line-height: 1.5;
}

.ageca-footer__news-status:empty {
	display: none;
}

/* The robot trap: present for robots, off screen for people. */
.ageca-footer__news-trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/*
 * The button sits against the field's right edge and shares its border, so the pair
 * must not break across two lines: wrapped, the button's missing left border shows
 * as a gap under the field. The field absorbs the width instead.
 */
.ageca-footer__news-form {
	display: flex;
	flex-wrap: nowrap;

	/*
	 * The form is itself a flex item of the band, where min-width defaults to auto and
	 * would hold it at the field's intrinsic width plus the button. On a 320px screen
	 * that is wider than the screen, and the page scrolls sideways.
	 */
	min-width: 0;
}

.ageca-footer__news-input {
	/* 15rem where there is room, whatever the button leaves where there is not. */
	flex: 1 1 15rem;
	min-width: 0;
	padding: 0.625rem 1rem;
	border: 1px solid var(--wp--preset--color--ink);
	border-radius: 0;
	background-color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--body-small);
	transition: border-color 150ms ease;
}

/*
 * No focus ring, which sat outside the field and broke the join with the button.
 * The border takes the focus instead, so the field is still visibly focused for
 * anyone arriving by keyboard rather than losing the state altogether.
 */
.ageca-footer__news-input:focus,
.ageca-footer__news-input:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--navy);
}

.ageca-footer__news-btn {
	flex: 0 0 auto;
	padding: 0.625rem 1.5rem;
	border: 1px solid var(--wp--preset--color--ink);
	border-left: 0;
	border-radius: 0;
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--yellow);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 900;
	letter-spacing: 0.167em;
	line-height: 1.5;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

.ageca-footer__news-btn:hover,
.ageca-footer__news-btn:focus-visible {
	background-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

/* --------------------------------------------------------------- black bar */

.ageca-footer__bar {
	padding: 1rem var(--ageca-footer-inset);
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--gray);
}

.ageca-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 2rem;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	margin: 0 auto;
}

.ageca-footer__home {
	display: inline-flex;
	color: inherit;
	text-decoration: none;
}

/* Any logo becomes a white silhouette, then dims to the bar's grey. */
.ageca-footer__logo {
	display: block;
	width: auto;
	height: 1.5rem;
	filter: brightness(0) invert(1);
	opacity: 0.6;
}

.ageca-footer__name {
	font-weight: 900;
	letter-spacing: -0.02em;
}

.ageca-footer__mention {
	margin: 0;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 300;
	letter-spacing: 0.025em;
	line-height: 1.33;
}

.ageca-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ageca-footer__link {
	color: inherit;
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 700;
	letter-spacing: 0.025em;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 150ms ease;
}

/* The Cookies entry is a button, which carries its own box and font. */
button.ageca-footer__link {
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	cursor: pointer;
}

.ageca-footer__link:hover,
.ageca-footer__link:focus-visible {
	color: var(--wp--preset--color--white);
}

/*
 * On a phone the band stacks into one column, where a full-width map alone would
 * make the footer taller than a screen. The map is capped smaller and the spacing
 * tightened to keep the whole footer under one screen's height.
 */
@media (max-width: 699px) {

	.ageca-footer__main {
		padding-block: 2rem;
	}

	.ageca-footer__grid {
		gap: 1.5rem;
	}

	.ageca-footer__map {
		max-width: 13rem;
	}

	.ageca-footer__bar {
		padding-block: 1rem;
	}

	.ageca-footer__inner {
		flex-direction: column;
		gap: 0.5rem;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ageca-footer__social-link,
	.ageca-footer__news-input,
	.ageca-footer__news-btn,
	.ageca-footer__link {
		transition: none;
	}
}
