/*
Theme Name: Gravatar Theme
Theme URI: https://github.com/davidsword/gravatar-theme
Author: David Sword
Author URI: https://davidsword.ca
Description: A minimal personal site theme that uses Gravatar for the site icon.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gravatartheme
*/

:root {
	--color-surface: #fff;
	--color-text-secondary: #50575e;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family:
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"SF Pro Text",
		"Segoe UI",
		Roboto,
		sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

main {
	background-color: var(--color-background);
	min-height: 100vh;
	padding: 48px 20px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.container {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 560px;
}

nav {
	display: flex;
	gap: 24px;
	justify-content: flex-end;
	width: 100%;
	max-width: 560px;
	margin: auto auto 20px;
	padding-right: 40px;
}

nav a {
	color: var(--color-surface);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.3px;
	opacity: 0.75;
	transition: opacity 0.2s ease, color 0.2s ease, text-decoration-color 0.2s ease;
	text-decoration-color: transparent;
}

nav a:hover {
	color: var(--color-surface);
	opacity: 1;
	text-decoration: underline;
	text-decoration-color: var(--color-surface);
	text-underline-offset: 3px;
}

nav a[aria-current="page"],
nav .current-menu-item a,
nav .current_page_item a {
	opacity: 1;
}

#nav-toggle {
	display: none;
}

.hamburger {
	display: none;
	cursor: pointer;
	padding: 8px;
	margin: auto 24px 16px auto;
}

.hamburger span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--color-surface);
	margin: 4px 0;
	opacity: 0.75;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.hamburger:hover span {
	opacity: 1;
}

.card {
	background-color: var(--color-surface);
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	padding: 32px 40px 40px;
	position: relative;
	overflow: hidden;
}

article {
	margin-top: 20px;
}

article p:first-child {
	margin-top: 0;
}

img {
	background:#b7b7b7;
}

header {
	display: flex;
	flex-direction: column;
	height: 144px;
	left: 50%;
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	width: 640px;
	overflow-y: hidden;
	background: color-mix(in srgb, var(--color-background) 75%, black);
}

header img {
	display: none;
	filter: blur(60px);
	object-fit: cover;
	transform: translateY(-30%);
	width: 100%;
}

.avatar {
	height: 148px;
	width: 148px;
	margin-bottom: 16px;
	border-radius: 50%;
	position: relative;
	z-index: 1;
}

h1 {
	font-family:
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"SF Pro Display",
		"Segoe UI",
		Roboto,
		sans-serif;
	font-size: 32px;
	font-weight: 600;
	letter-spacing: -0.5px;
	line-height: 1.2;
	margin: 0;
}

main small {
	display: block;
	color: var(--color-text-secondary);
	font-size: 15px;
	letter-spacing: -0.2px;
	line-height: 1.5;
}

p {
	margin: 20px 0 0;
	font-size: 15px;
	letter-spacing: -0.1px;
	line-height: 1.6;
	color: #1d1d1f;
}

a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(0, 0, 0, 0.2);
	text-underline-offset: 2px;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
	color: var(--color-background);
	text-decoration-color: var(--color-background);
}

a[aria-label="GitHub"] {
	position: absolute;
	top: 206px;
	right: 40px;
	opacity: 0.6;
	transition: opacity 0.2s;
}

a[aria-label="GitHub"]:hover {
	opacity: 1;
}

/* Blog posts list */
.posts {
	margin-top: 20px;
	width: 100%;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.posts article {
	padding: 20px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	margin: 0;
}

.posts article h2 {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 8px;
	line-height: 1.3;
}

.posts article h2 a {
	text-decoration: none;
}

.posts article h2 a:hover {
	text-decoration: underline;
}

.posts article time {
	display: block;
	font-size: 13px;
	color: var(--color-text-secondary);
	margin-bottom: 8px;
}

.posts article p {
	margin: 0;
	color: var(--color-text-secondary);
	font-size: 14px;
}

/* Single post/stuff */
.single article,
.single-stuff article {
	margin-top: 20px;
	padding-top: 20px;
	width: 100%;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.post-featured-image {
	margin-bottom: 16px;
}

.post-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.single article h2,
.single-stuff article h2 {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 8px;
	line-height: 1.3;
}

.single article time,
.single-stuff article time {
	display: block;
	font-size: 13px;
	color: var(--color-text-secondary);
	margin-bottom: 16px;
}

.post-nav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.post-nav a {
	font-size: 14px;
	color: var(--color-text-secondary);
	text-decoration: none;
	max-width: 45%;
}

.post-nav a:hover {
	color: var(--color-background);
}

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

/* Stuff grid (Instagram-style) */
.stuff-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	margin-top: 20px;
	width: 100%;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	padding-top: 20px;
}

.stuff-tile {
	aspect-ratio: 1;
	display: block;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}

.stuff-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s ease;
}

.stuff-tile:hover img {
	opacity: 0.8;
}

.stuff-tile-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.1);
}

/* Single stuff */
.stuff-tags {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.stuff-tags a {
	font-size: 12px;
	color: var(--color-text-secondary);
	text-decoration: none;
	background: rgba(0, 0, 0, 0.05);
	padding: 4px 8px;
	border-radius: 4px;
}

.stuff-tags a:hover {
	background: rgba(0, 0, 0, 0.1);
	color: inherit;
}

.stuff-featured-image {
	margin-bottom: 16px;
}

.stuff-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

/* 404 */
.error-404 {
	margin-top: 20px;
	padding-top: 60px;
	padding-bottom: 40px;
	text-align: center;
	width: 100%;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.error-404 h2 {
	font-size: 48px;
	margin: 0;
}
.error-404 p {
	margin-top:0;
}

/* WordPress menu classes */
nav ul {
	display: flex;
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

nav li {
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 600px) {
	main {
		padding: 16px;
	}

	header {
		overflow: visible;
	}

	.hamburger {
		display: block;
	}

	nav {
		position: absolute;
		top: 100%;
		right: 0;
		flex-direction: column;
		background: color-mix(in srgb, var(--color-background) 75%, black);
		padding: 16px 24px;
		gap: 12px;
		border-radius: 0 0 4px 4px;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
		z-index: 10;
	}

	#nav-toggle:checked ~ nav {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	#nav-toggle:checked + .hamburger span:nth-child(1) {
		transform: rotate(45deg) translate(4px, 4px);
	}

	#nav-toggle:checked + .hamburger span:nth-child(2) {
		opacity: 0;
	}

	#nav-toggle:checked + .hamburger span:nth-child(3) {
		transform: rotate(-45deg) translate(4px, -4px);
	}

	nav a {
		font-size: 14px;
	}

	nav ul {
		flex-direction: column;
		gap: 12px;
	}

	.card {
		padding: 24px 24px 32px;
	}

	h1 {
		font-size: 26px;
	}

	a[aria-label="GitHub"] {
		right: 24px;
		top: 193px;
	}
}
