/**
 * Flintberg Theme Styles
 *
 * Complete CSS for the Flintberg theme using the Forge palette.
 * This file will be replaced by compiled Tailwind output when build pipeline is available.
 *
 * @package Flintberg
 */

/* ==========================================
   CSS Custom Properties (Design Tokens)
   ========================================== */

:root {
	/* Forge Palette Colors */
	--color-primary: #1B6B75;           /* Deep Teal */
	--color-secondary: #4A4458;         /* Forest Plum */
	--color-accent-copper: #C97844;     /* Copper Glow */
	--color-accent-purple: #6B4C7A;     /* Royal Purple */
	--color-text-primary: #1F1F1F;      /* Rich Black */
	--color-text-secondary: #4A5568;    /* Charcoal */
	--color-bg-white: #FFFFFF;
	--color-bg-cloud: #F8F9FA;
	--color-bg-warm-stone: #FAF7F4;
	--color-bg-pale-teal: #F0F7F8;
	--color-border-light: #E2E8F0;
	--color-border-medium: #CBD5E0;

	/* Typography */
	--font-heading: 'Epilogue', sans-serif;
	--font-body: 'Literata', serif;

	/* Spacing */
	--spacing-xs: 0.5rem;    /* 8px */
	--spacing-sm: 1rem;      /* 16px */
	--spacing-md: 1.5rem;    /* 24px */
	--spacing-lg: 2rem;      /* 32px */
	--spacing-xl: 3rem;      /* 48px */
	--spacing-2xl: 4rem;     /* 64px */
	--spacing-3xl: 6rem;     /* 96px */

	/* Container */
	--container-max: 1280px;
	--container-narrow: 768px;

	/* Transitions */
	--transition-fast: 0.2s ease;
	--transition-normal: 0.3s ease;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */

* {
	box-sizing: border-box;
}

html {
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	margin: 0;
	padding: 0;
	font-family: var(--font-body);
	font-size: 1.125rem; /* 18px */
	line-height: 1.8;
	color: var(--color-text-primary);
	background-color: var(--color-bg-white);
}

body.menu-open {
	overflow: hidden;
}

/* ==========================================
   Typography
   ========================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-primary);
	margin-top: 0;
	margin-bottom: 1rem;
}

h1 {
	font-size: 2.25rem; /* 36px */
	font-weight: 700;
}

h2 {
	font-size: 1.875rem; /* 30px */
}

h3 {
	font-size: 1.5rem; /* 24px */
}

h4 {
	font-size: 1.25rem; /* 20px */
}

h5, h6 {
	font-size: 1rem; /* 16px */
}

@media (min-width: 768px) {
	h1 {
		font-size: 2.5rem; /* 40px */
	}
	h2 {
		font-size: 2rem; /* 32px */
	}
	h3 {
		font-size: 1.75rem; /* 28px */
	}
}

p {
	margin-top: 0;
	margin-bottom: 1.5rem;
}

a {
	color: var(--color-accent-copper);
	text-decoration: none;
	transition: color var(--transition-fast);
}

a:hover, a:focus {
	color: #B56935; /* Darker copper */
	text-decoration: underline;
}

a:focus {
	outline: 2px solid var(--color-accent-copper);
	outline-offset: 2px;
}

strong, b {
	font-weight: 700;
}

blockquote {
	margin: 2rem 0;
	padding: 1.5rem;
	border-left: 4px solid var(--color-primary);
	background-color: var(--color-bg-pale-teal);
	font-style: italic;
	color: var(--color-text-secondary);
}

code, pre {
	font-family: 'Courier New', monospace;
	background-color: var(--color-bg-cloud);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
}

pre {
	padding: 1rem;
	overflow-x: auto;
}

/* ==========================================
   Layout Utilities
   ========================================== */

.container {
	max-width: var(--container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

@media (min-width: 640px) {
	.container {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.container {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

.container.narrow {
	max-width: var(--container-narrow);
}

.screen-reader-text, .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.skip-link {
	background-color: var(--color-primary);
	color: var(--color-bg-white);
	padding: 1rem;
	position: absolute;
	top: -100%;
	left: 0;
	z-index: 9999;
}

.skip-link:focus {
	top: 0;
}

/* ==========================================
   Header
   ========================================== */

.site-header {
	background-color: var(--color-bg-white);
	border-bottom: 1px solid var(--color-border-light);
	position: sticky;
	top: 0;
	z-index: 1000;
	transition: all var(--transition-fast);
}

.site-header.scrolled {
	background-color: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 1rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.site-title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: 1.5rem;
	font-weight: 700;
}

.site-title a {
	color: var(--color-primary);
	text-decoration: none;
}

.site-title a:hover {
	text-decoration: none;
}

.logo-text {
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

/* Navigation */
.main-navigation {
	position: relative;
}

.nav-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 2rem;
}

@media (min-width: 1024px) {
	.nav-menu {
		display: flex;
	}
}

.nav-menu li {
	margin: 0;
}

.nav-menu a {
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 500;
	color: var(--color-text-primary);
	text-decoration: none;
	transition: color var(--transition-fast);
	padding: 0.5rem 0;
	display: block;
}

.nav-menu a:hover,
.nav-menu a:focus {
	color: var(--color-accent-copper);
	text-decoration: none;
}

.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
	color: var(--color-accent-copper);
	border-bottom: 2px solid var(--color-accent-copper);
}

/* Mobile Menu Toggle */
.menu-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (min-width: 1024px) {
	.menu-toggle {
		display: none;
	}
}

.hamburger-icon {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	width: 24px;
	height: 18px;
}

.hamburger-icon span {
	display: block;
	width: 100%;
	height: 2px;
	background-color: var(--color-primary);
	transition: all var(--transition-fast);
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
	transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
	transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Panel */
@media (max-width: 1023px) {
	.main-navigation.toggled::before {
		content: '';
		position: fixed;
		inset: 0;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 40;
	}

	.main-navigation.toggled .nav-menu {
		display: flex;
		flex-direction: column;
		position: fixed;
		right: 0;
		top: 0;
		height: 100vh;
		width: 320px;
		max-width: 100%;
		background-color: var(--color-bg-white);
		box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
		z-index: 50;
		padding: 2rem 1.5rem;
		gap: 0;
		overflow-y: auto;
		transform: translateX(0);
		transition: transform var(--transition-normal);
	}

	.nav-menu a {
		font-size: 1.125rem;
		padding: 1rem 0;
		border-bottom: 1px solid var(--color-border-light);
	}

	.nav-menu a:hover {
		background-color: var(--color-bg-pale-teal);
		padding-left: 0.5rem;
	}

	.nav-menu .current-menu-item > a {
		background-color: var(--color-bg-pale-teal);
		border-bottom-color: var(--color-accent-copper);
	}
}

/* ==========================================
   Footer
   ========================================== */

.site-footer {
	background-color: var(--color-bg-cloud);
	border-top: 1px solid var(--color-border-light);
	margin-top: 6rem;
	padding: 4rem 0 2rem;
}

.footer-inner {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 1.5rem;
}

.footer-columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin-bottom: 3rem;
}

@media (min-width: 768px) {
	.footer-columns {
		grid-template-columns: repeat(3, 1fr);
		gap: 3rem;
	}
}

.footer-heading {
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-secondary);
	margin-bottom: 1rem;
}

.footer-menu,
.legal-menu,
.social-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-menu li,
.legal-menu li,
.social-links li {
	margin-bottom: 0.5rem;
}

.footer-menu a,
.legal-menu a,
.social-links a {
	font-size: 1rem;
	color: var(--color-text-secondary);
	text-decoration: none;
	transition: color var(--transition-fast);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.footer-menu a:hover,
.legal-menu a:hover,
.social-links a:hover {
	color: var(--color-accent-copper);
}

.social-icon {
	width: 1.5rem;
	height: 1.5rem;
	color: var(--color-primary);
	transition: color var(--transition-fast);
}

.social-links a:hover .social-icon {
	color: var(--color-accent-copper);
}

.footer-bottom {
	border-top: 1px solid var(--color-border-medium);
	padding-top: 2rem;
	text-align: center;
}

.copyright,
.tagline {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	margin: 0.5rem 0;
}

/* ==========================================
   Hero Sections
   ========================================== */

.hero-section {
	position: relative;
	min-height: 35vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.hero-background {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.hero-background img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
	z-index: 1;
}

.hero-content {
	position: relative;
	z-index: 2;
	text-align: center;
	color: var(--color-bg-white);
	padding: 2rem;
}

.hero-title {
	font-size: 3rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: var(--color-accent-copper);
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
	.hero-title {
		font-size: 3.5rem;
	}
}

.logo-wordmark {
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.hero-tagline {
	font-size: 1.25rem;
	margin-bottom: 2rem;
	opacity: 0.95;
}

.hero-cta {
	margin-top: 2rem;
}

.hero-single .hero-content {
	padding-top: 6rem;
	padding-bottom: 3rem;
}

.hero-single .entry-title {
	color: var(--color-bg-white);
	font-size: 2.5rem;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
	.hero-single .entry-title {
		font-size: 3rem;
	}
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
	display: inline-block;
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 600;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	text-decoration: none;
	transition: all var(--transition-fast);
	cursor: pointer;
	border: none;
	text-align: center;
}

.btn-primary {
	background-color: var(--color-accent-copper);
	color: var(--color-bg-white);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn-primary:focus {
	background-color: #B56935;
	box-shadow: 0 4px 6px rgba(201, 120, 68, 0.2);
	text-decoration: none;
	color: var(--color-bg-white);
}

.btn-secondary {
	background-color: transparent;
	color: var(--color-primary);
	border: 2px solid var(--color-primary);
	padding: 0.625rem 1.5rem;
}

.btn-secondary:hover,
.btn-secondary:focus {
	background-color: var(--color-primary);
	color: var(--color-bg-white);
	text-decoration: none;
}

.btn-ghost {
	background-color: transparent;
	color: var(--color-accent-copper);
	padding: 0;
	font-weight: 500;
}

.btn-ghost:hover,
.btn-ghost:focus {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

/* ==========================================
   Post Cards / Grid
   ========================================== */

.posts-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin-bottom: 3rem;
}

@media (min-width: 768px) {
	.posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 2rem;
	}
}

@media (min-width: 1024px) {
	.posts-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 2rem;
	}
}

.post-card {
	background-color: var(--color-bg-white);
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: box-shadow var(--transition-fast);
	display: flex;
	flex-direction: column;
}

.post-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.post-card-image {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background-color: var(--color-bg-cloud);
}

.post-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--transition-normal);
}

.post-card:hover .post-card-image img {
	transform: scale(1.05);
}

.post-card-content {
	padding: 1.5rem;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.post-card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
	font-size: 0.875rem;
}

.post-date {
	color: var(--color-text-secondary);
}

.post-card-title {
	margin: 0 0 1rem 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.post-card-title a {
	color: var(--color-primary);
	text-decoration: none;
}

.post-card-title a:hover {
	color: var(--color-accent-copper);
	text-decoration: none;
}

.post-card-excerpt {
	color: var(--color-text-secondary);
	font-size: 1rem;
	line-height: 1.6;
	margin-bottom: 1rem;
	flex-grow: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-card-link {
	color: var(--color-accent-copper);
	font-weight: 500;
	font-family: var(--font-heading);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.post-card-link:hover {
	text-decoration: underline;
}

/* ==========================================
   Category Badges
   ========================================== */

.category-badge {
	display: inline-block;
	font-family: var(--font-heading);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
}

.badge-research {
	background-color: rgba(27, 107, 117, 0.15);
	color: var(--color-primary);
}

.badge-reflections {
	background-color: rgba(107, 76, 122, 0.15);
	color: var(--color-accent-purple);
}

.badge-news {
	background-color: rgba(201, 120, 68, 0.15);
	color: var(--color-accent-copper);
}

.badge-gamedev {
	background-color: rgba(74, 68, 88, 0.15);
	color: var(--color-secondary);
}

.badge-misc,
.badge-default {
	background-color: rgba(74, 85, 104, 0.15);
	color: var(--color-text-secondary);
}

/* ==========================================
   Single Post / Article Content
   ========================================== */

.article-content {
	padding: 3rem 0;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--color-border-light);
	font-size: 0.875rem;
	color: var(--color-text-secondary);
}

.entry-content {
	margin-bottom: 3rem;
}

.entry-content > * {
	max-width: 100%;
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: 0.5rem;
}

.entry-content ul,
.entry-content ol {
	margin-left: 1.5rem;
	margin-bottom: 1.5rem;
}

.entry-content li {
	margin-bottom: 0.5rem;
}

.entry-footer {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border-light);
}

.post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.tags-label {
	font-weight: 600;
	color: var(--color-text-secondary);
}

.post-tags a {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	background-color: var(--color-bg-cloud);
	padding: 0.25rem 0.75rem;
	border-radius: 0.25rem;
	text-decoration: none;
}

.post-tags a:hover {
	background-color: var(--color-bg-pale-teal);
	color: var(--color-primary);
}

/* ==========================================
   Post Navigation (Prev/Next)
   ========================================== */

.post-navigation {
	background-color: var(--color-bg-cloud);
	padding: 3rem 0;
	margin: 3rem 0;
}

.nav-links {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.nav-links {
		grid-template-columns: repeat(2, 1fr);
	}
}

.nav-previous,
.nav-next {
	padding: 1.5rem;
	background-color: var(--color-bg-white);
	border-radius: 0.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: box-shadow var(--transition-fast);
}

.nav-previous:hover,
.nav-next:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-subtitle {
	display: block;
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	margin-bottom: 0.5rem;
}

.nav-previous a,
.nav-next a {
	color: var(--color-primary);
	font-weight: 600;
	text-decoration: none;
}

.nav-previous a:hover,
.nav-next a:hover {
	color: var(--color-accent-copper);
}

/* ==========================================
   Archive Pages
   ========================================== */

.archive-header,
.page-header {
	margin-bottom: 3rem;
	padding-bottom: 1.5rem;
	border-bottom: 2px solid var(--color-border-light);
}

.archive-title,
.page-title {
	margin-bottom: 1rem;
}

.archive-description {
	color: var(--color-text-secondary);
	font-size: 1.125rem;
}

/* ==========================================
   Pagination
   ========================================== */

.pagination {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin: 3rem 0;
}

.page-numbers {
	padding: 0.5rem 1rem;
	background-color: var(--color-bg-white);
	border: 1px solid var(--color-border-light);
	color: var(--color-text-primary);
	text-decoration: none;
	border-radius: 0.25rem;
	transition: all var(--transition-fast);
}

.page-numbers:hover,
.page-numbers.current {
	background-color: var(--color-primary);
	color: var(--color-bg-white);
	border-color: var(--color-primary);
}

.page-numbers.dots {
	border: none;
	background: none;
}

/* ==========================================
   Forms
   ========================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
	width: 100%;
	padding: 0.75rem 1rem;
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--color-text-primary);
	background-color: var(--color-bg-white);
	border: 1px solid var(--color-border-medium);
	border-radius: 0.5rem;
	transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(27, 107, 117, 0.1);
}

textarea {
	min-height: 150px;
	resize: vertical;
}

label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--color-text-primary);
}

.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 600px;
}

.search-form input[type="search"] {
	flex-grow: 1;
}

.search-form button,
.search-form input[type="submit"] {
	flex-shrink: 0;
}

/* ==========================================
   Section Spacing
   ========================================== */

.latest-posts-section,
.related-posts-section {
	padding: 4rem 0;
}

@media (min-width: 768px) {
	.latest-posts-section,
	.related-posts-section {
		padding: 6rem 0;
	}
}

.section-heading {
	font-size: 2rem;
	margin-bottom: 3rem;
	text-align: center;
}

.view-all-posts {
	text-align: center;
	margin-top: 2rem;
}

/* ==========================================
   404 Error Page
   ========================================== */

.error-404-content {
	text-align: center;
	padding: 4rem 0;
}

.error-404-search {
	max-width: 600px;
	margin: 2rem auto;
}

.error-404-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem;
	margin-top: 2rem;
}

/* ==========================================
   Search Results
   ========================================== */

.search-results-list {
	margin-bottom: 3rem;
}

.search-result {
	padding: 2rem 0;
	border-bottom: 1px solid var(--color-border-light);
}

.search-result:last-child {
	border-bottom: none;
}

.search-result .entry-title {
	margin-bottom: 0.5rem;
}

.search-result .entry-title a {
	color: var(--color-primary);
	text-decoration: none;
}

.search-result .entry-title a:hover {
	color: var(--color-accent-copper);
}

.search-result .entry-summary {
	color: var(--color-text-secondary);
}

/* ==========================================
   WordPress Core Alignment Classes
   ========================================== */

.alignleft {
	float: left;
	margin-right: 1.5rem;
	margin-bottom: 1rem;
}

.alignright {
	float: right;
	margin-left: 1.5rem;
	margin-bottom: 1rem;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1rem;
}

.alignwide,
.alignfull {
	max-width: 100%;
}

/* ==========================================
   Accessibility
   ========================================== */

:focus-visible {
	outline: 2px solid var(--color-accent-copper);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
