/*
Theme Name: Amalthea
Theme URI: https://runserver.net/
Author: RunServer
Author URI: https://runserver.net/
Description: Preserved archive theme for Project Amalthea, a science fiction MMO site from 2017. Skins only the Amalthea section of the site and does not depend on the parent theme.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: amalthea
*/

/* ---------- Reset (minimal) ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
	margin: 0;
	padding: 0;
}

ul,
ol {
	list-style: none;
}

img {
	max-width: 100%;
	display: block;
}

/* ---------- Tokens ---------- */

:root {
	--am-bg-top: #05070a;
	--am-bg-bottom: #0c1118;
	--am-panel: #0f151d;
	--am-border: #1e2833;
	--am-text: #c7d0d9;
	--am-text-dim: #8a97a6;
	--am-accent: #7fd6e6;
	--am-accent-dim: #3f6b76;
	--am-max-width: 920px;
}

/* ---------- Base ---------- */

body {
	background-color: var(--am-bg-bottom);
	background-image: linear-gradient(to bottom, var(--am-bg-top) 0%, var(--am-bg-bottom) 480px);
	background-repeat: no-repeat;
	color: var(--am-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.65;
	min-height: 100vh;
}

a {
	color: var(--am-accent);
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

h1,
h2,
h3,
h4 {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	line-height: 1.3;
	color: #eef3f6;
	font-weight: 600;
}

h1 {
	font-size: 2em;
	letter-spacing: 0.06em;
	margin-bottom: 0.6em;
}

h2 {
	font-size: 1.4em;
	margin: 1.4em 0 0.6em;
}

h3 {
	font-size: 1.1em;
	margin: 1.2em 0 0.5em;
}

p {
	max-width: 65ch;
	margin: 0 0 1.1em;
}

hr {
	border: none;
	border-top: 1px solid var(--am-accent-dim);
	margin: 2em 0;
}

/* ---------- Layout ---------- */

.am-wrap {
	max-width: var(--am-max-width);
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Header ---------- */

.am-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(5, 7, 10, 0.92);
	border-bottom: 1px solid var(--am-border);
	backdrop-filter: blur(6px);
}

.am-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 16px 24px;
}

.am-wordmark {
	font-size: 1.3em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.28em;
	color: #eef3f6;
}

.am-wordmark:hover,
.am-wordmark:focus {
	text-decoration: none;
	color: var(--am-accent);
}

.am-wordmark span {
	color: var(--am-accent);
}

/* Mobile nav toggle, checkbox driven, no JS */

.am-nav-toggle {
	display: none;
}

.am-nav-toggle-label {
	display: none;
	border: 1px solid var(--am-border);
	color: var(--am-text);
	padding: 6px 12px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.8em;
	cursor: pointer;
}

.am-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
}

.am-nav a {
	display: inline-block;
	padding: 6px 2px;
	color: var(--am-text);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.85em;
	border-bottom: 2px solid transparent;
}

.am-nav a:hover,
.am-nav a:focus {
	color: var(--am-accent);
	text-decoration: none;
	border-bottom-color: var(--am-accent-dim);
}

.am-nav .current-menu-item a,
.am-nav .current_page_item a {
	color: var(--am-accent);
	border-bottom-color: var(--am-accent);
}

/* ---------- Main ---------- */

.am-main {
	padding: 48px 0 64px;
}

.am-article {
	background: var(--am-panel);
	border: 1px solid var(--am-border);
	border-radius: 4px;
	padding: 32px 36px;
}

.am-article-title {
	border-bottom: 1px solid var(--am-accent-dim);
	padding-bottom: 0.5em;
}

.am-meta {
	color: var(--am-text-dim);
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 1.4em;
}

.am-content a {
	border-bottom: 1px solid var(--am-accent-dim);
}

.am-content a:hover {
	border-bottom-color: var(--am-accent);
}

/* Post list on index.php */

.am-post-list-item + .am-post-list-item {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--am-border);
}

.am-post-list-item .am-meta {
	margin-bottom: 0.4em;
}

.am-read-more {
	display: inline-block;
	margin-top: 0.4em;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* ---------- Gallery shots ----------
   Post content is plain migrated markup: paragraphs, headings and bare
   figure.am-shot elements, not pre-wrapped in a gallery container. The
   content area itself becomes the grid; every element that is not a shot
   spans the full row so text keeps flowing normally while runs of shots
   fall into the grid columns next to each other. */

.am-content {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 14px;
}

.am-content > *:not(.am-shot) {
	grid-column: 1 / -1;
}

.am-content .am-shot {
	margin: 0;
}

/* A single shot in the whole article should not stretch edge to edge */

.am-content > .am-shot:only-of-type {
	max-width: 480px;
}

.am-shot img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 1px solid var(--am-border);
	border-radius: 6px;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.am-shot:hover img {
	transform: translateY(-3px);
	border-color: var(--am-accent-dim);
}

/* ---------- Footer ---------- */

.am-footer {
	border-top: 1px solid var(--am-border);
	color: var(--am-text-dim);
	font-size: 0.85em;
	padding: 24px 0 40px;
}

.am-footer a {
	color: var(--am-text-dim);
	border-bottom: 1px solid var(--am-accent-dim);
}

.am-footer a:hover {
	color: var(--am-accent);
	border-bottom-color: var(--am-accent);
}

.am-footer p {
	max-width: none;
	margin: 0 0 0.4em;
}

/* ---------- 404 ---------- */

.am-404 {
	text-align: center;
	padding: 64px 0;
}

.am-404 .am-404-code {
	font-size: 4em;
	color: var(--am-accent);
	letter-spacing: 0.1em;
}

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

@media (max-width: 700px) {
	body {
		font-size: 16px;
	}

	.am-article {
		padding: 24px 20px;
	}

	.am-nav-toggle-label {
		display: inline-block;
	}

	.am-nav {
		flex-basis: 100%;
		display: none;
		flex-direction: column;
		gap: 0;
		border-top: 1px solid var(--am-border);
		margin-top: 12px;
		padding-top: 8px;
	}

	.am-nav a {
		padding: 10px 2px;
	}

	.am-nav-toggle:checked ~ .am-nav {
		display: flex;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.am-shot img {
		transition: none;
	}

	.am-shot:hover img {
		transform: none;
	}
}
