/* ==========================================================================
   site.css — site-wide overrides. Loads on EVERY page, in both the 'legacy'
   and 'redesign' header branches, after main.css and before redesign.css.

   Anything shared by all 13 pages belongs here, NOT in redesign.css, which is
   homepage-only. main.css is third-party and must not be edited, so every rule
   below wins on specificity rather than !important:

     main.css   #footer .links > div                 -> (1,1,1)
     main.css   #footer .links > div:nth-child(...)   -> (1,2,1)
     site.css   body #footer .links > div             -> (1,1,2)
     site.css   body #footer .links > div:first-child -> (1,2,2)

   The leading `body` adds one type selector, so (1,1,2) beats (1,1,1) and
   (1,2,2) beats (1,2,1). No !important anywhere in this file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Footer: three even columns.

   main.css hard-codes a four-column footer -- width: 25% plus divider
   selectors cut on multiples of four (:nth-child(4n - 3), :nth-child(-n + 4)).
   The Calculator column has been removed, so the width and both divider
   selectors are re-cut for three columns here.

   Divider treatment is preserved exactly as Altitude had it: a 1px
   rgba(255,255,255,0.25) left border on every column except the first, so
   rules sit BETWEEN columns only and never on the outer edges.
   -------------------------------------------------------------------------- */

body #footer .links > div {
	width: 33.3333%;
}

body #footer .links > div:not(:first-child) {
	border-left-width: 1px;
}

body #footer .links > div:first-child {
	border-left-width: 0;
}

/* Single row, so no horizontal rules above any column. */
body #footer .links > div:nth-child(-n + 3) {
	border-top-width: 0;
}

/* main.css drops to two-up here (width: 50%), which would leave the third
   column orphaned on its own row. Hold three even columns instead. */
@media screen and (max-width: 980px) {

	body #footer .links > div {
		width: 33.3333%;
	}

	body #footer .links > div:not(:first-child) {
		border-left-width: 1px;
	}

	body #footer .links > div:first-child {
		border-left-width: 0;
	}

	body #footer .links > div:nth-child(-n + 3) {
		border-top-width: 0;
	}

}

/* Stacking below 480px is Altitude's original behaviour and is preserved:
   full-width columns, no vertical rules, a horizontal rule between each
   stacked block and none above the first. */
@media screen and (max-width: 480px) {

	body #footer .links > div {
		width: 100%;
	}

	body #footer .links > div:not(:first-child) {
		border-left-width: 0;
		border-top-width: 1px;
	}

	body #footer .links > div:first-child {
		border-top-width: 0;
	}

}
