/**
 * Layout — container, grid, header/footer/nav structure.
 * Version 2.0 — Premium editorial design.
 */

/* =====================================================================
 * Container
 * =================================================================== */
.hk-container {
	width: 100%;
	max-width: var(--hk-container-max);
	margin-inline: auto;
	padding-inline: var(--hk-container-pad);
}

.hk-container--narrow { max-width: 860px; }
.hk-container--wide   { max-width: 1440px; }

/* =====================================================================
 * Content / Sidebar Layout
 * =================================================================== */
.hk-content-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--hk-space-7);
	padding-block: var(--hk-space-7);
}

@media (min-width: 1024px) {
	.hk-content-layout {
		grid-template-columns: minmax(0,1fr) minmax(280px,340px);
		align-items: start;
	}
	.hk-content-layout--no-sidebar {
		grid-template-columns: minmax(0,1fr);
	}
}

.hk-content,
.hk-content-layout > .widget-area { min-width: 0; }

/* Sticky sidebar */
@media (min-width: 1024px) {
	.hk-content-layout > .widget-area {
		position: sticky;
		top: calc(var(--hk-header-height) + var(--hk-space-5));
	}
}

/* =====================================================================
 * Site Header — Sticky with scroll shadow
 * =================================================================== */
.site-header {
	background: var(--hk-color-surface);
	border-bottom: 1px solid var(--hk-color-border-light);
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow var(--hk-duration) var(--hk-ease);
}

/* JS adds this class when user scrolls */
.site-header.is-scrolled {
	box-shadow: 0 2px 20px rgba(30,20,10,0.10);
	border-bottom-color: var(--hk-color-border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hk-space-4);
	height: var(--hk-header-height);
	padding-block: var(--hk-space-2);
}

/* =====================================================================
 * Site Branding
 * =================================================================== */
.site-branding {
	display: flex;
	align-items: center;
	gap: var(--hk-space-2);
	min-width: 0;
	flex-shrink: 0;
}

.site-branding a {
	display: inline-flex;
	align-items: center;
	gap: var(--hk-space-2);
	text-decoration: none;
}

.site-branding__logo img {
	max-height: 42px;
	width: auto;
}

.site-branding__title {
	font-family: var(--hk-font-display);
	font-weight: 700;
	font-size: var(--hk-text-xl);
	color: var(--hk-color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.02em;
}

.site-branding__tagline { display: none; }

/* =====================================================================
 * Header Actions
 * =================================================================== */
.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--hk-space-2);
}

.site-header__icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--hk-radius-md);
	color: var(--hk-color-text);
	text-decoration: none;
	transition: background var(--hk-duration) var(--hk-ease), color var(--hk-duration) var(--hk-ease);
}

.site-header__icon-link:hover {
	background: var(--hk-color-surface-alt);
	color: var(--hk-color-accent);
}

.site-header__subscribe { display: none; }

/* =====================================================================
 * Primary Navigation (Desktop)
 * =================================================================== */
.primary-nav { display: none; }

@media (min-width: 1024px) {
	.primary-nav { display: block; }
	.site-header__subscribe { display: inline-flex; }

	.primary-nav__menu {
		display: flex;
		align-items: center;
		gap: 0;
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.primary-nav__menu > li { position: relative; }

	.primary-nav__menu > li > a {
		display: inline-flex;
		align-items: center;
		gap: var(--hk-space-1);
		padding: var(--hk-space-2) var(--hk-space-3);
		text-decoration: none;
		font-size: var(--hk-text-sm);
		font-weight: 600;
		letter-spacing: 0.01em;
		color: var(--hk-color-text);
		border-radius: var(--hk-radius-sm);
		transition: color var(--hk-duration) var(--hk-ease), background var(--hk-duration) var(--hk-ease);
		position: relative;
	}

	.primary-nav__menu > li > a::after {
		content: '';
		position: absolute;
		bottom: 4px;
		left: var(--hk-space-3);
		right: var(--hk-space-3);
		height: 2px;
		background: var(--hk-color-accent);
		border-radius: 2px;
		transform: scaleX(0);
		transform-origin: center;
		transition: transform var(--hk-duration) var(--hk-ease);
	}

	.primary-nav__menu > li > a:hover,
	.primary-nav__menu > li > a:focus-visible {
		color: var(--hk-color-accent-dark);
	}

	.primary-nav__menu > li.current-menu-item > a,
	.primary-nav__menu > li.current-menu-ancestor > a {
		color: var(--hk-color-accent);
	}

	.primary-nav__menu > li.current-menu-item > a::after,
	.primary-nav__menu > li > a:hover::after {
		transform: scaleX(1);
	}

	/* Dropdown */
	.primary-nav__menu ul {
		display: none;
		position: absolute;
		top: calc(100% + 4px);
		left: 0;
		z-index: 200;
		min-width: 220px;
		margin: 0;
		padding: var(--hk-space-2);
		list-style: none;
		background: var(--hk-color-surface);
		border: 1px solid var(--hk-color-border);
		border-radius: var(--hk-radius-md);
		box-shadow: var(--hk-shadow-md);
	}

	.primary-nav__menu li:hover > ul,
	.primary-nav__menu li:focus-within > ul { display: block; }

	.primary-nav__menu ul a {
		display: block;
		padding: calc(var(--hk-space-2) + 2px) var(--hk-space-3);
		border-radius: var(--hk-radius-sm);
		font-weight: 500;
		font-size: var(--hk-text-sm);
		color: var(--hk-color-text);
		text-decoration: none;
		transition: background var(--hk-duration) var(--hk-ease), color var(--hk-duration) var(--hk-ease);
	}

	.primary-nav__menu ul a:hover,
	.primary-nav__menu ul a:focus-visible {
		background: var(--hk-color-accent-light);
		color: var(--hk-color-accent-dark);
	}
}

/* =====================================================================
 * Mobile Nav Toggle
 * =================================================================== */
.mobile-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	border-radius: var(--hk-radius-md);
	color: var(--hk-color-text);
	transition: background var(--hk-duration) var(--hk-ease);
}

.mobile-nav-toggle:hover { background: var(--hk-color-surface-alt); }

@media (min-width: 1024px) { .mobile-nav-toggle { display: none; } }

/* =====================================================================
 * Mobile Nav Drawer
 * =================================================================== */
.mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
}

.mobile-nav[data-open="true"] { visibility: visible; }

.mobile-nav__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20,14,8,0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.2s var(--hk-ease);
}

.mobile-nav[data-open="true"] .mobile-nav__backdrop { opacity: 1; }

.mobile-nav__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(88vw, 360px);
	background: var(--hk-color-surface);
	box-shadow: var(--hk-shadow-lg);
	padding: var(--hk-space-4) var(--hk-space-5);
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.22s var(--hk-ease);
	display: flex;
	flex-direction: column;
	gap: var(--hk-space-4);
}

.mobile-nav[data-open="true"] .mobile-nav__panel { transform: translateX(0); }

.mobile-nav__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: var(--hk-space-3);
	border-bottom: 1px solid var(--hk-color-border);
}

.mobile-nav__close {
	width: 40px; height: 40px;
	border: 0;
	background: var(--hk-color-surface-alt);
	border-radius: var(--hk-radius-md);
	color: var(--hk-color-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mobile-nav__menu {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	flex-direction: column;
}

.mobile-nav__menu a {
	display: block;
	padding: var(--hk-space-3) var(--hk-space-2);
	text-decoration: none;
	font-size: var(--hk-text-base);
	font-weight: 600;
	border-bottom: 1px solid var(--hk-color-border-light);
	min-height: 48px;
	display: flex;
	align-items: center;
	color: var(--hk-color-text);
	transition: color var(--hk-duration) var(--hk-ease), padding-left var(--hk-duration) var(--hk-ease);
}

.mobile-nav__menu a:hover { color: var(--hk-color-accent); padding-left: var(--hk-space-3); }

.mobile-nav__menu ul { list-style: none; margin: 0 0 0 var(--hk-space-3); padding: 0; }
.mobile-nav__menu ul a { font-size: var(--hk-text-sm); font-weight: 500; }

body.has-mobile-nav-open { overflow: hidden; }

/* =====================================================================
 * Category Navigation Bar
 * =================================================================== */
.hk-category-nav {
	background: var(--hk-color-surface);
	border-bottom: 1px solid var(--hk-color-border-light);
}

.hk-category-nav__inner {
	display: flex;
	align-items: center;
	gap: 0;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-block: var(--hk-space-2);
}

.hk-category-nav__inner::-webkit-scrollbar { display: none; }

.hk-category-nav__link {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: var(--hk-space-2) var(--hk-space-3);
	text-decoration: none;
	font-size: var(--hk-text-sm);
	font-weight: 500;
	color: var(--hk-color-text-muted);
	white-space: nowrap;
	border-radius: var(--hk-radius-pill);
	transition: color var(--hk-duration) var(--hk-ease), background var(--hk-duration) var(--hk-ease);
}

.hk-category-nav__link:hover,
.hk-category-nav__link.is-active {
	color: var(--hk-color-accent-dark);
	background: var(--hk-color-accent-light);
}

.hk-category-nav__link.is-active { font-weight: 600; }

/* =====================================================================
 * Site Footer
 * =================================================================== */
.site-footer {
	background: var(--hk-color-text);
	color: var(--hk-color-surface-alt);
	margin-top: var(--hk-space-9);
}

.site-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--hk-space-6);
	padding-block: var(--hk-space-8);
}

@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: 2fr repeat(3,1fr); gap: var(--hk-space-8); } }

.site-footer__brand { max-width: 280px; }

.site-footer__brand-name {
	font-family: var(--hk-font-display);
	font-size: var(--hk-text-xl);
	font-weight: 700;
	color: var(--hk-color-surface);
	margin: 0 0 var(--hk-space-3);
	letter-spacing: -0.02em;
}

.site-footer__brand-desc {
	font-size: var(--hk-text-sm);
	color: var(--hk-color-text-light);
	line-height: var(--hk-line-normal);
	margin: 0;
}

.site-footer__heading {
	font-size: var(--hk-text-xs);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--hk-color-text-light);
	margin: 0 0 var(--hk-space-4);
	font-family: var(--hk-font-body);
	font-weight: 700;
}

.site-footer__list {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--hk-space-2);
}

.site-footer__list a {
	text-decoration: none;
	font-size: var(--hk-text-sm);
	color: var(--hk-color-text-light);
	transition: color var(--hk-duration) var(--hk-ease);
}

.site-footer__list a:hover { color: var(--hk-color-surface); }

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hk-space-2);
	margin-top: var(--hk-space-4);
}

.site-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px; height: 38px;
	border-radius: var(--hk-radius-pill);
	border: 1px solid rgba(255,255,255,0.15);
	color: var(--hk-color-text-light);
	text-decoration: none;
	font-size: var(--hk-text-sm);
	font-weight: 700;
	transition: border-color var(--hk-duration) var(--hk-ease), color var(--hk-duration) var(--hk-ease), background var(--hk-duration) var(--hk-ease);
}

.site-footer__social a:hover {
	border-color: var(--hk-color-accent);
	background: var(--hk-color-accent);
	color: var(--hk-color-accent-contrast);
}

.site-footer__bottom {
	border-top: 1px solid rgba(255,255,255,0.1);
	padding-block: var(--hk-space-4);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--hk-space-3);
	font-size: var(--hk-text-xs);
	color: var(--hk-color-text-light);
}

.site-footer__bottom p { margin: 0; }

.site-footer__bottom-links {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--hk-space-4);
	margin: 0; padding: 0;
}

.site-footer__bottom-links a {
	text-decoration: none;
	color: inherit;
	transition: color var(--hk-duration) var(--hk-ease);
}

.site-footer__bottom-links a:hover { color: var(--hk-color-surface); }

/* =====================================================================
 * Buttons
 * =================================================================== */
.hk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--hk-space-2);
	min-height: 42px;
	padding: 0.6rem var(--hk-space-5);
	border-radius: var(--hk-radius-pill);
	border: 1.5px solid transparent;
	font-weight: 600;
	font-size: var(--hk-text-sm);
	text-decoration: none;
	cursor: pointer;
	transition: background var(--hk-duration) var(--hk-ease), border-color var(--hk-duration) var(--hk-ease), box-shadow var(--hk-duration) var(--hk-ease), transform var(--hk-duration) var(--hk-ease);
}

.hk-btn:hover { transform: translateY(-1px); }
.hk-btn:active { transform: translateY(0); }

.hk-btn--primary {
	background: var(--hk-color-accent);
	color: var(--hk-color-accent-contrast);
	border-color: var(--hk-color-accent);
}

.hk-btn--primary:hover {
	background: var(--hk-color-accent-dark);
	border-color: var(--hk-color-accent-dark);
	box-shadow: 0 4px 12px rgba(200,81,42,0.35);
}

.hk-btn--outline {
	background: transparent;
	border-color: var(--hk-color-border);
	color: var(--hk-color-text);
}

.hk-btn--outline:hover {
	border-color: var(--hk-color-accent);
	color: var(--hk-color-accent-dark);
	background: var(--hk-color-accent-light);
}

.hk-btn--sm {
	min-height: 34px;
	padding: 0.4rem var(--hk-space-4);
	font-size: var(--hk-text-xs);
}

/* =====================================================================
 * Generic content, post list, search
 * =================================================================== */
.entry-content {
	font-size: var(--hk-text-base);
	line-height: var(--hk-line-normal);
}

.entry-content > * + * { margin-top: var(--hk-space-4); }

.entry-thumbnail {
	margin-block: var(--hk-space-5);
	border-radius: var(--hk-radius-lg);
	overflow: hidden;
}

.hk-post-list { display: grid; gap: var(--hk-space-6); }

.hk-post-list__item { display: grid; gap: var(--hk-space-4); }

@media (min-width: 640px) {
	.hk-post-list__item {
		grid-template-columns: 240px 1fr;
		align-items: start;
	}
}

.hk-post-list__thumb img { border-radius: var(--hk-radius-md); }
.hk-post-list__body { min-width: 0; }
.hk-post-list__title { margin-bottom: var(--hk-space-2); }
.hk-post-list__title a { text-decoration: none; }
.hk-post-list__meta { font-size: var(--hk-text-sm); color: var(--hk-color-text-muted); margin-bottom: var(--hk-space-2); }
.hk-post-list__excerpt { color: var(--hk-color-text-muted); font-size: var(--hk-text-sm); }

/* Search form */
.hk-search-form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hk-space-2);
	justify-content: center;
	margin-block: var(--hk-space-5);
}

.hk-search-form input[type="search"] {
	flex: 1 1 260px;
	min-height: 48px;
	padding: var(--hk-space-2) var(--hk-space-5);
	border: 1.5px solid var(--hk-color-border);
	border-radius: var(--hk-radius-pill);
	background: var(--hk-color-surface);
	color: var(--hk-color-text);
	font-size: var(--hk-text-base);
	transition: border-color var(--hk-duration) var(--hk-ease), box-shadow var(--hk-duration) var(--hk-ease);
}

.hk-search-form input[type="search"]:focus {
	border-color: var(--hk-color-accent);
	box-shadow: 0 0 0 3px rgba(200,81,42,0.12);
	outline: none;
}

/* Pagination */
.hk-pagination {
	margin-top: var(--hk-space-7);
	display: flex;
	gap: var(--hk-space-2);
	justify-content: center;
	flex-wrap: wrap;
}

.hk-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 var(--hk-space-2);
	border-radius: var(--hk-radius-md);
	text-decoration: none;
	border: 1.5px solid var(--hk-color-border);
	font-weight: 600;
	font-size: var(--hk-text-sm);
	transition: all var(--hk-duration) var(--hk-ease);
	color: var(--hk-color-text-muted);
}

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

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

/* Comments */
.comments-area { padding-block: var(--hk-space-6); }
.comment-list { list-style: none; margin: 0 0 var(--hk-space-5); padding: 0; }

/* Archive / search headers */
.hk-archive-header { padding-block: var(--hk-space-6) var(--hk-space-5); }
.hk-archive-header__title { margin-bottom: var(--hk-space-2); }
.hk-archive-header__desc { color: var(--hk-color-text-muted); max-width: 70ch; }
.hk-archive-header__desc > * + * { margin-top: var(--hk-space-3); }

.hk-search-form--page { justify-content: flex-start; margin-bottom: var(--hk-space-6); }

.hk-search-results { display: flex; flex-direction: column; gap: var(--hk-space-5); }

.hk-search-result {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--hk-space-3);
	padding-bottom: var(--hk-space-5);
	border-bottom: 1px solid var(--hk-color-border);
}

@media (min-width: 560px) { .hk-search-result { grid-template-columns: 160px 1fr; align-items: start; } }

.hk-search-result__thumb {
	display: block;
	aspect-ratio: 4/3;
	border-radius: var(--hk-radius-md);
	overflow: hidden;
	background: var(--hk-color-surface-alt);
}

.hk-search-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.hk-search-result__body { min-width: 0; }
.hk-search-result__eyebrow { font-size: var(--hk-text-xs); text-transform: uppercase; letter-spacing: 0.05em; color: var(--hk-color-text-muted); margin-bottom: var(--hk-space-1); }
.hk-search-result__eyebrow a { color: var(--hk-color-accent-dark); text-decoration: none; }
.hk-search-result__title { margin-bottom: var(--hk-space-1); }
.hk-search-result__title a { text-decoration: none; }
.hk-search-result__meta { font-size: var(--hk-text-xs); color: var(--hk-color-text-muted); margin-bottom: var(--hk-space-2); }
.hk-search-result__excerpt { color: var(--hk-color-text-muted); font-size: var(--hk-text-sm); }
