/*
Theme Name: Cairney Archive
Theme URI: https://cairney.com
Author: Michael Cairney
Description: A private family archive for the Cairney family.
Version: 0.4.0
Requires at least: 6.0
Tested up to: 6.8
Text Domain: cairney-archive
*/

:root {
	--cairney-ink: #20201e;
	--cairney-muted: #6b6963;
	--cairney-paper: #fff;
	--cairney-background: #fff;
	--cairney-line: #d9d5cc;
	--cairney-link: #24577f;
	--cairney-link-dark: #14344e;
	--cairney-soft-blue: #edf4f9;
	--cairney-radius: 8px;
	--cairney-shadow: 0 2px 12px rgba(30, 30, 25, 0.06);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--cairney-background);
	color: var(--cairney-ink);
	font-family: "Times New Roman", Times, serif;
	font-size: 16px;
	line-height: 1.55;
}

img,
svg {
	max-width: 100%;
}

a {
	color: var(--cairney-link);
	text-underline-offset: 0.16em;
}

a:visited {
	color: var(--cairney-link);
}

a:hover,
a:focus {
	color: var(--cairney-link-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: #171715;
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	line-height: 1.14;
}

/*
 * Page, Person, Event, archive and search titles use the archive blue.
 * Their size is explicit rather than depending on browser h1/h2 defaults.
 */
.entry-title,
.archive-title {
	margin: 0 0 1rem;
	color: var(--cairney-link);
	font-size: 1.5rem;
	letter-spacing: 0;
}

button,
input,
select,
textarea {
	font: inherit;
}

/* Site frame --------------------------------------------------------------- */

.site-footer {
	margin-top: 48px;
	padding: 0 0 30px;
	background: var(--cairney-background);
	color: var(--cairney-muted);
}

.site-footer-inner {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 30px;
	width: min(100% - 32px, 1040px);
	margin: 0 auto;
	font-size: 13px;
	line-height: 1.5;
}

.site-footer-logo {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}

.site-footer-logo img {
	display: block;
	width: 120px;
	height: auto;
	max-width: 100%;
}

.site-footer-navigation {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px 15px;
}

.site-footer-navigation a,
.site-footer-navigation a:visited {
	color: var(--cairney-muted);
	text-decoration: none;
}

.site-footer-navigation a:hover,
.site-footer-navigation a:focus {
	color: var(--cairney-ink);
	text-decoration: underline;
}

/* General content ---------------------------------------------------------- */

.site-main {
	width: min(100% - 32px, 1040px);
	margin: 38px auto 56px;
}

.entry-content,
.entry-summary,
.archive-description {
	font-size: 1rem;
}

.entry-content > :first-child,
.entry-summary > :first-child,
.archive-description > :first-child {
	margin-top: 0;
}

.entry-content > :last-child,
.entry-summary > :last-child,
.archive-description > :last-child {
	margin-bottom: 0;
}

.entry-content h2 {
	margin: 2rem 0 0.8rem;
	color: #171715;
	font-size: 1.3rem;
}

.entry-content h3 {
	margin: 1.6rem 0 0.65rem;
	color: #171715;
	font-size: 1.125rem;
}

.entry-content h4 {
	margin: 1.35rem 0 0.55rem;
	font-size: 1rem;
}

.entry-content ul,
.entry-content ol {
	padding-left: 26px;
}

.entry-content li + li {
	margin-top: 5px;
}

.cairney-entry-card + .cairney-entry-card {
	margin-top: 2rem;
}

/* Person page -------------------------------------------------------------- */

.cairney-person-page {
	width: min(100% - 32px, 980px);
}

.cairney-person-record {
	margin: 0;
}

.cairney-notice {
	margin: 0 0 18px;
	padding: 11px 14px;
	border: 1px solid #8ebc8e;
	border-radius: 6px;
	background: #f0f8f0;
	font-size: 15px;
}

.cairney-person-hero {
	display: flex;
	align-items: center;
	gap: 26px;
	margin-bottom: 26px;
	padding: 28px;
	border: 1px solid var(--cairney-line);
	border-radius: var(--cairney-radius);
	background: var(--cairney-paper);
	box-shadow: var(--cairney-shadow);
}

.cairney-person-face-photo {
	display: block;
	flex: 0 0 180px;
	width: 180px;
	height: 180px;
	overflow: hidden;
	border-radius: 8px;
	background: #e5e3de;
}

.cairney-person-face-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cairney-person-heading {
	min-width: 0;
	flex: 1 1 auto;
}

/* Person names now use the same restrained page-title scale as the site. */
.cairney-person-heading .entry-title {
	margin: 0 0 18px;
	font-size: 1.5rem;
	letter-spacing: 0;
}

.cairney-person-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.cairney-action,
.cairney-action:visited {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	padding: 8px 11px;
	border: 1px solid #b9b5ad;
	border-radius: 6px;
	background: #fff;
	color: #242421;
	font-size: 14px;
	font-weight: 650;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}

.cairney-action-add,
.cairney-action-add:visited {
	border-color: #b9b5ad;
	background: #fff;
}

.cairney-action:hover,
.cairney-action:focus {
	border-color: #625f58;
	background: #f7f6f3;
	color: #111;
	text-decoration: none;
	transform: translateY(-1px);
}

.cairney-action:focus-visible {
	outline: 3px solid rgba(36, 87, 127, 0.25);
	outline-offset: 2px;
}

.cairney-action svg {
	display: block;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	max-width: none;
}

.cairney-person-content {
	padding: 30px;
	border: 1px solid var(--cairney-line);
	border-radius: var(--cairney-radius);
	background: var(--cairney-paper);
	box-shadow: var(--cairney-shadow);
}

.cairney-person-content section + section {
	margin-top: 34px;
	padding-top: 28px;
	border-top: 1px solid var(--cairney-line);
}

.cairney-person-content .cairney-archive-photo-gallery {
	margin-top: 32px;
}

/* Comments ----------------------------------------------------------------- */

.person-comments {
	margin-top: 28px;
	padding: 30px;
	border: 1px solid var(--cairney-line);
	border-radius: var(--cairney-radius);
	background: var(--cairney-paper);
	box-shadow: var(--cairney-shadow);
}

.person-comments h2,
.person-comments h3 {
	margin-top: 0;
}

.person-comments textarea,
.person-comments input[type="text"],
.person-comments input[type="email"],
.person-comments input[type="url"] {
	width: 100%;
	max-width: 100%;
	padding: 10px 11px;
	border: 1px solid #aaa69d;
	border-radius: 5px;
	background: #fff;
}

.person-comments textarea {
	min-height: 150px;
	resize: vertical;
}

.person-comments input[type="submit"] {
	padding: 9px 14px;
	border: 1px solid #222;
	border-radius: 5px;
	background: #222;
	color: #fff;
	cursor: pointer;
}

.person-comments input[type="submit"]:hover,
.person-comments input[type="submit"]:focus {
	background: #444;
}

/* Accessibility ------------------------------------------------------------ */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 760px) {
	.site-footer-inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 14px;
	}

	.site-footer-logo img {
		width: 105px;
	}

	.site-footer-navigation {
		justify-content: flex-start;
	}

	.cairney-person-hero {
		align-items: flex-start;
		gap: 18px;
		padding: 22px;
	}

	.cairney-person-face-photo {
		flex-basis: 118px;
		width: 118px;
		height: 118px;
	}
}

@media (max-width: 520px) {
	.site-main,
	.cairney-person-page {
		width: min(100% - 20px, 980px);
		margin-top: 20px;
	}

	.site-footer-logo img {
		width: 90px;
	}

	.cairney-person-hero {
		display: block;
		padding: 18px;
	}

	.cairney-person-face-photo {
		width: 142px;
		height: 142px;
		margin-bottom: 18px;
	}

	.cairney-person-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cairney-action {
		justify-content: flex-start;
	}

	.cairney-person-content,
	.person-comments {
		padding: 20px;
	}
}
