/* ==========================================================================
   Extra styles - Hero, Search, 404, Comments, TOC, Archive, Misc
   ========================================================================== */

/* --- Hero Section --- */
.hero__content {
	max-width: 720px;
}

.hero__title {
	font-size: 2.5rem;
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.1;
	margin: 0 0 1rem;
	color: hsl(var(--foreground));
}

@media (min-width: 768px) {
	.hero__title { font-size: 3.25rem; }
}

@media (min-width: 1280px) {
	.hero__title { font-size: 3.75rem; }
}

.hero__tagline {
	font-size: 1.25rem;
	line-height: 1.6;
	color: hsl(var(--muted-foreground));
	margin: 0 0 2.5rem;
	max-width: 640px;
}

.hero__actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

/* --- Search Form --- */
.search-form__inner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	position: relative;
}

.search-form__icon {
	position: absolute;
	left: 0.75rem;
	color: hsl(var(--muted-foreground));
	pointer-events: none;
	z-index: 1;
}

.search-form__input {
	padding-left: 2.5rem !important;
	flex: 1;
}

.search-form__btn {
	flex-shrink: 0;
}

.search-form__hint {
	margin-top: 0.75rem;
	font-size: 0.75rem;
	color: hsl(var(--muted-foreground));
	text-align: center;
}

.search-form__hint kbd {
	display: inline-block;
	padding: 0.125rem 0.375rem;
	font-family: var(--font-mono, monospace);
	font-size: 0.6875rem;
	background: hsl(var(--muted));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) * 0.5);
}

/* --- 404 Error Page --- */
.error-404 {
	text-align: center;
	padding: 4rem 0;
	max-width: 560px;
	margin: 0 auto;
}

.error-404__icon {
	color: hsl(var(--muted-foreground));
	margin-bottom: 1rem;
}

.error-404__title {
	font-size: 5rem;
	font-weight: 800;
	letter-spacing: -0.05em;
	margin: 0 0 0.5rem;
	line-height: 1;
	color: hsl(var(--foreground));
}

.error-404__subtitle {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 0.75rem;
}

.error-404__message {
	font-size: 1rem;
	color: hsl(var(--muted-foreground));
	margin: 0 0 2rem;
}

.error-404__search { margin-bottom: 1.5rem; }
.error-404__actions { margin-bottom: 3rem; }

.error-404__categories h2 {
	font-size: 1rem;
	font-weight: 500;
	color: hsl(var(--muted-foreground));
	margin-bottom: 1rem;
}

.error-404__categories .category-pills {
	justify-content: center;
	margin-bottom: 0;
}

/* --- Comment Form Custom Fields --- */
.comment-form-field {
	margin-bottom: 1rem;
}

.comment-form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.375rem;
	color: hsl(var(--foreground));
}

.comment-form-label .required {
	color: hsl(var(--destructive));
}

.comment-textarea {
	min-height: 150px;
	resize: vertical;
}

.comment-notes {
	margin-bottom: 1rem;
}

/* --- No Results --- */
.no-results {
	text-align: center;
	padding: 4rem 0;
	max-width: 480px;
	margin: 0 auto;
}

.no-results h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
}

.no-results p {
	color: hsl(var(--muted-foreground));
	margin-bottom: 1.5rem;
}

/* --- Card Image Placeholder --- */
.card-image__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: hsl(var(--muted));
	color: hsl(var(--muted-foreground));
}

/* --- Archive Header --- */
/* Site-main global padding — ensures space between content and footer on ALL pages */
.site-main {
	padding-bottom: 4rem;
}

.site-main > .container {
	padding-top: 2.5rem;
}

.archive-header {
	margin-bottom: 2.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid hsl(var(--border));
}

/* Page content top spacing */
.page-content {
	padding-top: 2.5rem;
}

.archive-title {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	margin: 0 0 0.5rem;
}

.archive-title span {
	color: hsl(var(--primary));
}

.archive-description {
	font-size: 1rem;
	color: hsl(var(--muted-foreground));
	margin: 0;
}

/* --- TOC Sidebar --- */
#toc-sidebar #ez-toc-container {
	background: hsl(var(--muted));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) * 1.4);
	padding: 1.25rem;
	font-size: 0.8125rem;
}

#toc-sidebar #ez-toc-container p.ez-toc-title {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: hsl(var(--muted-foreground));
	margin: 0 0 0.75rem;
}

#toc-sidebar #ez-toc-container ul {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

#toc-sidebar #ez-toc-container li {
	margin: 0;
	padding: 0;
	list-style: none !important;
}

#toc-sidebar #ez-toc-container a {
	display: block;
	padding: 0.25rem 0.5rem;
	color: hsl(var(--muted-foreground));
	text-decoration: none;
	border-radius: calc(var(--radius) * 0.5);
	font-size: 0.8125rem;
	line-height: 1.4;
	transition: color 0.15s ease, background-color 0.15s ease;
}

#toc-sidebar #ez-toc-container a:hover {
	color: hsl(var(--foreground));
	background: hsl(var(--background));
}

#toc-sidebar #ez-toc-container a.is-active {
	color: hsl(var(--primary));
	font-weight: 500;
	background: hsl(var(--background));
}

#toc-sidebar #ez-toc-container ul ul {
	padding-left: 0.75rem;
}

/* --- Page Content (About/Contact) --- */
.page-content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
}

.page-content .alignwide {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* --- Mobile Footer --- */
@media (max-width: 767px) {
	.footer-bar {
		flex-direction: column;
		gap: 0.75rem;
		text-align: center;
	}

	.footer-legal {
		justify-content: center;
	}
}

/* --- Avatar Image Fix --- */
.avatar__img,
.avatar img {
	border-radius: 9999px;
	object-fit: cover;
}

.avatar--sm img,
.avatar--sm .avatar__img {
	width: 24px;
	height: 24px;
}

/* --- Category Pill component --- */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	border: 1px solid hsl(var(--border));
	background: hsl(var(--background));
	color: hsl(var(--muted-foreground));
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	cursor: pointer;
}

.pill:hover {
	background: hsl(var(--muted));
	color: hsl(var(--foreground));
	border-color: hsl(var(--foreground) / 0.2);
}

.pill--active {
	background: hsl(var(--foreground));
	color: hsl(var(--background));
	border-color: hsl(var(--foreground));
}

.pill--active:hover {
	background: hsl(var(--foreground) / 0.85);
	color: hsl(var(--background));
	border-color: hsl(var(--foreground) / 0.85);
}

.pill__count {
	font-size: 0.75rem;
	opacity: 0.6;
	font-weight: 400;
}

.pill--active .pill__count {
	opacity: 0.7;
}

.pill:focus-visible {
	outline: 2px solid hsl(var(--ring));
	outline-offset: 2px;
}

/* --- Icon styles (dark mode toggle) --- */
.dark .icon-sun { display: block !important; }
.dark .icon-moon { display: none !important; }
html:not(.dark) .icon-sun { display: none !important; }
html:not(.dark) .icon-moon { display: block !important; }

/* ==========================================================================
   Focus-visible states (accessibility)
   ========================================================================== */

.card-title a:focus-visible,
.card-image-link:focus-visible,
.category-pills .badge:focus-visible,
.pagination .page-numbers:focus-visible,
.footer-col a:focus-visible,
.breadcrumb a:focus-visible,
.nav-link:focus-visible,
.btn:focus-visible {
	outline: 2px solid hsl(var(--ring));
	outline-offset: 2px;
	border-radius: 2px;
}

/* ==========================================================================
   Prose table responsive
   ========================================================================== */

.prose .table-wrapper,
.prose table {
	display: block;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Dark mode refinements
   ========================================================================== */

.dark .prose pre,
.dark .wp-block-code {
	background-color: hsl(240 6% 14%);
	border: 1px solid hsl(var(--border));
}

.dark .card {
	border-color: hsl(240 3.7% 22%);
}

.dark .btn--outline {
	border-color: hsl(240 3.7% 30%);
}

.dark .card-image__placeholder {
	background: hsl(240 3.7% 12%);
}

.dark .site-footer {
	background-color: hsl(240 10% 6%);
}

/* ==========================================================================
   Mobile touch targets & sizing
   ========================================================================== */

@media (max-width: 767px) {
	.container {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}

	.hero__title {
		font-size: 2.25rem;
		line-height: 1.15;
	}

	.category-pills .badge {
		padding: 0.5rem 0.875rem;
		font-size: 0.8125rem;
	}

	.pagination .page-numbers {
		min-width: 2.75rem;
		min-height: 2.75rem;
	}
}

/* ==========================================================================
   Code block refinements
   ========================================================================== */

.prose pre {
	border-radius: 0.5rem;
}

/* ==========================================================================
   Outline button on light bg
   ========================================================================== */

.hero .btn--outline {
	background-color: hsl(var(--background));
	border-color: hsl(var(--border));
}

.hero .btn--outline:hover {
	background-color: hsl(var(--muted));
}

/* ==========================================================================
   Card excerpt empty state
   ========================================================================== */

.card-excerpt:empty {
	display: none;
}

/* ==========================================================================
   Card hover refinement
   ========================================================================== */

.card {
	transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}

/* ==========================================================================
   Logo sizing
   ========================================================================== */

.site-logo img,
.custom-logo {
	height: 40px;
	width: auto;
}

/* ==========================================================================
   Single orphan card centering
   ========================================================================== */

.card-grid--3col > .card:last-child:nth-child(3n+1) {
	grid-column: 2;
}

/* ==========================================================================
   Author box avatar wrap fix
   ========================================================================== */

.author-box__avatar-wrap {
	flex-shrink: 0;
}

.author-box__avatar-wrap img {
	width: 80px;
	height: 80px;
	border-radius: 9999px;
	border: 2px solid hsl(var(--border));
	object-fit: cover;
}

/* ==========================================================================
   Prose H2 line-height fix
   ========================================================================== */

.prose h2 {
	line-height: 1.35;
}
