/** General **/
:root {
	--white: #ffffff;
	--blue: #1b2c58;
	--red: #663333;
	--black: #000000;
	--near-black: #1e1e1e;
	--grey: #d1d9e2;
	--max-width: 1400px;
	--main-gutter-x: 1em;
	--main-gutter-y: 2em;
	--ring-inner-width: 2px;
	--ring-gap: 2px;
	--ring-outer-width: 2px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--background-color: var(--near-black);
		--focus-bg: var(--near-black);
		--border-color: var(--white);
		--button-border: var(--white);
		--color: var(--white);
		--hover-background: var(--white);
		--hover-color: var(--blue);
		--ring-inner-color: var(--white);
		--ring-outer-color: var(--red);
	}
}

@media (prefers-color-scheme: light) {
	:root {
		--background-color: var(--grey);
		--focus-bg: var(--white);
		--border-color: var(--blue);
		--button-border: var(--black);
		--color: var(--black);
		--hover-background: var(--blue);
		--hover-color: var(--white);
		--ring-inner-color: var(--blue);
		--ring-outer-color: var(--red);
	}
}

@font-face {
	font-family: "Atkinson Hyperlegible";
	src: url("/AtkinsonHyperlegible-Regular.woff2");
}

html {
	line-height: 1.5;
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--background-color);
	color: var(--color);
	font-family: "Atkinson Hyperlegible", sans-serif;
	font-size: 18pt;
}

.container {
	padding: 0 var(--main-gutter-x);
}

/** For screen reader text **/
.visually-hidden {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.img-wrapper {
	display: flex;
	justify-content: center;
	padding-bottom: 1em;
}

img {
	max-width: 100%;
}

a {
	color: inherit;
	text-decoration: underline;
	text-underline-position: under;
}

a:focus-visible,
a:hover {
	text-decoration: none;
	box-shadow:
		0 0 0 var(--ring-inner-width) var(--ring-inner-color),
		0 0 0 calc(var(--ring-inner-width) + var(--ring-gap)) var(--focus-bg),
		0 0 0
			calc(var(--ring-inner-width) + var(--ring-gap) + var(--ring-outer-width))
			var(--ring-outer-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	clear: both;
	font-weight: 600;
}

h2 {
	font-size: 1.5em;
}

h3 {
	font-size: 1.2em;
	line-height: 34px;
	letter-spacing: -0.1px;
	margin-top: 36px;
	margin-bottom: 12px;
}

p {
	margin-top: 0;
	margin-bottom: 1.1em;
}

/** Button Links **/

p.button {
	display: flex;
	justify-content: center;
}

p.button a {
	border: 1px solid var(--border-color);
	border-radius: 5px;
	background-color: var(--blue);
	color: var(--white);
	padding: 10px;
}

p.button a:is(:hover, :focus) {
	background-color: var(--red);
}

/** Header **/

/** flex-direction is reversed so the nav shows up first visually but is still under the h1 semantically **/
header {
	display: flex;
	flex-direction: column-reverse;
}

.site-heading {
	border-top: 1px solid var(--white);
	border-bottom: 1px solid var(--border-color);
	background-color: var(--red);
	color: var(--white);
}

h1 {
	display: flex;
	justify-content: center;
	margin: 0;
	font-size: 2em;
	text-align: center;
}

.header-nav {
	background-color: var(--blue);
	color: var(--white);
}

.header-nav-items {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5em 1em;
	margin: 0.5em var(--main-gutter-x);
	padding: 0;
	list-style: none;
	text-align: center;
}

.with-icon::before {
	display: inline-flex;
	margin-right: 5px;
	vertical-align: bottom;
	font-family: "FontAwesome";
}

.tech-blog::before {
	content: "\f5fc";
}

.theology-blog::before {
	content: "\f4ba";
}

.favourites-icon::before {
	content: "\f004";
}

.header-nav a:is(:hover, :focus) {
	background-color: var(--white);
	color: var(--red);
}

/** Main **/

/* --- Base Styles (Mobile / Stacked) --- */
main {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	justify-content: space-between;
	position: relative;
}

main section {
	width: 100%;
}

main section:first-child::after {
	content: "";
	display: block;
	width: 70%;
	height: 1px;
	background-color: var(--border-color);
	margin: 2rem auto 0 auto;
}

/* --- Desktop Styles (Side-by-Side) --- */
@media (min-width: 1080px) {
	main section {
		display: flex;
		align-items: center;
		width: calc(50% - 1rem);
	}

	main section:first-child::after {
		display: none;
	}
}

/** Footer **/

.site-footer {
	border-top: 2px solid var(--border-color);
	background-color: var(--red);
	font-size: 14px;
}

.social-links {
	display: grid;
	grid-template-columns: repeat(3, auto);
	justify-content: center;
	gap: 0.5em;
	width: 100%;
	margin: 0;
	padding: 16px 0;
	list-style: none;
}

@media (min-width: 480px) {
	.social-links {
		grid-template-columns: repeat(6, auto);
	}
}

@media (min-width: 768px) {
	.social-links {
		grid-template-columns: repeat(12, auto);
	}
}

.social-links li {
	display: inline-flex;
}

.social-links li a {
	fill: var(--white);
}

.social-links li a:is(:hover, :focus) {
	background-color: var(--white);
	fill: var(--blue);
}
