/* =============================================================================
   09-footer.css — site footer and the shared social icons

   Layout: a four-column grid — brand / For students / For employers / About —
   that becomes two columns at 1000px (the brand block spanning the full row)
   and one at 500px. Legal links sit in the bottom bar rather than a fifth
   column: it is where people look for them, and it keeps the four link
   columns evenly weighted.
   ============================================================================= */

footer {
	padding: 2.5rem 0 1.875rem;
	background-color: var(--js-beige);
	/* On <footer> rather than the grid, so the rule spans the whole window. */
	border-top: 1px solid #d9d2c6;
}

/* Row-gap is deliberately larger than column-gap: once the grid wraps, the vertical space is the only thing separating one block from the next. */
.footer_grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, 1fr);
	gap: 2.5rem 2rem;
	align-items: start;
	padding-bottom: 1rem;
}

/* --- Brand block ---------------------------------------------------------- */
.footer_logo {
	display: block;
	height: 30px;
	width: auto;
	margin: 0 0 1rem;
	/* The page's accent colour */
	color: var(--js-accent);
	overflow: visible;
}

.footer_logo path,
.footer_logo .st1 {
	fill: currentColor;
}

.footer_about p {
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--js-grey);
	margin: 0;
	max-width: 50ch;
}

/* --- Column headings ------------------------------------------------------ */
.footer_col h3 {
	font-size: 1.5rem;
	line-height: 1.25;
	margin: 0 0 0.75rem;
	color: var(--js-black);
}

.footer_col_title {
	font-family: var(--js-font-bold);
	font-size: 0.8125rem;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--js-grey);
	margin: 0 0 1rem;
}

/* "Contact" sits below the tagline rather than at the top of a column. */
.footer_about .footer_col_title {
	margin-top: 1.625rem;
}

/* --- Link lists ----------------------------------------------------------- */
.footer_links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer_links li {
	list-style: none;
	background-image: none;
	padding-left: 0;
	margin: 0 0 0.625rem;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.footer_links a {
	font-family: var(--js-font);
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--js-grey);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: all 0.15s ease-in-out;
}

.footer_links a:hover,
.footer_links a:focus-visible {
	color: var(--js-accent);
	border-bottom-color: var(--js-accent);
}

/* --- Bottom bar: copyright left, legal links right ------------------------ */
.footer_bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem 1.75rem;
	border-top: 1px solid #e4e0d9;
	padding-top: 1rem;
}

.footer_bottom p {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--js-grey);
}

.footer_legal {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Until any of the legal pages exist the <ul> renders empty; :empty stops it
   leaving a phantom gap in the flex row. */
.footer_legal:empty {
	display: none;
}

.footer_legal li {
	list-style: none;
	background-image: none;
	padding-left: 0;
	margin: 0;
}

.footer_legal a {
	font-size: 0.8125rem;
	color: var(--js-grey);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: all 0.15s ease-in-out;
}

.footer_legal a:hover,
.footer_legal a:focus-visible {
	color: var(--js-accent);
	border-bottom-color: var(--js-accent);
}

/* =============================================================================
   SOCIAL LINKS - .social_link is shared: the footer uses icon-only squares, other places use the labelled pill. 
   ============================================================================= */

.footer_contacts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 2rem;
	padding-bottom: 1rem;
}

.footer_contacts .footer_links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 2rem;
	min-width: 0;
}

.footer_contacts .footer_links li a {
	margin: 0;
	color: var(--js-accent);
}

.footer_contacts .footer_links li a:hover,
.footer_contacts .footer_links li a:focus-visible {
	color: var(--js-grey);
}

/* margin-left: auto pushes this item to the right edge */
.footer_contacts .footer_mailing {
	margin: 0 auto 0 0;
	padding: 0.5rem;
	flex: 0 0 auto;
	font-size: 0.8rem;
	color: var(--js-accent);
	background-color: var(--js-beige);
	border: 2px solid var(--js-accent);
	border-radius: 8px;
}

.footer_contacts .footer_mailing:hover,
.footer_contacts .footer_mailing:focus-visible {
	color: var(--js-grey);
	/* background-color: var(--js-grey); */
	border-color: var(--js-grey);
}

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

.footer_socials li {
	list-style: none;
	background-image: none;
	padding: 0;
	margin: 0;
}

.footer_socials a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	border: 2px solid currentColor;
	border-radius: 8px;
	color: var(--js-accent);
	font-size: 1rem;
	line-height: 1;
	text-decoration: none;
	transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.footer_socials a:hover,
.footer_socials a:focus-visible {
	color: var(--js-grey);
	background-color: var(--js-grey);
}

.footer_socials .socials_icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--js-accent);
	background-color: var(--js-beige);
	/* color: inherit; */
	line-height: 1;
}




/* =============================================================================
  THE PAGE ACCENT COLOUR
  Each page family has its own brand colour, and this is where a page says which one it is. 

  TO ADD A TEMPLATE: put its body class in whichever group below matches, or
  start a new group with both variables set. A template listed nowhere gets the
  default on body - it is not broken, just yellow.
   ============================================================================= */
body {
	--js-accent: var(--js-yellow);
	--js-accent-ink: var(--js-yellow-ink);
}

body.page-template-template_homepage,
body.page-template-template_agency,
body.page-template-template_signup {
	--js-accent: var(--js-purple);
	--js-accent-ink: var(--js-purple-ink);
}

body.page-template-template_employer,
body.page-template-template_about,
body.page-template-template_advice_and_resources {
	--js-accent: var(--js-blue);
	--js-accent-ink: var(--js-blue-ink);
}

body.page-template-template_contact {
	--js-accent: var(--js-yellow);
	--js-accent-ink: var(--js-yellow-ink);
}

body.page-template-template_events_workshops,
body.page-template-template_faq {
	--js-accent: var(--js-orange);
	--js-accent-ink: var(--js-orange-ink);
}

/* .st1 is the shape in the logo SVG that takes the accent colour. Kept as its
   own rule because the class is used by SVGs outside .footer_logo too. */
.st1 {
	fill: var(--js-accent);
}

/* ============================================================================= */

@media (max-width: 1000px) {
	/* Two columns, with the brand block spanning the whole row.
	   `grid-column: 1 / -1` is "first grid line to last", so it spans every
	   column however many there are. */
	.footer_grid {
		grid-template-columns: 1fr 1fr;
		gap: 2.25rem 1.875rem;
	}

	.footer_about {
		grid-column: 1 / -1;
	}

	footer svg {
		display: block;
	}
}

@media (max-width: 500px) {
	footer {
		padding: 2.8125rem 0 1.5625rem;
	}

	.footer_grid {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.footer_about p {
		max-width: none;
	}

	.footer_bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.875rem;
	}

	/* The button's margin-left: auto has nothing left to push against once the
	   row has wrapped, so it is dropped and the whole row goes full width. */
	.footer_contacts {
		gap: 1.25rem;
	}

	.footer_contacts .socials_mailing {
		margin-left: 0;
		width: 100%;
		justify-content: center;
	}
}
