/* Shared styles for the MacJournal pages (index, versions, history). */

:root {
	--bg: #fff;
	--fg: #1d1d1f;
	--muted: #5f6368;
	--link: #0b57d0;
	--surface: #f2f3f5;
	--rule: #d9dbe0;
	--accent: #2f6f00;          /* download button; white text is 6:1 on this */
	--accent-hover: #245600;
	--code: #891315;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #1c1c1e;
		--fg: #e8e8ea;
		--muted: #a0a4ab;
		--link: #8ab4f8;
		--surface: #2c2c2e;
		--rule: #444;
		--accent: #3d8a00;
		--accent-hover: #4aa200;
		--code: #ff8a8c;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	padding: 0 16px 32px;
	background: var(--bg);
	color: var(--fg);
	font-family: system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
}

a { color: var(--link); }
a:hover { text-decoration: none; }
a:focus-visible, .download:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

img { max-width: 100%; height: auto; border: 0; }

h1, h2, h3, h4 { line-height: 1.2; }

/* ---------- Page layout ---------- */

.site-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 20px;
	max-width: 46rem;
	margin: 0 auto;
	padding: 14px 0;
	font-size: 15px;
}
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

.mainbody {
	max-width: 46rem;
	margin: 0 auto;
}

/* ---------- Homepage hero ---------- */

.hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 16px 40px;
	padding: 24px 0 32px;
	text-align: center;
}
.hero img { width: 200px; height: 200px; }
.hero h1 {
	margin: 0 0 8px;
	font-size: clamp(2rem, 7vw, 3rem);
}
.hero .facts { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.hero .facts p { margin: 2px 0; }
.hero .facts strong { color: var(--fg); }

a.download {
	display: inline-block;
	padding: 14px 32px;
	background: var(--accent);
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 8px;
	transition: background-color .2s;
}
a.download:hover { background: var(--accent-hover); }

/* ---------- Screenshots ---------- */

.screenshots { margin: 0 0 24px; padding: 0; }
.screenshots figure { margin: 0 0 24px; text-align: center; }
.screenshots figcaption { margin-top: 6px; font-weight: 600; font-size: 15px; }
.screenshots .pair {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}
.screenshots .pair figure { margin: 0; }

/* ---------- Awards ---------- */

.awards {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin: 32px 0;
	padding: 0;
	list-style: none;
}
.awards li {
	padding: 10px 24px;
	background: var(--surface);
	border-radius: 20px;
	font-size: 1.15rem;
}
.awards span { white-space: nowrap; }

/* ---------- Previous versions ---------- */

.previousversion { border-collapse: collapse; margin: 0 0 12px; }
.previousversion th { text-align: left; }
.previousversion td, .previousversion th { padding: 4px 24px 4px 0; }

table.versions {
	border-collapse: collapse;
	margin: 0 auto;
}
table.versions th, table.versions td {
	padding: 10px 16px;
	text-align: left;
	border-bottom: 1px solid var(--rule);
}

.copyright {
	margin-top: 48px;
	color: var(--muted);
	font-size: 13px;
}

/* ---------- Version history page ---------- */

.page-title { text-align: center; margin: 16px 0 4px; font-size: clamp(2rem, 7vw, 2.6rem); }
.page-subtitle { text-align: center; margin: 0 0 24px; color: var(--muted); font-weight: normal; font-size: 1.1rem; }

div.version {
	max-width: 46rem;
	margin: 0 auto;
	border-left: 3px solid var(--accent);
}
div.version > ul { margin: 4px 0 2em; padding: 4px 8px 4px 2em; }
li { padding-bottom: .5ex; }
li.feature { font-weight: 700; }

div.versionheader { padding: 8px 12px; }
.versionnumber { display: inline; font-weight: 700; }
.versiondescription { display: inline; padding-left: 1em; font-style: italic; color: var(--muted); }
.versiondescription em { font-style: normal; }
.versiondate { float: right; }
code { font-family: ui-monospace, Menlo, monospace; color: var(--code); }

@media (max-width: 520px) {
	.versiondate { float: none; display: block; color: var(--muted); font-size: 14px; }
}
