/**
 * DarkBlog main stylesheet.
 *
 * 1. Tokens & reset
 * 2. Base typography & utilities
 * 3. Header & navigation
 * 4. Hero & homepage
 * 5. Post cards & grids
 * 6. Page layouts, breadcrumbs, pagination
 * 7. Sidebar widgets
 * 8. Single post & comments
 * 9. Footer
 * 10. Error pages
 * 11. Responsive
 */

/* 1. Tokens & reset
-------------------------------------------------------------- */
:root {
	--bg: #0a0c11;
	--bg-soft: #0e1118;
	--surface: #131824;
	--surface-2: #1a2130;
	--border: rgba(255, 255, 255, 0.08);
	--border-strong: rgba(255, 255, 255, 0.16);
	--text: #e9edf5;
	--text-soft: #c7cede;
	--muted: #8b95ab;
	--accent: #ff4d2e;
	--accent-2: #ffa41b;
	--gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
	--container: 1200px;
	--sidebar: 340px;
	--header-h: 72px;
	--font: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
	margin: 0;
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.75;
	background: var(--bg);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.landing-page {
	background: var(--bg);
}

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

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

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

button {
	font-family: inherit;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

::selection {
	background: var(--accent);
	color: #fff;
}

/* 2. Base typography & utilities
-------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.6em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--text);
}

p {
	margin: 0 0 1.1em;
}

.container {
	width: min(100% - 2.5rem, var(--container));
	margin-inline: auto;
}

.container--wide {
	width: min(100% - 2.5rem, 1400px);
}

.site-main {
	min-height: 40vh;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.8rem 1.6rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
	background: var(--gradient);
	color: #fff;
	box-shadow: 0 8px 24px rgba(255, 77, 46, 0.3);
}

.btn-primary:hover {
	color: #fff;
	transform: translateY(-2px);
	filter: brightness(1.06);
}

.btn-outline {
	border-color: var(--border-strong);
	color: var(--text);
}

.btn-outline:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.btn-block {
	width: 100%;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background: var(--surface);
	border-radius: 4px;
	clip: auto !important;
	clip-path: none;
	color: var(--text);
	display: block;
	font-size: 0.9rem;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: var(--accent);
	color: #fff;
	border-radius: 0 0 10px 0;
}

.skip-link:focus {
	left: 0;
	color: #fff;
}

/* 3. Header & navigation
-------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(10, 12, 17, 0.82);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--border);
	transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 2rem;
	height: var(--header-h);
}

.site-branding {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.site-branding .custom-logo-link {
	display: inline-flex;
}

.site-branding .custom-logo {
	max-height: 44px;
	width: auto;
}

.site-title {
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--text);
	white-space: nowrap;
}

.site-title:hover {
	color: var(--text);
}

.brand-dot {
	color: var(--accent);
}

.main-navigation {
	margin-left: auto;
}

.menu {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu > li {
	position: relative;
}

.menu > li > a {
	display: block;
	padding: 0.55rem 0.9rem;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--text-soft);
}

.menu > li > a:hover,
.menu > li.current-menu-item > a,
.menu > li.current-menu-ancestor > a {
	color: var(--text);
	background: var(--surface);
}

.sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	z-index: 20;
}

.menu li:hover > .sub-menu,
.menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.sub-menu a {
	display: block;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	font-size: 0.9rem;
	color: var(--text-soft);
}

.sub-menu a:hover {
	background: var(--surface-2);
	color: var(--text);
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--text);
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.menu-toggle {
	display: none;
}

.search-overlay {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	padding: 1.25rem 0;
	background: var(--bg-soft);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.search-overlay[hidden] {
	display: none;
}

.search-overlay-inner {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.search-form {
	position: relative;
	display: flex;
	flex: 1;
}

.search-field {
	width: 100%;
	padding: 0.85rem 3.2rem 0.85rem 1.1rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--text);
	font-family: inherit;
	font-size: 1rem;
	outline: none;
	transition: border-color 0.2s ease;
}

.search-field:focus {
	border-color: var(--accent);
}

.search-field::placeholder {
	color: var(--muted);
}

.search-submit {
	position: absolute;
	top: 50%;
	right: 0.4rem;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 10px;
	color: var(--muted);
	cursor: pointer;
	transition: color 0.2s ease;
}

.search-submit:hover {
	color: var(--accent);
}

/* 4. Hero & homepage
-------------------------------------------------------------- */
.hero {
	position: relative;
	overflow: hidden;
	padding: 5rem 0 4.25rem;
	border-bottom: 1px solid var(--border);
	background:
		radial-gradient(60% 80% at 15% 10%, rgba(255, 77, 46, 0.16), transparent 60%),
		radial-gradient(50% 70% at 90% 20%, rgba(255, 164, 27, 0.12), transparent 55%),
		var(--bg-soft);
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 44px 44px;
	mask-image: radial-gradient(70% 60% at 50% 30%, #000 35%, transparent 100%);
	-webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 35%, transparent 100%);
}

.hero--image {
	background-image: linear-gradient(180deg, rgba(10, 12, 17, 0.62), var(--bg-soft)), var(--hero-image);
	background-size: cover;
	background-position: center;
}

.hero-inner {
	position: relative;
	z-index: 1;
	max-width: 820px;
}

.hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
	padding: 0.45rem 1rem;
	background: rgba(255, 77, 46, 0.12);
	border: 1px solid rgba(255, 77, 46, 0.35);
	border-radius: 999px;
	color: #ffb7a8;
	font-size: 0.85rem;
	font-weight: 600;
}

.hero-title {
	margin: 0 0 1rem;
	font-size: clamp(2.1rem, 5vw, 3.6rem);
	font-weight: 800;
	line-height: 1.15;
}

.hero-desc {
	margin: 0 0 2rem;
	max-width: 640px;
	font-size: 1.15rem;
	color: var(--muted);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.category-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 2.25rem;
	margin-bottom: -0.75rem;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1.05rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text-soft);
	font-size: 0.9rem;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.pill:hover {
	background: rgba(255, 77, 46, 0.08);
	border-color: var(--accent);
	color: var(--accent);
}

.pill-count {
	padding: 0.1rem 0.5rem;
	background: var(--surface-2);
	border-radius: 999px;
	color: var(--muted);
	font-size: 0.75rem;
}

.section {
	padding: 3.5rem 0;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.section-title {
	position: relative;
	margin: 0;
	padding-left: 1rem;
	font-size: 1.6rem;
}

.section-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	bottom: 0.2em;
	width: 4px;
	background: var(--gradient);
	border-radius: 99px;
}

.section-link {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--accent);
	white-space: nowrap;
}

/* 5. Post cards & grids
-------------------------------------------------------------- */
.hero-card {
	position: relative;
	margin-bottom: 1.75rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hero-card:hover {
	border-color: rgba(255, 77, 46, 0.5);
	box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}

.hero-card-link {
	position: relative;
	display: block;
	min-height: 430px;
	color: var(--text);
}

.hero-card-link:hover {
	color: var(--text);
}

.hero-card-link > img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.hero-card:hover .hero-card-link > img {
	transform: scale(1.03);
}

.hero-card-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	opacity: 0.35;
	background:
		radial-gradient(60% 80% at 20% 10%, rgba(255, 77, 46, 0.25), transparent 60%),
		radial-gradient(50% 70% at 85% 25%, rgba(255, 164, 27, 0.18), transparent 60%),
		var(--surface-2);
}

.hero-card-content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 430px;
	padding: 2rem;
	background: linear-gradient(180deg, transparent 15%, rgba(6, 8, 12, 0.94) 88%);
}

.hero-card-content .card-cat {
	position: static;
	align-self: flex-start;
	margin-bottom: 0.8rem;
}

.hero-card-title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.4rem, 3vw, 2.1rem);
	line-height: 1.3;
}

.hero-card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 1rem;
	color: var(--text-soft);
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem;
}

.post-grid--3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 77, 46, 0.45);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--surface-2);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.post-card:hover .card-media img {
	transform: scale(1.05);
}

.card-media-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--muted);
	opacity: 0.4;
	background:
		radial-gradient(60% 80% at 20% 10%, rgba(255, 77, 46, 0.16), transparent 60%),
		var(--surface-2);
}

.card-cat {
	position: absolute;
	top: 0.9rem;
	left: 0.9rem;
	padding: 0.3rem 0.7rem;
	background: var(--gradient);
	border-radius: 999px;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.card-body {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	flex: 1;
	padding: 1.25rem 1.35rem 1.4rem;
}

.card-title {
	margin: 0;
	font-size: 1.12rem;
	line-height: 1.45;
}

.card-title a {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-title a:hover {
	color: var(--accent);
}

.card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.card-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: auto;
	color: var(--muted);
	font-size: 0.8rem;
}

.meta-sep {
	opacity: 0.5;
}

/* 6. Page layouts, breadcrumbs, pagination
-------------------------------------------------------------- */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--sidebar);
	gap: 2.75rem;
	align-items: start;
	padding-bottom: 4rem;
}

.content-area {
	min-width: 0;
}

.breadcrumbs {
	padding-top: 1.5rem;
	font-size: 0.82rem;
	color: var(--muted);
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.breadcrumbs li {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
	content: "/";
	opacity: 0.4;
}

.breadcrumbs a:hover {
	color: var(--accent);
}

.breadcrumbs [aria-current="page"] {
	color: var(--text-soft);
}

.page-header {
	padding: 1.5rem 0 2rem;
}

.page-title {
	margin: 0;
	font-size: clamp(1.7rem, 3vw, 2.4rem);
	line-height: 1.25;
}

.page-desc {
	margin: 0.5rem 0 0;
	max-width: 720px;
	color: var(--muted);
}

.pagination {
	margin-top: 2.5rem;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 0.8rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text-soft);
	font-size: 0.9rem;
}

a.page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.page-numbers.current {
	background: var(--gradient);
	border-color: transparent;
	color: #fff;
	font-weight: 700;
}

.page-numbers.dots {
	background: none;
	border: none;
}

/* 7. Sidebar widgets
-------------------------------------------------------------- */
.widget-area {
	position: sticky;
	top: calc(var(--header-h) + 24px);
	display: grid;
	gap: 1.5rem;
}

.widget {
	padding: 1.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.widget-title {
	position: relative;
	margin: 0 0 1rem;
	padding-left: 0.85rem;
	font-size: 1.05rem;
}

.widget-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.25em;
	bottom: 0.25em;
	width: 3px;
	background: var(--gradient);
	border-radius: 99px;
}

.widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.55rem;
}

.widget li {
	color: var(--text-soft);
	font-size: 0.93rem;
	line-height: 1.55;
}

.widget li a {
	color: var(--text-soft);
}

.widget li a:hover {
	color: var(--accent);
}

.widget li ul {
	margin-top: 0.55rem;
	padding-left: 1rem;
}

.widget .search-form {
	max-width: 100%;
}

.popular-list li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.popular-index {
	min-width: 1.4rem;
	color: var(--accent);
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.6;
	opacity: 0.85;
}

.popular-title {
	display: block;
	color: var(--text) !important;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.5;
}

.popular-title:hover {
	color: var(--accent) !important;
}

.popular-meta {
	color: var(--muted);
	font-size: 0.78rem;
}

.widget .tag-cloud-link,
.wp-block-tag-cloud a {
	display: inline-flex;
	margin: 0 0.35rem 0.35rem 0;
	padding: 0.35rem 0.8rem;
	background: var(--surface-2);
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--text-soft);
	font-size: 0.8rem !important;
}

.widget .tag-cloud-link:hover,
.wp-block-tag-cloud a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.widget_calendar table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.widget_calendar caption {
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.widget_calendar td,
.widget_calendar th {
	padding: 0.3rem;
	text-align: center;
}

.cta-box {
	padding: 1.75rem;
	text-align: center;
	background:
		linear-gradient(160deg, rgba(255, 77, 46, 0.16), rgba(255, 164, 27, 0.06)),
		var(--surface);
	border: 1px solid rgba(255, 77, 46, 0.32);
	border-radius: var(--radius);
}

.cta-box h3 {
	margin: 0 0 0.5rem;
	font-size: 1.15rem;
}

.cta-box p {
	margin: 0 0 1.25rem;
	color: var(--muted);
	font-size: 0.92rem;
}

/* 8. Single post & comments
-------------------------------------------------------------- */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 300;
	pointer-events: none;
}

.reading-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--gradient);
}

.entry-header {
	padding: 1rem 0 1.75rem;
}

.entry-cat {
	display: inline-flex;
	margin-bottom: 1rem;
	padding: 0.3rem 0.8rem;
	background: rgba(255, 77, 46, 0.12);
	border: 1px solid rgba(255, 77, 46, 0.32);
	border-radius: 999px;
	color: #ffb7a8;
	font-size: 0.8rem;
	font-weight: 600;
}

.entry-cat:hover {
	background: var(--accent);
	color: #fff;
}

.entry-title {
	margin: 0 0 1.1rem;
	font-size: clamp(1.9rem, 4vw, 2.9rem);
	line-height: 1.25;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	color: var(--muted);
	font-size: 0.88rem;
}

.entry-author {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text-soft);
}

.entry-author img {
	border-radius: 50%;
}

.entry-comments-link:hover {
	color: var(--accent);
}

.entry-thumbnail {
	margin: 0 0 2rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.entry-thumbnail img {
	width: 100%;
}

.entry-content {
	color: var(--text-soft);
	font-size: 1.05rem;
	line-height: 1.85;
	overflow-wrap: break-word;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h2 {
	margin: 2.2em 0 0.8em;
	font-size: 1.6rem;
	color: var(--text);
}

.entry-content h3 {
	margin: 1.8em 0 0.6em;
	font-size: 1.3rem;
	color: var(--text);
}

.entry-content h4 {
	margin: 1.6em 0 0.5em;
	font-size: 1.12rem;
	color: var(--text);
}

.entry-content a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-color: rgba(255, 77, 46, 0.4);
	text-underline-offset: 3px;
}

.entry-content a:hover {
	text-decoration-color: var(--accent);
}

.entry-content blockquote {
	margin: 1.8em 0;
	padding: 1.2rem 1.5rem;
	background: var(--surface);
	border-left: 3px solid var(--accent);
	border-radius: 0 12px 12px 0;
	color: var(--text);
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content pre {
	padding: 1.2rem;
	background: #0d1017;
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: auto;
	font-size: 0.9rem;
	line-height: 1.6;
}

.entry-content code {
	padding: 0.15em 0.4em;
	background: var(--surface-2);
	border-radius: 6px;
	color: #ffc2b8;
	font-size: 0.9em;
}

.entry-content pre code {
	padding: 0;
	background: none;
	color: #d6deee;
}

.entry-content table {
	width: 100%;
	margin: 1.5em 0;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

.entry-content th {
	background: var(--surface);
	color: var(--text);
}

.entry-content img {
	border-radius: 12px;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4rem;
}

.entry-content li {
	margin: 0.35em 0;
}

.entry-content figcaption {
	margin-top: 0.5rem;
	color: var(--muted);
	font-size: 0.85rem;
	text-align: center;
}

.entry-content iframe,
.entry-content video,
.entry-content embed {
	max-width: 100%;
}

.entry-content .alignwide {
	margin-left: -3rem;
	margin-right: -3rem;
	max-width: none;
}

.entry-content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.entry-content .wp-block-image img {
	border-radius: 12px;
}

.page-links {
	margin-top: 1.5rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.page-links a {
	color: var(--accent);
}

.entry-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.entry-tags a {
	display: inline-flex;
	padding: 0.3rem 0.75rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--text-soft);
	font-size: 0.78rem;
}

.entry-tags a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.share-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.share-label {
	margin-right: 0.25rem;
	color: var(--muted);
	font-size: 0.85rem;
}

.share-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text-soft);
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.share-link:hover {
	background: var(--accent);
	border-color: transparent;
	color: #fff;
}

.share-facebook:hover {
	background: #1877f2;
}

.share-x:hover {
	background: #000;
	border-color: #333;
}

.share-line:hover {
	background: #06c755;
}

.copy-link.copied {
	background: #1db954;
	border-color: transparent;
	color: #fff;
}

.author-box {
	display: flex;
	gap: 1.25rem;
	margin-top: 2.5rem;
	padding: 1.75rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.author-avatar {
	flex-shrink: 0;
}

.author-avatar img {
	border: 2px solid var(--border);
	border-radius: 50%;
}

.author-name {
	margin: 0 0 0.4rem;
	font-size: 1.1rem;
}

.author-info p {
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.author-link {
	color: var(--accent);
	font-size: 0.88rem;
	font-weight: 600;
}

.related-posts {
	margin-top: 3rem;
}

.related-posts .section-title {
	margin: 0 0 1.5rem;
}

.comments-area {
	margin-top: 3rem;
	padding: 2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.comments-title {
	margin: 0 0 1.5rem;
	font-size: 1.3rem;
}

.comment-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	margin: 0;
	padding-left: 1.5rem;
	list-style: none;
}

.comment-list > li {
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--border);
}

.comment-list > li:last-child {
	border-bottom: 0;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 600;
	color: var(--text);
}

.comment-author img {
	border-radius: 50%;
}

.comment-metadata {
	margin: 0.25rem 0 0.75rem;
	color: var(--muted);
	font-size: 0.8rem;
}

.comment-metadata a {
	color: var(--muted);
}

.comment-content {
	color: var(--text-soft);
	font-size: 0.95rem;
}

.comment-content p:last-child {
	margin-bottom: 0;
}

.reply a {
	display: inline-block;
	margin-top: 0.5rem;
	color: var(--accent);
	font-size: 0.8rem;
	font-weight: 600;
}

.no-comments {
	color: var(--muted);
	font-size: 0.92rem;
}

.comment-respond {
	margin-top: 2rem;
}

.comment-reply-title {
	margin: 0 0 1rem;
	font-size: 1.2rem;
}

.comment-reply-title small {
	font-size: 0.8rem;
	font-weight: 400;
}

.comment-form {
	display: grid;
	gap: 1rem;
}

.comment-form p {
	margin: 0;
}

.comment-form label {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--muted);
	font-size: 0.85rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--bg-soft);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	font-family: inherit;
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--accent);
}

.comment-form input[type="submit"] {
	padding: 0.8rem 1.8rem;
	background: var(--gradient);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.comment-form input[type="submit"]:hover {
	filter: brightness(1.06);
}

.comment-notes,
.logged-in-as,
.comment-form-cookies-consent {
	color: var(--muted);
	font-size: 0.82rem;
}

.comment-form-cookies-consent {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.comment-form-cookies-consent label {
	margin: 0;
}

.comment-navigation .nav-links {
	justify-content: space-between;
}

/* 9. Footer
-------------------------------------------------------------- */
.site-footer {
	margin-top: 4rem;
	background: var(--bg-soft);
	border-top: 1px solid var(--border);
}

.footer-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem;
	padding: 3.5rem 0 2.5rem;
}

.footer-brand {
	flex: 1.4 1 280px;
	min-width: 240px;
}

.footer-brand .custom-logo-link {
	display: inline-flex;
	margin-bottom: 1rem;
}

.footer-brand .custom-logo {
	max-height: 44px;
	width: auto;
}

.footer-site-name {
	margin: 0 0 0.75rem;
	font-size: 1.3rem;
	font-weight: 800;
}

.footer-desc {
	max-width: 320px;
	margin: 0 0 1.25rem;
	color: var(--muted);
	font-size: 0.92rem;
}

.footer-col {
	flex: 1 1 180px;
	min-width: 160px;
}

.site-footer .widget {
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}

.site-footer .widget-title {
	margin-bottom: 0.85rem;
	font-size: 0.95rem;
}

.site-footer .widget ul {
	gap: 0.45rem;
}

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text-soft);
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
	background: var(--accent);
	border-color: transparent;
	color: #fff;
	transform: translateY(-2px);
}

.footer-bottom {
	padding: 1.25rem 0;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.85rem;
}

.footer-bottom-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.footer-copy {
	margin: 0;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-menu a {
	color: var(--muted);
}

.footer-menu a:hover {
	color: var(--accent);
}

.to-top {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 90;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--gradient);
	border: 0;
	border-radius: 12px;
	box-shadow: var(--shadow);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.to-top.show {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* 10. Error pages & empty states
-------------------------------------------------------------- */
.error-404 {
	max-width: 640px;
	margin: 0 auto;
	padding: 4.5rem 0 2rem;
	text-align: center;
}

.error-code {
	margin: 0;
	font-size: clamp(4.5rem, 12vw, 8rem);
	font-weight: 800;
	line-height: 1;
	background: var(--gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.error-desc {
	margin: 0.75rem auto 1.75rem;
	max-width: 460px;
	color: var(--muted);
}

.error-actions {
	display: flex;
	justify-content: center;
	margin-bottom: 2rem;
}

.error-search,
.no-results-search {
	max-width: 480px;
	margin: 0 auto;
}

.no-results {
	padding: 2rem 0 1rem;
}

.no-results .page-title {
	margin-bottom: 0.75rem;
}

/* Landing template
-------------------------------------------------------------- */
.landing-main {
	min-height: 100vh;
}

.entry-content--landing > * {
	margin-top: 0;
}

.entry--fullwidth .entry-header {
	padding-top: 2rem;
}

/* 11. Responsive
-------------------------------------------------------------- */
@media (max-width: 1100px) {
	:root {
		--sidebar: 300px;
	}
}

@media (max-width: 1024px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.widget-area {
		position: static;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.post-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 960px) {
	.menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 42px;
		height: 42px;
		padding: 0;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 12px;
		color: var(--text);
		cursor: pointer;
	}

	.main-navigation {
		position: static;
		margin-left: auto;
	}

	.main-navigation .menu {
		position: fixed;
		top: var(--header-h);
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0.15rem;
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
		margin: 0;
		padding: 1rem 1.25rem 1.5rem;
		background: var(--bg-soft);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		z-index: 99;
	}

	.main-navigation.toggled .menu {
		display: flex;
	}

	.menu > li > a {
		padding: 0.8rem 1rem;
		border-radius: 10px;
	}

	.sub-menu {
		position: static;
		min-width: 0;
		padding-left: 1rem;
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.header-inner {
		gap: 1rem;
	}
}

@media (max-width: 768px) {
	.hero {
		padding: 3.75rem 0 3rem;
	}

	.hero-card-link,
	.hero-card-content {
		min-height: 360px;
	}

	.footer-grid {
		padding: 2.75rem 0 2rem;
	}

	.comments-area {
		padding: 1.5rem;
	}

	.author-box {
		flex-direction: column;
	}

	.entry-content .alignwide {
		margin-left: 0;
		margin-right: 0;
	}
}

@media (max-width: 640px) {
	:root {
		--header-h: 64px;
	}

	.site-title {
		font-size: 1.2rem;
	}

	.site-branding .custom-logo {
		max-height: 36px;
	}

	.post-grid,
	.post-grid--3,
	.widget-area {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero {
		padding: 3rem 0 2.5rem;
	}

	.hero-card-link,
	.hero-card-content {
		min-height: 320px;
	}

	.hero-card-content {
		padding: 1.4rem;
	}

	.section {
		padding: 2.5rem 0;
	}

	.section-head {
		flex-wrap: wrap;
	}

	.layout {
		gap: 2rem;
	}

	.entry-footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-bottom-inner {
		justify-content: center;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
