/*
Theme Name: Halcyon
Description: A calm, airy content theme with a right-sidebar layout, card-based archives, grouped footer columns, and a soft powder-blue palette designed for relaxed reading.
*/

/* ---------- Custom properties ---------- */
:root {
	--bg: #f4f8fb;
	--fg: #33424e;
	--muted: #71808c;
	--border: #dde7ef;
	--radius: 8px;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	--accent: #7ba7c7;
	--accent-dark: #5f8db1;
	--surface: #fdfcfa;
	--font: 'Nunito Sans', system-ui, sans-serif;
	--thumb-ratio: 3 / 2;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

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

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

a {
	color: var(--accent-dark);
	text-decoration: none;
}

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

h1, h2, h3, h4, h5, h6 {
	line-height: 1.3;
	color: var(--fg);
	margin: 0 0 0.6em;
	font-weight: 700;
}

p {
	margin: 0 0 1.2em;
}

ul, ol {
	margin: 0 0 1.2em;
	padding-left: 1.4em;
}

blockquote {
	margin: 1.4em 0;
	padding: 0.8em 1.2em;
	border-left: 3px solid var(--accent);
	background: var(--surface);
	border-radius: 0 var(--radius) var(--radius) 0;
	color: var(--muted);
}

.table-wrap {
	overflow-x: auto;
	margin: 0 0 1.4em;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.4em;
}

.table-wrap table {
	margin-bottom: 0;
}

th, td {
	padding: 10px 12px;
	border: 1px solid var(--border);
	text-align: left;
}

th {
	background: var(--surface);
}

code, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.92em;
	background: #eef4f8;
	border-radius: 4px;
}

code {
	padding: 2px 6px;
}

pre {
	padding: 14px 16px;
	overflow-x: auto;
	border: 1px solid var(--border);
}

pre code {
	padding: 0;
	background: none;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Buttons & forms ---------- */
button,
input[type="submit"],
.search-submit {
	font-family: var(--font);
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: var(--accent);
	border: 0;
	border-radius: var(--radius);
	padding: 10px 20px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

button:hover,
input[type="submit"]:hover,
.search-submit:hover {
	background: var(--accent-dark);
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea {
	font-family: var(--font);
	font-size: 15px;
	color: var(--fg);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 14px;
	width: 100%;
}

input:focus,
textarea:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	border-color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	justify-content: space-between;
	max-width: 1180px;
	margin: 0 auto;
	padding: 14px 20px;
}

.site-branding {
	flex: 0 0 auto;
}

.site-name {
	font-size: 22px;
	font-weight: 800;
	color: var(--fg);
	letter-spacing: 0.2px;
}

.site-name:hover,
.site-name:focus {
	color: var(--accent-dark);
	text-decoration: none;
}

/* Full-width nav bar on its own row below the logo/search row */
.primary-nav {
	background: #fff;
	border-top: 1px solid var(--border);
}

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

.primary-nav > ul {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
	justify-content: space-between;
	gap: 8px;
}

.primary-nav li {
	position: relative;
}

.primary-nav > ul > li {
	flex: 0 0 auto;
}

.primary-nav > ul > li > a {
	white-space: nowrap;
	padding: 12px 10px;
	font-size: 15px;
}

.primary-nav a {
	display: block;
	padding: 10px 14px;
	color: var(--fg);
	font-weight: 600;
	font-size: 15px;
	border-radius: var(--radius);
}

.primary-nav a:hover,
.primary-nav a:focus {
	color: var(--accent-dark);
	background: #eef4f9;
	text-decoration: none;
}

.primary-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: 7px;
	border: solid var(--muted);
	border-width: 0 2px 2px 0;
	padding: 3px;
	transform: rotate(45deg) translateY(-2px);
}

/* Dropdown sub-menus: desktop hover / focus-within */
.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: block;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.15s ease;
	z-index: 60;
	flex-direction: column;
	align-items: stretch;
	padding: 6px;
	gap: 0;
}

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

.primary-nav .sub-menu a {
	padding: 9px 14px;
	font-weight: 600;
	white-space: nowrap;
}

.nav-toggle,
.search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 8px 10px;
}

.nav-toggle:hover,
.search-toggle:hover {
	background: #eef4f9;
}

.search-toggle {
	display: inline-flex;
	margin-left: auto;
}

.search-toggle svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* Expandable search panel */
.search-panel {
	display: none;
	border-top: 1px solid var(--border);
	background: var(--surface);
	padding: 16px 0;
}

.search-panel.is-open {
	display: block;
}

.search-panel .search-form {
	max-width: 640px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Search form ---------- */
.search-form {
	display: flex;
	gap: 10px;
	align-items: stretch;
}

.search-form .search-label {
	flex: 1 1 auto;
	display: flex;
}

.search-form .search-field {
	flex: 1 1 auto;
}

.search-form .search-submit {
	flex: 0 0 auto;
}

/* ---------- Hero (text-only, centered) ---------- */
.hero {
	text-align: center;
	padding: 56px 20px 48px;
	background: linear-gradient(180deg, #e9f2f8 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--border);
}

.hero h1 {
	font-size: 34px;
	margin-bottom: 0.35em;
}

.hero p {
	max-width: 680px;
	margin: 0 auto;
	color: var(--muted);
	font-size: 17px;
}

/* ---------- Layout: content + right sidebar ---------- */
.site-main {
	padding: 48px 0 48px;
}

.content-layout {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

.content-area {
	flex: 1 1 auto;
	min-width: 0;
}

.sidebar {
	flex: 0 0 280px;
	width: 280px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
	font-size: 14px;
	color: var(--muted);
	margin-bottom: 20px;
}

.breadcrumb .trail {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.breadcrumb .crumb {
	color: var(--muted);
}

.breadcrumb a.crumb:hover {
	color: var(--accent-dark);
}

.breadcrumb .sep {
	color: var(--border);
}

.breadcrumb .crumb.current {
	color: var(--fg);
	font-weight: 600;
}

/* ---------- Post card grid ---------- */
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

.post-card {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease;
}

.post-card:hover {
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.post-card .card-thumb a {
	display: block;
}

.post-card .card-thumb img {
	width: 100%;
	aspect-ratio: var(--thumb-ratio);
	object-fit: cover;
}

.post-card .card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
}

.post-card .card-cats {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.post-card .card-cats a {
	color: var(--accent-dark);
}

.post-card h2,
.post-card h3 {
	font-size: 18px;
	margin: 0;
}

.post-card h2 a,
.post-card h3 a {
	color: var(--fg);
}

.post-card h2 a:hover,
.post-card h3 a:hover {
	color: var(--accent-dark);
	text-decoration: none;
}

.post-card .card-date {
	font-size: 13px;
	color: var(--muted);
	margin-top: auto;
}

/* ---------- Archive headings ---------- */
.archive-header {
	margin-bottom: 24px;
}

.archive-header h1 {
	font-size: 28px;
	margin-bottom: 0.25em;
}

.archive-header .archive-description {
	color: var(--muted);
	margin-bottom: 0;
}

/* ---------- Pagination ---------- */
.pagination {
	margin-top: 32px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: #fff;
	color: var(--fg);
	font-weight: 600;
	font-size: 14px;
}

.pagination .page-numbers.current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.pagination a.page-numbers:hover {
	background: #eef4f9;
	text-decoration: none;
}

/* ---------- Single post ---------- */
.single-post {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px;
}

.post-header h1 {
	font-size: 30px;
	margin-bottom: 0.35em;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	font-size: 14px;
	color: var(--muted);
	margin-bottom: 22px;
}

.post-meta a {
	color: var(--muted);
}

.post-meta a:hover {
	color: var(--accent-dark);
}

.post-featured-wrap {
	margin: 0 0 26px;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
}

.post-featured-wrap img {
	width: 100%;
}

.post-body {
	margin-bottom: 8px;
	overflow-wrap: break-word;
}

.post-header h1,
.archive-header h1,
.hero h1 {
	overflow-wrap: break-word;
}

.post-body h2 { font-size: 24px; margin-top: 1.4em; }
.post-body h3 { font-size: 20px; margin-top: 1.4em; }
.post-body h4 { font-size: 17px; margin-top: 1.4em; }

/* Article note: after body, before tags */
.article-note {
	background: #eef5fa;
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius);
	padding: 14px 18px;
	color: var(--muted);
	font-size: 15px;
	margin: 24px 0;
}

.article-note p:last-child {
	margin-bottom: 0;
}

.post-tags {
	margin: 24px 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.post-tags a {
	display: inline-block;
	background: #eef4f9;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 4px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent-dark);
}

.post-tags a:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	text-decoration: none;
}

/* Author bio */
.author-bio {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	margin: 28px 0;
}

.author-bio .avatar {
	border-radius: 50%;
	flex: 0 0 auto;
}

.author-bio .author-name {
	font-weight: 700;
	margin-bottom: 4px;
}

.author-bio .author-desc {
	color: var(--muted);
	font-size: 15px;
	margin: 0;
}

/* Related posts: 4 columns */
.related-posts {
	margin: 36px 0 8px;
}

.related-posts > h2 {
	font-size: 22px;
	margin-bottom: 18px;
}

.related-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.related-grid .post-card h3 {
	font-size: 15px;
}

.related-grid .card-body {
	padding: 12px 14px 14px;
}

/* ---------- Sidebar ---------- */
.sidebar section {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px;
	margin-bottom: 20px;
}

.sidebar h2 {
	font-size: 16px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}

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

.sidebar ul li {
	padding: 6px 0;
	border-bottom: 1px dashed var(--border);
	font-size: 15px;
}

.sidebar ul li:last-child {
	border-bottom: 0;
}

.sidebar ul li a {
	color: var(--fg);
}

.sidebar ul li a:hover {
	color: var(--accent-dark);
}

.sidebar .recent-date {
	display: block;
	font-size: 12px;
	color: var(--muted);
}

.sidebar .search-form {
	flex-direction: column;
}

/* ---------- Comments ---------- */
.comments-area {
	margin-top: 36px;
	border-top: 1px solid var(--border);
	padding-top: 28px;
}

.comments-title,
.comment-reply-title {
	font-size: 20px;
}

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

.comment-list .comment {
	padding: 18px 0;
	border-bottom: 1px solid var(--border);
}

.comment-list .children {
	list-style: none;
	padding-left: 24px;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
}

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

.comment-metadata {
	font-size: 13px;
	color: var(--muted);
	margin: 2px 0 8px;
}

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

.comment-reply-link {
	font-size: 14px;
	font-weight: 700;
}

.comment-form label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 6px;
}

.comment-form .comment-form-comment textarea {
	min-height: 140px;
}

.comment-form p {
	margin-bottom: 16px;
}

/* ---------- Footer: multi-column grid ---------- */
.site-footer {
	background: var(--surface);
	border-top: 1px solid var(--border);
	margin-top: 24px;
}

.footer-groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 24px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 40px 20px 28px;
}

.footer-group .footer-heading {
	display: block;
	font-weight: 800;
	font-size: 15px;
	margin-bottom: 12px;
	color: var(--fg);
}

.footer-group ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-group ul li {
	margin-bottom: 8px;
}

.footer-group ul li a {
	color: var(--muted);
	font-size: 14px;
}

.footer-group ul li a:hover {
	color: var(--accent-dark);
}

.footer-group .footer-text {
	color: var(--muted);
	font-size: 14px;
}

.footer-bottom {
	border-top: 1px solid var(--border);
	padding: 18px 20px;
	text-align: center;
	font-size: 14px;
	color: var(--muted);
}

.footer-bottom p {
	margin: 0;
}

.footer-bottom .footer-note {
	margin-top: 4px;
	font-size: 13px;
}

/* ---------- 404 / misc ---------- */
.not-found-panel,
.page-panel {
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px;
}

.not-found-panel {
	text-align: center;
}

.not-found-panel h1 {
	font-size: 28px;
}

.not-found-panel .search-form {
	max-width: 480px;
	margin: 20px auto 0;
}

.no-results-note {
	color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.content-layout {
		flex-direction: column;
	}

	.sidebar {
		width: 100%;
		flex: 1 1 auto;
	}

	.related-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 860px) {
	.nav-toggle {
		display: inline-flex;
	}

	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
		z-index: 70;
		max-height: 70vh;
		overflow-y: auto;
	}

	.primary-nav.is-open {
		display: block;
	}

	.site-header {
		position: relative;
	}

	.primary-nav ul {
		flex-direction: column;
		align-items: stretch;
		padding: 10px;
	}

	.primary-nav .sub-menu {
		position: static;
		visibility: visible;
		opacity: 1;
		display: none;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--border);
		border-radius: 0;
		margin: 2px 0 6px 14px;
		padding: 0 0 0 8px;
		min-width: 0;
	}

	.primary-nav li.submenu-open > .sub-menu {
		display: block;
	}
}

@media (max-width: 560px) {
	.hero h1 {
		font-size: 26px;
	}

	.post-header h1 {
		font-size: 24px;
	}

	.archive-header h1 {
		font-size: 24px;
	}

	.single-post,
	.not-found-panel,
	.page-panel {
		padding: 22px;
	}

	.related-grid {
		grid-template-columns: 1fr;
	}

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