/*
 * Site footer (core/group, the footer's root): the look every footer shares. Layout, padding, widths, colours, type and
 * gaps stay block settings: the root's padding, the Footer content group's alignment (the width: Full, capped at the
 * frame; Wide; none = content width), the top row's core/columns (brand column width, gaps, the line under it as a bottom border), the address columns' grid
 * group (Columns, block spacing) and the rows of core/icon + text.
 * - a light shade at the top, drawn over the page colour (7.5rem);
 * - the top row stacks under 64rem (core stacks core/columns at 782px); "Stack on mobile" off keeps the row;
 * - the address columns (the grid group in the top row): a 1px border-colour line between them, as far from the next
 *   column's text as the grid's column spacing; under 37.5rem they stack with the line on top;
 * - row icons keep their size beside wrapping text;
 * - social icons 18px while no Icon size is chosen; social and menu links turn the contrast colour on hover.
 * Loaded only on pages where a group uses the style (inc/rt-block-styles.php).
 */
.is-style-site-footer {
	--rt-footer-divider-space: 3.0625rem;
	position: relative;
}

/* The Footer content group's Full alignment stops at the site frame, like the header row; core's constrained layout
   gives a full child max-width none */
.is-style-site-footer.is-layout-constrained > .alignfull {
	max-width: var(--wp--custom--layout--frame);
	margin-inline: auto;
}

.is-style-site-footer::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 7.5rem;
	background: linear-gradient(color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent), transparent);
	pointer-events: none;
}

/* Address columns: the line after each column's text, then as much room again before the next one */
.is-style-site-footer > .wp-block-group > .wp-block-columns .wp-block-group-is-layout-grid > * + * {
	padding-inline-start: var(--rt-footer-divider-space);
	border-inline-start: 1px solid var(--wp--preset--color--line);
}

/* Row icons: the text beside them wraps, the icon keeps its width (its Width setting stays in charge) */
.is-style-site-footer .wp-block-group-is-layout-flex > .wp-block-icon {
	flex-shrink: 0;
}

/* The site title in the footer's text colour; its Link colour setting wins */
:where(.is-style-site-footer .wp-block-site-title a) {
	color: inherit;
}

.is-style-site-footer .wp-block-social-links:not([class*="-icon-size"]) {
	font-size: 1.125rem;
}

.is-style-site-footer .wp-block-social-links .wp-social-link,
.is-style-site-footer .wp-block-navigation a {
	transition: color 0.2s ease;
}

.is-style-site-footer .wp-block-social-links .wp-social-link:hover,
.is-style-site-footer .wp-block-navigation a:hover,
.is-style-site-footer .wp-block-navigation a:focus-visible {
	color: var(--wp--preset--color--contrast) !important;
	text-decoration: none;
}

/* Tablets: the brand above the address columns */
@media (max-width: 64rem) {
	.is-style-site-footer > .wp-block-group > .wp-block-columns:not(.is-not-stacked-on-mobile) {
		flex-direction: column;
	}

	.is-style-site-footer > .wp-block-group > .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: auto !important;
		width: 100%;
	}
}

/* Phones: the address columns stack, the line on top of each after the first */
@media (max-width: 37.5rem) {
	.is-style-site-footer > .wp-block-group > .wp-block-columns .wp-block-group-is-layout-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.is-style-site-footer > .wp-block-group > .wp-block-columns .wp-block-group-is-layout-grid > * + * {
		padding-top: var(--wp--preset--spacing--40);
		padding-inline-start: 0;
		border-inline-start: 0;
		border-top: 1px solid var(--wp--preset--color--line);
	}
}
