/*
Theme Name: FlexBlog
Theme URI: https://example.com/flexblog/
Author: FlexBlog
Author URI: https://example.com/
Description: FlexBlog is a premium, niche-agnostic blog theme. Editorial typography, cinematic hero, card-based homepage with grid or list layouts, refined single-post reading experience, and AdSense-ready widget areas. All design options live in the WordPress Customizer under "FlexBlog Settings" — no code edits needed to rebrand it for any niche.
Version: 2.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flexblog
Tags: blog, customizer, responsive, grid-layout, translation-ready
*/

/* ============================================================
   FlexBlog 2.0.0 — premium editorial design (mobile-first)
   Breakpoints: 360px phones (base) · 768px tablets · 1024px+ desktop
   ============================================================ */
:root {
	--accent: #2563eb; /* overridden by Customizer "Accent Color" */
	--accent-soft: #eef4ff; /* tinted below with color-mix when supported */
	--accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
	--accent-ink: #1e40af;
	--accent-ink: color-mix(in srgb, var(--accent) 78%, #0b1526);
	--ink: #0d1b2e;
	--text: #33415c;
	--muted: #64748f;
	--bg: #ffffff;
	--surface: #f5f7fb;
	--border: #e5eaf2;
	--footer-bg: #0a1424;
	--footer-text: #b9c4d6;
	--radius: 18px;
	--radius-sm: 10px;
	--max-width: 1180px;
	--shadow-sm: 0 1px 2px rgba(13, 27, 46, 0.05);
	--shadow-card: 0 1px 2px rgba(13, 27, 46, 0.05), 0 10px 30px -12px rgba(13, 27, 46, 0.14);
	--shadow-lift: 0 2px 6px rgba(13, 27, 46, 0.06), 0 24px 48px -16px rgba(13, 27, 46, 0.24);
	--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
	--font-head: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "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;
	overflow-x: clip;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {
	body { font-size: 16.5px; }
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	color: var(--ink);
	line-height: 1.22;
	letter-spacing: -0.02em;
	margin: 1.5em 0 0.65em;
	font-weight: 800;
	overflow-wrap: break-word;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.08rem; }
@media (min-width: 768px) {
	h1 { font-size: 2.15rem; }
	h2 { font-size: 1.7rem; }
	h3 { font-size: 1.35rem; }
}

p { margin: 0 0 1.15em; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-ink); text-decoration: underline; }

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

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

pre {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	background: #0d1b2e;
	color: #e6edf7;
	border-radius: var(--radius-sm);
	padding: 16px 18px;
	font-size: 0.87rem;
	line-height: 1.6;
	max-width: 100%;
}
code { overflow-wrap: break-word; }
.entry-content p code, .entry-content li code {
	background: var(--accent-soft);
	color: var(--accent-ink);
	padding: 2px 7px;
	border-radius: 6px;
	font-size: 0.88em;
}

.screen-reader-text {
	position: absolute; width: 1px; height: 1px;
	overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 9999;
	background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px;
	clip: auto; width: auto; height: auto; text-decoration: none;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container {
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding-left: 18px;
	padding-right: 18px;
}
@media (min-width: 768px) {
	.container { padding-left: 28px; padding-right: 28px; }
}

/* ============ Reading progress bar (single posts) ============ */
.reading-progress {
	position: fixed;
	top: 0; left: 0; right: 0;
	height: 3px;
	z-index: 500;
	background: transparent;
	pointer-events: none;
}
.reading-progress span {
	display: block;
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, var(--accent), var(--accent-ink));
	border-radius: 0 3px 3px 0;
	transition: width 0.08s linear;
}

/* ============ Header ============ */
.site-header {
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	z-index: 100;
	transition: box-shadow 0.25s ease;
}
body.sticky-header .site-header {
	position: sticky;
	top: 0;
}
.site-header.is-scrolled {
	box-shadow: 0 6px 24px -8px rgba(13, 27, 46, 0.16);
}
.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding-top: 12px;
	padding-bottom: 12px;
	min-height: 72px;
}
.site-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-branding .custom-logo { max-height: 46px; width: auto; }
.site-title-wrap { min-width: 0; }
.site-title {
	font-family: var(--font-head);
	font-size: 1.35rem;
	font-weight: 800;
	margin: 0;
	letter-spacing: -0.03em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.15;
}
.site-title a { color: var(--ink); text-decoration: none; }
.site-title a:hover { color: var(--accent); text-decoration: none; }
.site-tagline {
	margin: 3px 0 0;
	font-size: 0.78rem;
	color: var(--muted);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Hamburger button — 44px tap target */
.menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	min-width: 44px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 8px 14px;
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease;
}
.menu-toggle:hover { border-color: var(--accent); }
.menu-toggle .menu-icon { font-size: 1.25rem; line-height: 1; }

/* Slide-in drawer (mobile / tablet) */
.nav-overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 20, 36, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	z-index: 290;
}
body.nav-open .nav-overlay {
	opacity: 1;
	visibility: visible;
}
.main-navigation {
	position: fixed;
	top: 0;
	right: 0;
	height: 100dvh;
	width: min(330px, 88vw);
	background: var(--bg);
	z-index: 300;
	transform: translateX(103%);
	transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
	overflow-y: auto;
	padding: 14px 0 32px;
	box-shadow: -12px 0 40px rgba(13, 27, 46, 0.18);
	border-radius: 20px 0 0 20px;
}
body.nav-open .main-navigation { transform: translateX(0); }
.drawer-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 14px 10px auto;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 50%;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--ink);
	cursor: pointer;
}
.drawer-close:hover { border-color: var(--accent); color: var(--accent); }
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-navigation a {
	display: flex;
	align-items: center;
	min-height: 50px;
	padding: 10px 24px;
	color: var(--ink);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	border-bottom: 1px solid var(--surface);
}
.main-navigation a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* Desktop nav (1024px+) */
@media (min-width: 1024px) {
	.menu-toggle { display: none; }
	.drawer-close { display: none; }
	.nav-overlay { display: none; }
	.main-navigation {
		position: static;
		height: auto;
		width: auto;
		transform: none;
		transition: none;
		overflow: visible;
		padding: 0;
		box-shadow: none;
		background: transparent;
		border-radius: 0;
	}
	.main-navigation ul { display: flex; align-items: center; gap: 2px; }
	.main-navigation a {
		position: relative;
		min-height: 44px;
		padding: 10px 15px;
		border-bottom: 0;
		font-size: 0.94rem;
		font-weight: 600;
		color: var(--text);
		border-radius: 8px;
	}
	.main-navigation a::after {
		content: "";
		position: absolute;
		left: 15px; right: 15px; bottom: 6px;
		height: 2.5px;
		border-radius: 2px;
		background: var(--accent);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.25s ease;
	}
	.main-navigation a:hover { background: transparent; color: var(--accent-ink); text-decoration: none; }
	.main-navigation a:hover::after { transform: scaleX(1); }
	.main-navigation .current-menu-item > a,
	.main-navigation .current_page_item > a { color: var(--accent-ink); }
	.main-navigation .current-menu-item > a::after,
	.main-navigation .current_page_item > a::after { transform: scaleX(1); }
}

/* ============ Ad widget areas ============ */
.ad-area { margin: 26px 0; text-align: center; }
.ad-area:empty { display: none; }

/* ============ Layout (content + sidebar) ============ */
.site-content { padding: 28px 0 48px; }
@media (min-width: 768px) {
	.site-content { padding: 40px 0 64px; }
}
.layout { display: flex; flex-direction: column; gap: 30px; }
.sidebar .widget {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px;
	margin-bottom: 22px;
	box-shadow: var(--shadow-sm);
}
.sidebar .widget:last-child { margin-bottom: 0; }
.widget-title {
	font-size: 1rem;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--border);
	position: relative;
}
.widget-title::after {
	content: "";
	position: absolute;
	left: 0; bottom: -2px;
	width: 38px; height: 2px;
	background: var(--accent);
	border-radius: 2px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.93rem; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--text); overflow-wrap: break-word; }
.sidebar a:hover { color: var(--accent); text-decoration: none; }

/* Desktop: sidebar beside content (1024px+) */
@media (min-width: 1024px) {
	.layout { gap: 36px; }
	body.sidebar-right .layout { flex-direction: row; align-items: flex-start; }
	body.sidebar-left .layout { flex-direction: row-reverse; align-items: flex-start; }
	body.sidebar-right .primary,
	body.sidebar-left .primary { flex: 1 1 0; min-width: 0; }
	body.sidebar-right .sidebar,
	body.sidebar-left .sidebar { flex: 0 0 330px; position: sticky; top: 96px; }
}

/* ============ Section heading (homepage) ============ */
.section-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 6px 0 22px;
}
.section-head h2 {
	font-size: 1.35rem;
	margin: 0;
	letter-spacing: -0.02em;
}
.section-head .bar {
	width: 34px; height: 4px;
	background: linear-gradient(90deg, var(--accent), var(--accent-ink));
	border-radius: 3px;
	flex-shrink: 0;
}
.section-head .rule {
	flex: 1;
	height: 1px;
	background: var(--border);
}

/* ============ Hero (featured post) ============ */
.hero-post {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	margin-bottom: 34px;
	background: #0d1b2e;
	color: #fff;
	min-height: 380px;
	display: flex;
	align-items: flex-end;
	box-shadow: var(--shadow-lift);
}
.hero-post .hero-bg { position: absolute; inset: 0; }
.hero-post .hero-bg img {
	width: 100%; height: 100%; object-fit: cover;
	transform: scale(1.02);
}
.hero-post::after {
	content: "";
	position: absolute; inset: 0;
	background:
		linear-gradient(180deg, rgba(8, 15, 28, 0.05) 20%, rgba(8, 15, 28, 0.55) 58%, rgba(8, 15, 28, 0.92) 100%),
		linear-gradient(100deg, rgba(8, 15, 28, 0.55) 0%, rgba(8, 15, 28, 0) 55%);
	pointer-events: none;
}
.hero-post .hero-content {
	position: relative;
	z-index: 1;
	padding: 28px 22px;
	max-width: 760px;
	width: 100%;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hero-badge {
	display: inline-flex;
	align-items: center;
	background: var(--accent);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 6px 13px;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.hero-cat {
	display: inline-flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.14);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 6px 13px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-post h2 {
	margin: 0 0 12px;
	font-size: clamp(1.5rem, 1.05rem + 4.2vw, 2.4rem);
	line-height: 1.14;
	letter-spacing: -0.03em;
	color: #fff;
	text-wrap: balance;
}
.hero-post h2 a { color: #fff; text-decoration: none; }
.hero-post h2 a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.hero-post .hero-excerpt {
	color: #dbe4f0;
	margin-bottom: 18px;
	font-size: clamp(0.94rem, 0.88rem + 1vw, 1.05rem);
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.hero-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--accent);
	color: #fff !important;
	font-weight: 700;
	font-size: 0.92rem;
	padding: 12px 22px;
	border-radius: 999px;
	text-decoration: none !important;
	box-shadow: 0 8px 22px -6px var(--accent);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -6px var(--accent); background: var(--accent-ink); color: #fff !important; }
.hero-btn .arrow { transition: transform 0.2s ease; }
.hero-btn:hover .arrow { transform: translateX(4px); }
.hero-meta { font-size: 0.84rem; color: #c3cede; font-weight: 500; }
.hero-meta a { color: #fff; font-weight: 600; }
@media (min-width: 768px) {
	.hero-post { min-height: 460px; margin-bottom: 40px; }
	.hero-post .hero-content { padding: 40px 38px; }
}

/* ============ Post grid / list ============ */
.post-grid {
	display: grid;
	gap: 22px;
	grid-template-columns: 1fr;
	margin-bottom: 32px;
}
@media (min-width: 768px) {
	body.layout-grid .post-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
}
@media (min-width: 1024px) {
	body.layout-grid .post-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-width: 0;
	box-shadow: var(--shadow-sm);
	transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.post-card:hover {
	box-shadow: var(--shadow-lift);
	transform: translateY(-5px);
	border-color: #d5dde9;
}
.post-card .card-thumb {
	aspect-ratio: 16/10;
	background: linear-gradient(135deg, var(--surface), #e8edf5);
	overflow: hidden;
	position: relative;
}
.post-card .card-thumb img {
	width: 100%; height: 100%; object-fit: cover;
	transition: transform 0.55s cubic-bezier(0.32, 0.72, 0, 1);
}
.post-card:hover .card-thumb img { transform: scale(1.07); }
.post-card .card-body {
	padding: 20px 20px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}
.post-card .card-cat {
	display: inline-flex;
	align-self: flex-start;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--accent-ink);
	background: var(--accent-soft);
	padding: 5px 11px;
	border-radius: 999px;
	margin-bottom: 12px;
}
.post-card h2 {
	font-size: 1.14rem;
	margin: 0 0 9px;
	line-height: 1.38;
	letter-spacing: -0.015em;
}
.post-card h2 a { color: var(--ink); text-decoration: none; transition: color 0.18s ease; }
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }
.post-card .card-excerpt {
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.62;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.post-card .card-excerpt p { margin: 0; }
.card-readmore {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 14px;
	font-size: 0.87rem;
	font-weight: 700;
	color: var(--accent);
	text-decoration: none !important;
	align-self: flex-start;
}
.card-readmore:hover { color: var(--accent-ink); }
.card-readmore .arrow { transition: transform 0.2s ease; display: inline-block; }
.card-readmore:hover .arrow { transform: translateX(4px); }
.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	font-size: 0.8rem;
	color: var(--muted);
	margin-top: 14px;
	padding-top: 13px;
	border-top: 1px solid var(--surface);
	font-weight: 500;
}
.post-meta a { color: var(--muted); font-weight: 600; }
.post-meta a:hover { color: var(--accent); text-decoration: none; }
.post-meta .meta-dot { opacity: 0.5; }

/* List layout variant */
body.layout-list .post-grid { grid-template-columns: 1fr; }
body.layout-list .post-card { flex-direction: row; }
body.layout-list .post-card .card-thumb { flex: 0 0 250px; aspect-ratio: auto; min-height: 170px; }
body.layout-list .post-card .card-body { justify-content: center; }
@media (max-width: 767px) {
	body.layout-list .post-card { flex-direction: column; }
	body.layout-list .post-card .card-thumb { flex: none; aspect-ratio: 16/10; min-height: 0; }
}
@media (min-width: 1024px) {
	body.layout-list .post-card .card-thumb { flex-basis: 320px; }
}

/* ============ Pagination (paginate_links) ============ */
.pagination { margin: 10px 0 34px; text-align: center; }
.pagination ul.page-numbers {
	list-style: none; margin: 0; padding: 0;
	display: inline-flex; gap: 9px; flex-wrap: wrap; justify-content: center;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	min-height: 46px;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg);
	color: var(--ink);
	font-weight: 700;
	text-decoration: none !important;
	font-size: 0.94rem;
	box-shadow: var(--shadow-sm);
	transition: all 0.18s ease;
}
.pagination a.page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent-ink);
	transform: translateY(-2px);
}
.pagination .page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	box-shadow: 0 8px 18px -6px var(--accent);
}
.pagination .page-numbers.dots { border: 0; min-width: 0; box-shadow: none; background: transparent; }

/* ============ Single post ============ */
.single .entry-header {
	max-width: 780px;
	margin: 6px auto 22px;
	text-align: center;
}
.single .entry-header .card-cat {
	display: inline-flex;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--accent-ink);
	background: var(--accent-soft);
	padding: 6px 14px;
	border-radius: 999px;
	margin-bottom: 16px;
}
.entry-title {
	font-size: clamp(1.65rem, 1.15rem + 4vw, 2.5rem);
	margin: 0 0 16px;
	letter-spacing: -0.03em;
	line-height: 1.16;
	text-wrap: balance;
}
.entry-meta {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 12px;
	color: var(--muted);
	font-size: 0.87rem;
	font-weight: 500;
	margin-bottom: 6px;
}
.entry-meta a { color: var(--muted); font-weight: 600; }
.entry-meta a:hover { color: var(--accent); text-decoration: none; }
.entry-meta .avatar {
	border-radius: 50%;
	width: 30px; height: 30px;
	vertical-align: middle;
}
.entry-thumbnail {
	margin: 26px 0 30px;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: var(--shadow-lift);
}
.single .entry-content {
	max-width: 780px;
	margin-left: auto;
	margin-right: auto;
	font-size: 1.04rem;
	line-height: 1.78;
	overflow-wrap: break-word;
}
/* Tasteful drop cap on the opening paragraph */
.single .entry-content > p:first-of-type::first-letter {
	font-family: var(--font-head);
	font-size: 3.6em;
	font-weight: 800;
	color: var(--accent);
	float: left;
	line-height: 0.82;
	margin: 0.1em 0.14em 0 0;
}
.entry-content h2 {
	margin-top: 2.1em;
	padding-bottom: 0.35em;
	border-bottom: 1px solid var(--border);
	scroll-margin-top: 90px;
}
.entry-content h3 { scroll-margin-top: 90px; }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 8px; }

/* Tables: striped, rounded, soft header */
.table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 1.5em 0;
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow-sm);
}
.table-scroll table { margin: 0; min-width: 560px; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.entry-content th, .entry-content td { padding: 12px 15px; text-align: left; }
.entry-content thead th {
	background: var(--accent-soft);
	color: var(--accent-ink);
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}
.entry-content tbody tr { border-top: 1px solid var(--border); }
.entry-content tbody tr:nth-child(even) { background: var(--surface); }
.entry-content tbody tr:hover { background: var(--accent-soft); }

/* Blockquotes */
.entry-content blockquote {
	position: relative;
	margin: 1.8em 0;
	padding: 22px 26px 22px 30px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	border-radius: 0 14px 14px 0;
	color: var(--ink);
	font-size: 1.08rem;
	line-height: 1.65;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote cite {
	display: block;
	margin-top: 10px;
	font-size: 0.85rem;
	color: var(--muted);
	font-style: normal;
	font-weight: 600;
}

.entry-content ul, .entry-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content li::marker { color: var(--accent); font-weight: 700; }

.entry-footer {
	max-width: 780px;
	margin: 30px auto 0;
	padding-top: 18px;
	border-top: 1px solid var(--border);
	font-size: 0.9rem;
	color: var(--muted);
}
.entry-footer .tags-links a {
	display: inline-block;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	font-size: 0.82rem;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	margin: 0 6px 8px 0;
	text-decoration: none !important;
	transition: all 0.18s ease;
}
.entry-footer .tags-links a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* Author box */
.author-box {
	max-width: 780px;
	margin: 34px auto;
	display: flex;
	gap: 18px;
	align-items: flex-start;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	box-shadow: var(--shadow-card);
}
.author-box .avatar {
	border-radius: 50%;
	flex: 0 0 76px;
	width: 76px; height: 76px;
	border: 3px solid var(--accent-soft);
}
.author-box .author-label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	margin-bottom: 4px;
}
.author-box h3 { margin: 0 0 6px; font-size: 1.08rem; }
.author-box p { margin: 0; font-size: 0.93rem; color: var(--muted); line-height: 1.65; }
@media (max-width: 560px) {
	.author-box { flex-direction: column; align-items: flex-start; }
}

/* Prev / next post navigation */
.post-navigation { max-width: 780px; margin: 34px auto; }
.post-navigation .nav-links { display: flex; flex-direction: column; gap: 14px; }
.post-navigation .nav-previous a, .post-navigation .nav-next a {
	display: block;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px 20px;
	min-height: 44px;
	color: var(--text);
	text-decoration: none !important;
	box-shadow: var(--shadow-sm);
	transition: all 0.2s ease;
	background: var(--bg);
}
.post-navigation .nav-previous a:hover, .post-navigation .nav-next a:hover {
	border-color: var(--accent);
	transform: translateY(-2px);
	box-shadow: var(--shadow-card);
}
.post-navigation .nav-label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--accent);
	margin-bottom: 6px;
}
.post-navigation .nav-title { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 0.98rem; line-height: 1.4; }
@media (min-width: 768px) {
	.post-navigation .nav-links { flex-direction: row; }
	.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; min-width: 0; }
	.post-navigation .nav-next { text-align: right; }
}

/* Related posts */
.related-posts { margin: 44px 0 10px; }
.related-posts > h2 { font-size: 1.4rem; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.related-posts > h2::before {
	content: "";
	width: 30px; height: 4px;
	background: linear-gradient(90deg, var(--accent), var(--accent-ink));
	border-radius: 3px;
}
.related-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============ Comments ============ */
.comments-area { max-width: 780px; margin: 40px auto; }
.comments-area h2 { font-size: 1.3rem; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .comment {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
	margin-bottom: 14px;
	background: var(--bg);
	box-shadow: var(--shadow-sm);
}
.comment-list .children { list-style: none; margin: 14px 0 0; padding-left: 16px; }
@media (min-width: 768px) { .comment-list .children { padding-left: 26px; } }
.comment-meta { font-size: 0.83rem; color: var(--muted); margin-bottom: 8px; }
.comment-form label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 0.93rem; color: var(--ink); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; max-width: 640px; padding: 13px 15px;
	border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 16px;
	background: var(--bg); transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.comment-form input:focus, .comment-form textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
	outline: none;
}
.comment-form input[type="submit"], .form-submit #submit {
	background: var(--accent); color: #fff; border: 0; border-radius: 999px;
	padding: 13px 30px; min-height: 48px; font: inherit; font-weight: 700; cursor: pointer; margin-top: 14px;
	box-shadow: 0 8px 20px -8px var(--accent);
	transition: transform 0.18s ease, background 0.18s ease;
}
.comment-form input[type="submit"]:hover { transform: translateY(-2px); background: var(--accent-ink); }

/* ============ Search ============ */
.search-form { display: flex; gap: 8px; max-width: 480px; margin: 16px 0; }
.search-form .search-field {
	flex: 1; min-width: 0; padding: 12px 16px;
	border: 1px solid var(--border); border-radius: 999px; font: inherit; font-size: 16px; background: var(--bg);
}
.search-form .search-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.search-form .search-submit {
	background: var(--accent); color: #fff; border: 0; border-radius: 999px;
	padding: 12px 24px; min-height: 48px; font: inherit; font-weight: 700; cursor: pointer;
	flex-shrink: 0; transition: background 0.18s ease, transform 0.18s ease;
}
.search-form .search-submit:hover { background: var(--accent-ink); transform: translateY(-1px); }

/* ============ Footer ============ */
.site-footer {
	background: var(--footer-bg);
	color: var(--footer-text);
	margin-top: 24px;
	position: relative;
}
.site-footer::before {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, var(--accent), var(--accent-ink), var(--accent));
}
.footer-widgets { padding: 52px 0 16px; }
.footer-widgets .widget-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-widgets .widget-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-widgets .widget-title { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.14); }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { padding: 7px 0; font-size: 0.92rem; }
.footer-widgets p { font-size: 0.92rem; }
.footer-widgets a { color: var(--footer-text); }
.footer-widgets a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 18px 0;
	font-size: 0.86rem;
}
.footer-bottom .container { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-menu a { color: var(--footer-text); text-decoration: none; font-size: 0.86rem; padding: 6px 0; font-weight: 500; }
.footer-menu a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* ============ Back to top ============ */
.back-to-top {
	position: fixed;
	right: 18px; bottom: 18px;
	width: 48px; height: 48px;
	border-radius: 50%;
	border: 0;
	background: var(--accent);
	color: #fff;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	z-index: 200;
	box-shadow: 0 10px 26px -6px var(--accent);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-ink); }
@media (min-width: 768px) {
	.back-to-top { right: 28px; bottom: 28px; }
}

/* ============ 404 ============ */
.error-404 { text-align: center; padding: 56px 0; max-width: 640px; margin: 0 auto; }
@media (min-width: 768px) { .error-404 { padding: 72px 0; } }
.error-404 h1 {
	font-size: clamp(4rem, 12vw, 6.5rem);
	margin: 0;
	line-height: 1;
	background: linear-gradient(120deg, var(--accent), var(--accent-ink));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--accent);
}
.error-404 p { color: var(--muted); }
.error-404 .search-form { margin-left: auto; margin-right: auto; }

/* ============ Page header (archives/search) ============ */
.page-header { margin-bottom: 26px; }
.page-header .page-title { margin-top: 0; }
.archive-description { color: var(--muted); max-width: 720px; }

/* ============ Utilities ============ */
.no-results { text-align: center; padding: 48px 0; color: var(--muted); }
.wp-caption { max-width: 100%; }
.aligncenter { margin-left: auto; margin-right: auto; }
