/**
 * The site footer.
 *
 * Figma: Pacific College Library, page "Footer"
 *   wide    node 6095:2679  1440 x 564.07  five columns across
 *   middle  node 6095:3040   768 x 764.45  campuses in a row, then four columns
 *   narrow  node 6095:2680   390 x 1214.45 everything stacked, links two abreast
 *
 * Three bands, the same three the header uses: 1200 and up, 768 to 1199, and
 * below 768.
 *
 * The campus block and the four link columns are one row on a wide screen and
 * separate rows below it, so the whole footer is two nested flex containers
 * rather than a grid - the pieces change which axis they are on, which is
 * exactly what flex-direction is for.
 */

.pchs-footer {
	/* Roboto, like the rest of the navigation furniture. */
	font-family: var(--wp--preset--font-family--navigation);
	color: var(--wp--preset--color--white);
}


/* ------------------------------------------------------------
   The top band: logotype and social links
   Figma node 6095:2028.
   ------------------------------------------------------------ */

.pchs-footer__top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--wp--preset--spacing--20); /* 20px */
	padding: var(--wp--preset--spacing--20);
	border-bottom: 1px solid var(--wp--preset--color--blue-800);
	background-color: var(--wp--preset--color--blue-500);
}

.pchs-footer__logo {
	display: flex;
	max-width: 280px;
}

.pchs-footer__logo-image {
	width: 100%;
	height: auto;
}

/*
 * The icons are 40, not the 44 they are drawn at. Four of the five sit 2px
 * inside a 44 box in the frame and the fifth fills it, which makes the row 44
 * tall and the fifth icon visibly larger than its neighbours. 40 for all five
 * is what the frame is laid out on, and it is what the row measures.
 */
.pchs-footer .pchs-social {
	gap: var(--wp--preset--spacing--20); /* 20px */
}

.pchs-footer .pchs-social__icon {
	width: 40px;
	height: 40px;
}


/* ------------------------------------------------------------
   The bottom band
   Figma node 6095:2035.

   A left-to-right gradient through three of the blues, rather
   than the flat colour above it. Measured off the frame: it is
   Blue 300 at the left edge, Blue 500 exactly halfway, and Blue
   800 at the right.
   ------------------------------------------------------------ */

.pchs-footer__btm {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40); /* 40px */
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--20);
	background-image: linear-gradient(
		90deg,
		var(--wp--preset--color--blue-300) 0%,
		var(--wp--preset--color--blue-500) 50%,
		var(--wp--preset--color--blue-800) 100%
	);
}

.pchs-footer__main {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40); /* 40px */
}


/* The campuses, and the address under the first of them. */

.pchs-footer__campus {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20); /* 20px */
}

.pchs-footer__address {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--4); /* 4px: it belongs to the link above it */
}

/*
 * The one place in the footer that is not Roboto. Figma's Body/Large-Light:
 * Work Sans 300 at 20px, and the lines sit a long way apart - 24px between
 * them, on top of a line height of 1.5.
 */
.pchs-footer__address-lines {
	font-family: var(--wp--preset--font-family--body);

	/*
	 * 16 here and 20 on a wide screen. The generated code reports 20 at
	 * every width, because it prints the token's default rather than the
	 * size the frame overrides it with - but the frames give this block 120
	 * at 768 and 390 and 138 at 1440, and only 16 and 20 produce those two
	 * numbers against a line height of 1.5 and 24px between the lines.
	 */
	font-size: var(--wp--preset--font-size--md); /* 16px */
	font-weight: 300;
	line-height: 1.5;
	letter-spacing: var(--wp--custom--tracking--tight); /* -0.02em */
}

.pchs-footer__address-lines p {
	margin: 0 0 var(--wp--preset--spacing--24); /* 24px */
}

.pchs-footer__address-lines p:last-child {
	margin-bottom: 0;
}


/* The four columns of links. */

.pchs-footer__columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--wp--preset--spacing--20); /* 20px */
	row-gap: var(--wp--preset--spacing--40); /* 40px */
}

.pchs-footer__column {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20); /* 20px, heading included */
}

/* Figma node 6095:2045: 14px bold, uppercase, widely spaced. */
.pchs-footer__heading {
	margin: 0;
	color: inherit;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--sm); /* 14px */
	font-weight: 700;
	line-height: 14px; /* 14 x 1; the frames lay it out on 14 */
	letter-spacing: var(--wp--custom--tracking--wide); /* 0.08em */
	text-transform: uppercase;
}

.pchs-footer__list {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20); /* 20px: links on a 40px pitch */
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * Every link in the footer is underlined already - this is a wall of links on
 * a dark colour, and the underline is what separates them from the words
 * around them rather than a hover state. Hovering lifts them to the pale
 * blue instead.
 */
.pchs-footer__link {
	/*
	 * A block, so that the list item is exactly as tall as the link. Left
	 * inline, the item's line box is the taller of the two line heights -
	 * the page's 1.5 rather than the link's 20px - and every row comes out
	 * 44 instead of 40, which is four pixels per link down the whole column.
	 */
	display: block;
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--md); /* 16px */
	font-weight: 500;
	line-height: 20px; /* 16 x 1.24, laid out on 20 */
	text-decoration: underline;
	text-underline-position: from-font;
	transition: color 0.2s ease;
}

.pchs-footer__link:hover,
.pchs-footer__link:focus-visible {
	color: var(--wp--preset--color--gray-900);
}


/* Copyright, the legal links, and the accreditation notice. */

.pchs-footer__legal {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--12); /* 12px */
}

.pchs-footer__legal-row {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--12); /* 12px */
}

.pchs-footer__copyright,
.pchs-footer__accreditation {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--xs); /* 12px */
	font-weight: 400;
	line-height: 1.32;
}

.pchs-footer__accreditation a {
	color: inherit;
	text-decoration: underline;
	text-underline-position: from-font;
}

.pchs-footer__legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--12); /* 12px */
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Smaller and bolder than the links above - Figma node 6095:2068. */
.pchs-footer__legal-links .pchs-footer__link {
	font-size: var(--wp--preset--font-size--xs); /* 12px */
	font-weight: 700;
	line-height: 14px;
	letter-spacing: var(--wp--custom--tracking--label); /* 0.02em */
}


/* ------------------------------------------------------------
   768px and up
   Figma node 6095:3040.

   The top band spreads out, the campuses become a row of three,
   and the links become four columns.
   ------------------------------------------------------------ */

@media (min-width: 768px) {

	.pchs-footer__top {
		flex-direction: row;
		justify-content: space-between;
	}

	.pchs-footer__btm {
		padding-inline: var(--wp--preset--spacing--40); /* 40px */
	}

	/* 64 between the campuses and the links, where the narrow layout uses
	   40 - the campuses are a row here rather than a column, and the frame
	   gives that row more air beneath it. */
	.pchs-footer__main {
		gap: var(--wp--preset--spacing--64);
	}

	.pchs-footer__campus {
		flex-direction: row;
		gap: var(--wp--preset--spacing--40); /* 40px */
	}

	/*
	 * Three equal columns. The address is the only one of the three with
	 * anything under it, so without this the other two would be as narrow as
	 * their own words and the row would bunch to the left.
	 */
	.pchs-footer__campus > * {
		flex: 1 1 0;
		min-width: 0;
	}

	.pchs-footer__columns {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}


/* ------------------------------------------------------------
   1200px and up
   Figma node 6095:2679.

   The campuses go back to a column and move alongside the links
   rather than above them, so the whole thing is one row of five.
   ------------------------------------------------------------ */

@media (min-width: 1200px) {

	.pchs-footer__top {
		padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--64); /* 40/64 */
	}

	.pchs-footer__logo {
		max-width: 400px;
	}

	.pchs-footer__btm {
		padding-inline: var(--wp--preset--spacing--64); /* 64px */
	}

	/*
	 * No gap. Below this width the campus block sits ABOVE the links and the
	 * 40 separates them; here it sits beside them, and the separation is the
	 * 20 of padding inside its own 320, exactly as the frame divides up its
	 * 1312. Leaving the gap in pushes every column 40px right.
	 */
	.pchs-footer__main {
		flex-direction: row;
		gap: 0;
	}

	/* 320 of the 1312, with the last 20 of it kept clear of the links. */
	.pchs-footer__campus {
		width: 320px;
		flex: 0 0 320px;
		flex-direction: column;
		gap: var(--wp--preset--spacing--20);
		padding-right: var(--wp--preset--spacing--20);

		/*
		 * The frame declares this column 232 tall while its own children add
		 * up to 242 - the last link hangs 10px below the box that holds it.
		 * Everything underneath is then positioned from the 232, so the small
		 * print sits 10px higher than the 40px gap below this column implies.
		 *
		 * Reported 10px short here, so the row this sits in measures what the
		 * frame measured. The link still draws where it belongs; the 10 comes
		 * out of the 40 below, which has room for it.
		 *
		 * This rather than a 30px gap, which would come to the same thing
		 * today and the wrong thing the moment a link column grew taller than
		 * this one - the gap is only short because THIS column over-runs.
		 */
		margin-bottom: -10px;
	}

	.pchs-footer__campus > * {
		flex: 0 1 auto;
	}

	.pchs-footer__address-lines {
		font-size: var(--wp--preset--font-size--lg); /* 20px */
	}

	/*
	 * The four columns are as wide as their own words and spread across what
	 * is left, which is why the gaps between them are equal but not round:
	 * 108.67 at 1440. A grid of four equal columns would line their headings
	 * up differently from the frame.
	 */
	.pchs-footer__columns {
		display: flex;
		min-width: 0;
		flex: 1 1 auto;
		justify-content: space-between;
		align-items: flex-start;
		gap: var(--wp--preset--spacing--20);
	}

	/* Copyright on the left, the legal links against the right-hand edge. */
	.pchs-footer__legal-row {
		flex-direction: row;
		align-items: flex-start;
	}

	.pchs-footer__copyright {
		flex: 1 1 0;
		min-width: 0;
	}

	.pchs-footer__legal-links {
		flex: 1 1 0;
		justify-content: flex-end;
		min-width: 0;
		gap: var(--wp--preset--spacing--20); /* 20px, wider than below */
	}
}
