/*
 * Structural layout primitives shared by every template — container,
 * section rhythm, and a small grid utility set. Section-specific
 * layout (homepage rows, shop grid, etc.) lives in its own stylesheet.
 */

.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-padding);
}

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-main {
	flex: 1 0 auto;
}

.section {
	padding-block: var(--space-6);
}

.section--alt {
	background: var(--color-bg-alt);
}

.section--tight {
	padding-block: var(--space-4);
}

.section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--space-4);
	margin-bottom: var(--space-4);
}

.section__eyebrow {
	display: block;
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-accent);
	margin-bottom: var(--space-2);
}

.section__title {
	margin: 0;
}

.section__link {
	flex-shrink: 0;
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	transition: opacity var(--duration-fast) var(--ease-standard);
}

.section__link:hover {
	opacity: 0.65;
}

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

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

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

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

@media (max-width: 1024px) {
	.grid--4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {

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

	.section {
		padding-block: var(--space-5);
	}
}

/* Phone widths: a squeezed 2-up grid crushes card images/titles and
   leaves an odd last item stranded alone in its own row (e.g. the 3
   blog-teaser/testimonial cards) — one comfortable full-width column
   reads far better here. */
@media (max-width: 600px) {

	.grid--2,
	.grid--3,
	.grid--4 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.section__head {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-2);
	}
}

/* ---- Generic content patterns (page/single/archive/search/404) ----
   Blog/shop get their own dedicated stylesheets in later phases;
   these keep every template legible and on-brand in the meantime. */

.page-content__title,
.archive-header__title,
.single-post__title {
	margin-bottom: var(--space-4);
}

.archive-header {
	margin-bottom: var(--space-8);
}

.archive-header__description {
	color: var(--color-ink-muted);
	max-width: 60ch;
}

/* Compact variant — utility pages like Wishlist don't need the full
   hero-sized title Shop/Blog archive headers use. Same fs-2xl already
   used for Cart/Checkout (cart-checkout.css) and My Account
   (account.css), so every "just get on with it" page matches. */
.archive-header--compact .archive-header__title {
	font-size: var(--fs-2xl);
}

.post-card__category {
	display: inline-block;
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-accent);
}

.post-card__date {
	color: var(--color-ink-muted);
	font-size: var(--fs-xs);
}

.single-post__thumbnail {
	margin-block: var(--space-6);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.single-post__body,
.page-content__body {
	max-width: 72ch;
	line-height: var(--lh-relaxed);
}

.single-post__body>*+*,
.page-content__body>*+* {
	margin-top: var(--space-4);
}

.post-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	height: 100%;
	transition: transform var(--duration-slow) var(--ease-standard), box-shadow var(--duration-slow) var(--ease-standard), border-color var(--duration-slow) var(--ease-standard);
}

.post-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-md);
	border-color: var(--color-border-strong);
}

.post-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.post-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--color-bg-alt);
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-standard);
}

.post-card:hover .post-card__media img {
	transform: scale(1.06);
}

/* Category + reading-time pills overlaid on the thumbnail (card.php
   only renders these when a thumbnail exists — the no-thumbnail
   fallback uses the plain .post-card__category/.post-card__meta row
   below instead). */
.post-card__tag {
	position: absolute;
	top: var(--space-3);
	left: var(--space-3);
	z-index: 1;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-full);
	/* Fixed near-white pill over a post thumbnail — pair with the
	   fixed-dark --color-ink-solid, not --color-ink (flips to
	   near-white in dark mode and disappears against this background). */
	background: rgba(255, 255, 255, 0.92);
	color: var(--color-ink-solid);
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.post-card__readtime {
	position: absolute;
	top: var(--space-3);
	right: var(--space-3);
	z-index: 1;
	padding: var(--space-1) var(--space-3);
	border-radius: var(--radius-full);
	background: rgba(23, 23, 23, 0.65);
	backdrop-filter: blur(4px);
	color: #fff;
	font-size: var(--fs-xs);
	font-weight: var(--fw-medium);
}

.post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--space-5);
}

.post-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-1);
	margin-bottom: var(--space-2);
}

.post-card__meta-dot {
	color: var(--color-ink-faint);
	font-size: var(--fs-xs);
}

.post-card__title {
	font-size: var(--fs-lg);
	margin-bottom: var(--space-2);
}

.post-card__excerpt {
	color: var(--color-ink-muted);
	font-size: var(--fs-sm);
	margin-bottom: var(--space-3);
}

.post-card__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	margin-top: auto;
	padding-top: var(--space-2);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	color: var(--color-ink);
	transition: color var(--duration-fast) var(--ease-standard);
}

.post-card__cta svg {
	width: 14px;
	height: 14px;
	transition: transform var(--duration-fast) var(--ease-standard);
}

.post-card:hover .post-card__cta {
	color: var(--color-accent);
}

.post-card:hover .post-card__cta svg {
	transform: translateX(4px);
}

/* ---- Search form ---- */
.search-form__row {
	display: flex;
	gap: var(--space-2);
}

.search-form__input {
	flex: 1;
}

/* ---- 404 ---- */
.not-found {
	text-align: center;
	max-width: 480px;
	margin-inline: auto;
	padding-block: var(--space-12);
}

.not-found__code {
	font-family: var(--font-display);
	font-size: var(--fs-5xl);
	color: var(--color-border-strong);
	margin: 0;
	line-height: 1;
}

.not-found__message {
	color: var(--color-ink-muted);
	margin-bottom: var(--space-6);
}

.not-found__search {
	max-width: 360px;
	margin: 0 auto var(--space-6);
}

/* ---- Comments ---- */
.comments-area {
	margin-top: var(--space-10);
	padding-top: var(--space-8);
	border-top: 1px solid var(--color-border);
}

.comments-title {
	font-size: var(--fs-2xl);
	margin-bottom: var(--space-6);
}

.comment-list .comment {
	list-style: none;
	padding-block: var(--space-4);
	border-bottom: 1px solid var(--color-border);
}

/* ---- Comment / reply form (wp_comment_form default markup) ----
   comments.php doesn't override the field templates, so this styles
   WP's own generated markup directly (#comment, .comment-form-*,
   .logged-in-as, .form-submit, etc.) rather than theme-authored HTML. */
.comment-respond {
	margin-top: var(--space-10);
}

.comment-reply-title {
	font-size: var(--fs-2xl);
	margin-bottom: var(--space-2);
}

.comment-form p {
	margin-bottom: var(--space-4);
}

.comment-notes,
.logged-in-as {
	font-size: var(--fs-sm);
	color: var(--color-ink-muted);
}

.comment-notes a,
.logged-in-as a {
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.comment-notes a:hover,
.logged-in-as a:hover {
	color: var(--color-accent-dark);
}

.comment-form .required {
	color: var(--color-accent);
}

/* Label-above-field groups (author/email/url/comment). Default WP
   markup puts an inline <label> directly before the field with no
   layout of its own, which — since a <textarea> is inline-level by
   default — lets the label's baseline align to the textarea's own
   baseline near its bottom edge instead of sitting above it. A flex
   column fixes that cleanly and matches this theme's .form-field
   pattern (components.css). */
.comment-form-author,
.comment-form-email,
.comment-form-url,
.comment-form-comment {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.comment-form label {
	font-size: var(--fs-sm);
	font-weight: var(--fw-medium);
	color: var(--color-ink);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	font-size: var(--fs-base);
	color: var(--color-ink);
	transition: border-color var(--duration-fast) var(--ease-standard),
		box-shadow var(--duration-fast) var(--ease-standard);
}

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

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--color-accent);
	box-shadow: var(--shadow-focus);
}

.comment-form-cookies-consent {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--space-2);
}

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

.comment-form .form-submit {
	margin-bottom: 0;
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.topbar {
	display: none !important;
}

.site-header {
	border-bottom: 0px !important;
}