/*
Theme Name: Nocturne Journal
Theme URI: https://headoverheels.ca
Author: Tim
Description: A dark, image-forward theme for a two-track blog: clean Technical Articles and cinematic, parallax Photo Stories with fade-in text over full-bleed images. Pure black background, white type. Fully responsive.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: nocturne-journal
*/

/* =========================================================
   Variables
   ========================================================= */
:root {
	--bg: #000000;
	--bg-elevated: #0d0d0f;
	--bg-card: #111113;
	--text: #ffffff;
	--text-muted: #b7b7bd;
	--border: #262629;
	--accent: #4fd1c5;
	--accent-soft: rgba(79, 209, 197, 0.15);
	--max-width: 760px;
	--wide-width: 1120px;
	--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--radius: 10px;
}

/* =========================================================
   Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	margin: 0;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 0.5em; }
p { margin: 0 0 1.25em; }
.wrap { max-width: var(--wide-width); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; left: -9999px; }

/* =========================================================
   Reading progress bar (single articles only)
   ========================================================= */
.scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: var(--accent);
	z-index: 60;
	transition: width 0.1s linear;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 18px;
	padding-bottom: 18px;
}
.site-title {
	font-size: 1.25rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	color: var(--text);
	text-transform: uppercase;
}
.site-title:hover { color: var(--accent); text-decoration: none; }

.menu-toggle {
	display: none;
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 14px;
	border-radius: var(--radius);
	font-size: 0.9rem;
	cursor: pointer;
}

.primary-nav ul {
	list-style: none;
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
}
.primary-nav a {
	color: var(--text-muted);
	font-size: 0.95rem;
	font-weight: 600;
}
.primary-nav a:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 720px) {
	.menu-toggle { display: inline-block; }
	.primary-nav {
		display: none;
		width: 100%;
		border-top: 1px solid var(--border);
		margin-top: 16px;
		padding-top: 16px;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; gap: 14px; }
	.site-header .wrap { flex-wrap: wrap; }
}

/* =========================================================
   Layout / content grid (home + archives)
   ========================================================= */
.site-content { min-height: 60vh; padding: 56px 0 80px; }
.page-heading {
	max-width: var(--wide-width);
	margin: 0 auto 40px;
	padding: 0 24px;
}
.page-heading h1 { font-size: 2rem; }
.page-heading p { color: var(--text-muted); margin: 0; }

.article-grid {
	max-width: var(--wide-width);
	margin: 0 auto;
	padding: 0 24px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
}

.article-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.25s ease, border-color 0.25s ease;
}
.article-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.article-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-elevated); }
.article-card__media img { width: 100%; height: 100%; object-fit: cover; }
.article-card__body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.article-card__type {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 10px;
}
.article-card__title { font-size: 1.15rem; margin-bottom: 8px; }
.article-card__title a { color: var(--text); }
.article-card__title a:hover { color: var(--accent); text-decoration: none; }
.article-card__excerpt { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 14px; flex: 1; }
.article-card__meta { font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; }
.article-card--photo .article-card__media { aspect-ratio: 4 / 3; }

.pagination { max-width: var(--wide-width); margin: 48px auto 0; padding: 0 24px; display: flex; gap: 16px; }
.pagination a, .pagination span { color: var(--text-muted); }
.pagination a:hover { color: var(--accent); }

/* =========================================================
   Single Technical Article
   ========================================================= */
.technical-article {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
}
.technical-article .entry-header { margin-bottom: 28px; }
.technical-article .entry-kicker {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent);
	font-weight: 700;
	margin-bottom: 10px;
}
.technical-article .entry-title { font-size: 2.1rem; }
.technical-article .entry-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 10px; }
.technical-article .entry-thumbnail { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; }
.technical-article .entry-content { font-size: 1.05rem; }
.technical-article .entry-content h2 { font-size: 1.5rem; margin-top: 1.6em; }
.technical-article .entry-content h3 { font-size: 1.2rem; margin-top: 1.4em; }
.technical-article .entry-content pre {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.9rem;
}
.technical-article .entry-content code {
	font-family: var(--font-mono);
	background: var(--bg-elevated);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
}
.technical-article .entry-content blockquote {
	border-left: 3px solid var(--accent);
	margin: 1.5em 0;
	padding: 0.2em 0 0.2em 1.2em;
	color: var(--text-muted);
}
.technical-article .entry-content img { border-radius: var(--radius); margin: 1.5em 0; }
.entry-footer-nav { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }

/* =========================================================
   Page / 404
   ========================================================= */
.page-content, .not-found {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 24px;
	text-align: left;
}
.not-found { text-align: center; padding-top: 60px; }
.not-found h1 { font-size: 2.4rem; }

/* =========================================================
   Reveal / fade-in (JS adds "is-visible")
   ========================================================= */
.reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.reveal { transition: none; opacity: 1; transform: none; }
	html { scroll-behavior: auto; }
}

/* =========================================================
   Infinite scroll (chained articles at the bottom of a single page)
   ========================================================= */
.load-next {
	height: 1px;
}
.infinite-divider {
	max-width: var(--wide-width);
	margin: 0 auto;
	padding: 0 24px;
}
.infinite-divider hr {
	border: none;
	border-top: 1px solid var(--border);
	margin: 72px 0;
}
.infinite-status {
	text-align: center;
	padding: 32px 24px 56px;
	color: var(--text-muted);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.infinite-status.is-error a { color: var(--accent); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
	border-top: 1px solid var(--border);
	padding: 32px 0;
	color: var(--text-muted);
	font-size: 0.85rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
