/* ==========================================================================
   Blog — clean light reading theme.
   Loaded only on blog views (index, single, archive, author, search).
   Reuses the theme's design tokens (--display, --body, greys) from style.css.
   ========================================================================== */

.blog-main {
	max-width: 1240px;
	margin: 0 auto;
	/* Horizontal padding matches .site-header (3.5rem) so the blog aligns
	   to the header edges and reads as one continuous page. */
	padding: 2.5rem 3.5rem 6rem;
	color: var(--grey-700);
}

/* Single article stays a comfortable reading measure inside the wide page. */
.blog-main .single-post {
	max-width: 760px;
	margin: 0 auto;
}

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

/* ── Section header ── */
.blog-header {
	margin-bottom: 3rem;
}

/* Title left, search right, on the same row */
.blog-header__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.blog-header__top .blog-header__title {
	margin-bottom: 0;
}

.blog-header__top .search-form {
	flex: 0 0 auto;
}

.blog-header__desc {
	margin-top: 1rem;
}

.blog-header__title {
	font-family: var(--display);
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	color: var(--black);
	line-height: 1.1;
	margin-bottom: 1rem;
}

.blog-header__title span {
	color: var(--grey-500);
}

.blog-header__desc {
	font-size: 1.05rem;
	line-height: 1.6;
	color: var(--grey-500);
	margin-bottom: 1.5rem;
}

/* ── Post meta ── */
.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: var(--grey-500);
}

.post-meta a {
	color: var(--grey-700);
	text-decoration: none;
}

.post-meta a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.post-meta__sep {
	color: var(--grey-300);
}

.post-meta__author {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.post-meta__author img {
	border-radius: 50%;
}

/* ── Post list + cards ── */
.post-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2.5rem;
}

.post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--white);
	border: 1px solid var(--grey-300);
	border-radius: 14px;
	overflow: hidden;
	transition:
		transform 0.25s var(--ease-out-expo),
		box-shadow 0.25s var(--ease-out-expo);
}

.post-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(10, 10, 10, 0.08);
}

.post-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s var(--ease-out-expo);
}

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

.post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.5rem 1.6rem 1.75rem;
	gap: 0.75rem;
}

.post-card__title {
	font-family: var(--display);
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	margin: 0;
}

.post-card__title a {
	color: var(--black);
	text-decoration: none;
}

.post-card__title a:hover {
	color: var(--grey-700);
}

.post-card__excerpt {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--grey-700);
	/* Truncate to 3 lines with an ellipsis */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-card__more {
	display: inline-block;
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--black);
	text-decoration: none;
}

.post-card__more:hover {
	opacity: 0.7;
}

/* ── Single post ── */
.single-post__header {
	margin-bottom: 2rem;
}

.single-post__cats,
.single-post__cats a {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--grey-500);
	text-decoration: none;
	margin-bottom: 1rem;
}

.single-post__title {
	font-family: var(--display);
	font-size: clamp(2rem, 5.5vw, 3rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.1;
	color: var(--black);
	margin-bottom: 1.25rem;
}

.single-post__media {
	margin: 0 0 2.5rem;
	border-radius: 14px;
	overflow: hidden;
}

.single-post__media img {
	width: 100%;
	height: auto;
	display: block;
}

.single-post__content {
	font-size: 1.08rem;
	line-height: 1.8;
	color: var(--grey-700);
}

.single-post__content > * + * {
	margin-top: 1.4rem;
}

.single-post__content h2,
.single-post__content h3,
.single-post__content h4 {
	font-family: var(--display);
	color: var(--black);
	letter-spacing: -0.02em;
	margin-top: 2.5rem;
}

.single-post__content h2 { font-size: 1.6rem; }
.single-post__content h3 { font-size: 1.3rem; }

.single-post__content a {
	color: var(--black);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.single-post__content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.single-post__content blockquote {
	margin: 2rem 0;
	padding-left: 1.5rem;
	border-left: 3px solid var(--grey-300);
	color: var(--grey-500);
	font-style: italic;
}

.single-post__content ul,
.single-post__content ol {
	padding-left: 1.5rem;
}

.single-post__content li {
	margin-bottom: 0.5rem;
}

.single-post__content code {
	background: var(--off-white);
	padding: 0.15em 0.4em;
	border-radius: 4px;
	font-size: 0.9em;
}

.single-post__content pre {
	background: var(--off-white);
	padding: 1.25rem;
	border-radius: 10px;
	overflow-x: auto;
}

/* ── Tags ── */
.single-post__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2.5rem;
}

.single-post__tags a {
	font-size: 0.82rem;
	color: var(--grey-700);
	background: var(--off-white);
	padding: 0.35rem 0.8rem;
	border-radius: 100px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.single-post__tags a:hover {
	background: var(--grey-300);
}

/* ── Author box ── */
.author-box {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	margin-top: 3rem;
	padding: 1.75rem;
	background: var(--off-white);
	border-radius: 14px;
}

.author-box--header {
	background: transparent;
	padding: 0;
	margin-top: 0;
}

.author-box img {
	border-radius: 50%;
	flex-shrink: 0;
}

.author-box__name {
	font-family: var(--display);
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.author-box--header .author-box__name {
	font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.author-box__name a {
	color: var(--black);
	text-decoration: none;
}

.author-box__bio {
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--grey-700);
}

/* ── Post navigation (prev / next) ── */
.post-nav {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--grey-300);
	font-size: 0.95rem;
}

.post-nav a {
	color: var(--black);
	text-decoration: none;
	font-weight: 500;
}

.post-nav a:hover {
	opacity: 0.7;
}

.post-nav__next {
	text-align: right;
	margin-left: auto;
}

/* ── Pagination ── */
.pagination {
	margin-top: 4rem;
	display: flex;
	justify-content: center;
}

.pagination .nav-links {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	height: 2.4rem;
	padding: 0 0.5rem;
	border-radius: 8px;
	color: var(--grey-700);
	text-decoration: none;
	font-size: 0.9rem;
	transition: background 0.15s ease;
}

.pagination .page-numbers:hover {
	background: var(--off-white);
}

.pagination .page-numbers.current {
	background: var(--black);
	color: var(--white);
}

/* ── Search form ── */
.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 420px;
}

.search-form__input {
	flex: 1;
	font-family: var(--body);
	font-size: 0.95rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--grey-300);
	border-radius: 8px;
	background: var(--white);
	color: var(--black);
}

.search-form__input:focus {
	outline: none;
	border-color: var(--black);
}

.search-form__submit {
	font-family: var(--body);
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.7rem 1.25rem;
	border: none;
	border-radius: 8px;
	background: var(--black);
	color: var(--white);
	cursor: pointer;
}

.search-form__submit:hover {
	opacity: 0.85;
}

.blog-empty {
	font-size: 1.05rem;
	color: var(--grey-500);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
	.post-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 900px) {
	.blog-main {
		padding: 2.5rem 2rem 5rem;
	}
}

@media (max-width: 640px) {
	.blog-main {
		padding: 2rem 1.25rem 3.5rem;
	}

	.post-list {
		grid-template-columns: 1fr;
		gap: 2rem;
	}

	.post-nav {
		flex-direction: column;
		gap: 0.75rem;
	}

	.post-nav__next {
		text-align: left;
		margin-left: 0;
	}
}
