/* ---------------------------------------------------------------------------
   Ariel — An Austrian School Ideologue
   Hand-written stylesheet. Keeps the look of the original WordPress "pubhey"
   theme (colours, proportions, light heading weights) without the framework.
   --------------------------------------------------------------------------- */

:root {
	color-scheme: light;
	--bg: #ffffff;
	--fg: #555451;
	--primary: #1f1f1d;
	--secondary: #787670;
	--tertiary: #d9d9d6;

	--content: 620px;
	--wide: 1000px;

	--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans,
		Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;

	--step-0: clamp(0.833rem, 0.833rem + ((1vw - 0.2rem) * 0.393), 1rem);
	--step-1: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.471), 1.2rem);
	--step-2: clamp(1.2rem, 1.2rem + ((1vw - 0.2rem) * 1.242), 1.728rem);
	--step-3: clamp(1.728rem, 1.728rem + ((1vw - 0.2rem) * 0.814), 2.074rem);
	--step-4: clamp(2.074rem, 2.074rem + ((1vw - 0.2rem) * 2.146), 2.986rem);

	--gap: 1.5rem;
	--pad: clamp(1.25rem, 4vw, 3rem);
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	font-size: var(--step-0);
	font-weight: 400;
	line-height: 1.75;
}

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

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--primary);
	font-weight: 400;
	line-height: 1.25;
	margin: 2.5rem 0 1rem;
}

hr {
	border: 0;
	border-top: 1px solid var(--tertiary);
	margin: 2.5rem 0;
}

/* --- shared layout ------------------------------------------------------- */

/* content-box so the text column is exactly --content wide, padding outside it */
.wrap {
	box-sizing: content-box;
	max-width: var(--content);
	margin-inline: auto;
	padding-inline: var(--pad);
}

/* --- home cover ---------------------------------------------------------- */

.home-top {
	display: flex;
	justify-content: flex-end;
	max-width: var(--wide);
	margin-inline: auto;
	padding: 1.25rem var(--pad) 0;
}

.cover {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	text-align: center;
	min-height: min(80vh, 680px);
	padding: 3rem var(--pad) 4rem;
	border-bottom: 1px solid var(--tertiary);
}

.cover img.crest {
	width: 112px;
	height: 112px;
}

.cover h1 {
	font-size: var(--step-4);
	margin: 0.5rem 0 0;
}

.cover .tagline {
	color: var(--secondary);
	margin: 0;
	font-size: var(--step-1);
}

/* --- social icons -------------------------------------------------------- */

.social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}

.social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: var(--primary);
	color: var(--bg);
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.social a:hover {
	opacity: 0.7;
	color: var(--bg);
}

.social svg {
	width: 1.15rem;
	height: 1.15rem;
	fill: currentColor;
}

.social .label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --- post list ----------------------------------------------------------- */

.list-heading {
	text-align: center;
	font-size: var(--step-2);
	margin: 3.5rem 0 2rem;
}

.cat-heading {
	font-size: var(--step-1);
	font-weight: 400;
	margin: 3.5rem 0 1.5rem;
}

.post-list {
	list-style: none;
	margin: 0 0 4rem;
	padding: 0;
}

.post-list li {
	border-bottom: 1px solid var(--tertiary);
}

.post-list li:first-child {
	border-top: 1px solid var(--tertiary);
}

.post-list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.1rem 0;
	text-decoration: none;
	color: var(--primary);
}

.post-list a:hover .entry-title {
	text-decoration: underline;
}

.post-list .entry-title {
	font-size: var(--step-1);
	line-height: 1.45;
}

.post-list .entry-date {
	flex: none;
	color: var(--secondary);
	font-size: 0.833rem;
	white-space: nowrap;
}

.year-heading {
	font-size: var(--step-1);
	color: var(--secondary);
	margin: 2.5rem 0 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* --- single post --------------------------------------------------------- */

/* Title matches the original theme: "large" step, weight 400, left aligned. */
.post-header {
	margin: 4rem 0 3rem;
}

.post-header h1 {
	font-size: var(--step-1);
	font-weight: 400;
	line-height: 1.4583;
	margin: 0 0 0.5rem;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	color: var(--secondary);
	font-size: 0.833rem;
}

.post-meta a {
	color: inherit;
}

.post-content > * {
	margin-block: 1.25rem;
}

.post-content p {
	line-height: calc(1em + 0.75rem);
}

.post-content h2 {
	font-size: var(--step-2);
}

.post-content h3 {
	font-size: var(--step-1);
}

.post-content h4 {
	font-size: 1rem;
	font-weight: 600;
}

.post-content ul,
.post-content ol {
	padding-left: 1.5rem;
}

.post-content li {
	margin-block: 0.4rem;
}

.post-content blockquote {
	margin-inline: 0;
	padding-left: 1.25rem;
	border-left: 2px solid var(--tertiary);
	color: var(--secondary);
	font-style: italic;
}

.post-content figure {
	margin-inline: 0;
	text-align: center;
}

.post-content figcaption {
	color: var(--secondary);
	font-size: 0.833rem;
	margin-top: 0.5rem;
}

.post-content img {
	display: block;
	margin-inline: auto;
}

.post-content img.latex {
	display: inline;
	vertical-align: middle;
}

.post-content .has-text-align-center {
	text-align: center;
}

/* --- prev / next --------------------------------------------------------- */

.post-nav {
	display: flex;
	justify-content: space-between;
	gap: var(--gap);
	margin: 4rem 0 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--tertiary);
	font-size: 0.833rem;
}

.post-nav a {
	color: var(--primary);
	text-decoration: none;
}

.post-nav a:hover {
	text-decoration: underline;
}

.post-nav .next {
	margin-left: auto;
}

/* --- footer -------------------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--tertiary);
	padding: 3rem var(--pad);
	text-align: center;
}

.site-footer blockquote {
	max-width: var(--content);
	margin: 0 auto 1.5rem;
	padding: 0;
	border: 0;
	color: var(--primary);
	font-style: italic;
	font-size: var(--step-1);
	line-height: 1.6;
}

.site-footer cite {
	display: block;
	margin-top: 0.75rem;
	color: var(--secondary);
	font-size: 0.833rem;
	font-style: normal;
}

.site-footer cite a {
	color: inherit;
}

.site-footer .copyright {
	color: var(--secondary);
	font-size: 0.833rem;
	margin: 0;
}

/* --- dark mode ----------------------------------------------------------- */

/* Follows the OS by default; the toggle sets data-theme to override it. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #14140f;
		--fg: #b9b7b0;
		--primary: #f2f0e9;
		--secondary: #8d8a83;
		--tertiary: #33322c;
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #14140f;
	--fg: #b9b7b0;
	--primary: #f2f0e9;
	--secondary: #8d8a83;
	--tertiary: #33322c;
}

/* --- page top (posts, categories) ---------------------------------------- */

.page-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--gap);
	padding-top: 2.5rem;
}

.page-top .home-link {
	display: block;
	line-height: 0;
}

.page-top .home-link img {
	width: 70px;
	height: 70px;
}

.theme-toggle {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin-top: 0.25rem;
	padding: 0;
	border: 1px solid var(--tertiary);
	border-radius: 999px;
	background: none;
	color: var(--secondary);
	cursor: pointer;
}

.theme-toggle:hover {
	color: var(--primary);
	border-color: var(--secondary);
}

.theme-toggle svg {
	width: 1.05rem;
	height: 1.05rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* show the icon for the theme you would switch *to* */
.theme-toggle .icon-sun {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .icon-sun {
		display: block;
	}

	:root:not([data-theme="light"]) .theme-toggle .icon-moon {
		display: none;
	}
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
	display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
	display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
	display: block;
}

/* --- small screens ------------------------------------------------------- */

@media (max-width: 600px) {
	.post-list a {
		flex-direction: column;
		gap: 0.2rem;
	}
}
