/* Blog page
   Loaded by blog.php for both the desktop and the mobile template.
   Columns follow the width of the content column (container queries), not the
   viewport: the desktop template keeps a fixed 1100px column even on tablets.
   Base rules = one column; 2 and 3 columns are layered on with @container.
   Every card is built on a 24px line grid (title and intro share it), so the
   intro text can be clamped to a whole number of lines and fill the card exactly.
   The small script at the bottom of blog.php only raises the clamp for cards
   with short titles; without it the cards still line up at 4 lines.
   Colors and fonts come from the site stylesheets.
-----------------------------------------------------------------------------*/

.blog {
	container: blog / inline-size;
	--blog-red: #d34d35;
	--blog-green: #5d691e;
	--blog-ink: #222;
	--blog-text: #222;
	--blog-line: #c4bca6;
	--blog-gap: 28px;
	--blog-lh: 24px;
	--blog-lines: 5;
	--blog-cream: #f2ecd5;
}

.blog_intro {
	margin: 0 0 32px;
}

.blog_grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--blog-gap);
}

/* card
-----------------------------------------------------------------------------*/
.blog_card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--blog-line);
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 3px 12px rgba(60, 48, 30, 0.18);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.blog_card:hover {
	transform: translateY(-4px);
	border-color: #a99f84;
	box-shadow: 0 14px 30px rgba(60, 48, 30, 0.28);
}

/* photo */
.blog_photo {
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: #e9e4d6;
	border-bottom: 3px solid var(--blog-green);
	transition: border-color 0.25s ease;
}
.blog_card:hover .blog_photo {
	border-bottom-color: var(--blog-red);
}
.blog_card .blog_photo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.blog_card:hover .blog_photo img {
	transform: scale(1.06);
}

/* text */
.blog_body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 20px 22px 0;
}
.blog_card h2.blog_title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 19px;
	line-height: var(--blog-lh);
	color: var(--blog-ink);
	overflow-wrap: break-word;
}
.blog_card .blog_title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}
.blog_card:hover .blog_title a {
	color: var(--blog-red);
}
.blog_excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--blog-lines);
	line-clamp: var(--blog-lines);
	margin: 0 0 12px;
	overflow: hidden;
	font-size: 15px;
	line-height: var(--blog-lh);
	color: var(--blog-text);
}

/* read more (its ::after stretches over the whole card, so the card is one click target) */
.blog_foot {
	margin-top: auto;
	padding: 13px 0 17px;
	border-top: 1px solid #e0dccd;
}
.blog_card a.blog_more {
	font-size: 14px;
	line-height: 22px;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--blog-red);
}
.blog_card a.blog_more:hover {
	text-decoration: none;
}
.blog_more::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
.blog_more span {
	display: inline-block;
	margin-left: 4px;
	transition: transform 0.25s ease;
}
.blog_card:hover .blog_more span {
	transform: translateX(5px);
}
.blog_more:focus-visible::after {
	outline: 3px solid var(--blog-red);
	outline-offset: -3px;
	border-radius: 6px;
}

/* closing banner (same look as the services page banner)
-----------------------------------------------------------------------------*/
.blog_cta {
	margin-top: 40px;
	background:
		linear-gradient(115deg, rgba(60, 48, 30, 0.92) 0%, rgba(75, 87, 29, 0.88) 62%, rgba(176, 56, 36, 0.92) 100%),
		url(images/slider/slide2.webp) center / cover no-repeat,
		#3c301e;
	border-radius: 3px;
	box-shadow: 0 6px 18px rgba(60, 48, 30, 0.3);
	color: var(--blog-cream);
	text-align: center;
}
.blog_cta_inner {
	padding: 44px 28px 46px;
}
.blog_cta_inner::before {
	content: "";
	display: block;
	width: 44px;
	height: 3px;
	margin: 0 auto 16px;
	background: var(--blog-red);
}
.blog .blog_cta h2 {
	padding-bottom: 12px;
	font-size: 28px;
	line-height: 34px;
	color: var(--blog-cream);
	text-shadow: 3px 3px 2px rgba(1, 1, 1, 0.4);
}
.blog_cta p {
	max-width: 720px;
	margin: 0 auto 26px;
	text-shadow: 1px 1px 2px rgba(1, 1, 1, 0.5);
}
.blog_cta_buttons {
	display: grid;
	gap: 12px;
	max-width: 340px;
	margin: 0 auto;
}
.blog .blog_cta a.blog_btn {
	padding: 17px 24px;
	font-size: 16px;
	line-height: 18px;
	font-weight: 700;
	border: 2px solid var(--blog-red);
	border-radius: 3px;
	transform: none;
}
.blog .blog_cta a.blog_btn:hover,
.blog .blog_cta a.blog_btn:focus-visible {
	color: var(--blog-red);
	background: var(--blog-cream);
	border-color: var(--blog-cream);
	transform: none;
}
.blog .blog_cta a.blog_btn_alt {
	background: transparent;
	border-color: var(--blog-cream);
}
.blog .blog_cta a.blog_btn_alt:hover,
.blog .blog_cta a.blog_btn_alt:focus-visible {
	color: #3c301e;
}

/* 2 columns: equal-height cards, intro fills what the title leaves free
-----------------------------------------------------------------------------*/
@container blog (min-width: 600px) {
	.blog_grid {
		--blog-lines: 4;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: 1fr;
	}
	.blog_excerpt {
		flex: 1 1 0;
		min-height: calc(var(--blog-lh) * 4);
	}
}

/* 3 columns
-----------------------------------------------------------------------------*/
@container blog (min-width: 940px) {
	.blog_grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container blog (min-width: 600px) {
	.blog_cta_buttons {
		display: flex;
		justify-content: center;
		gap: 16px;
		max-width: none;
	}
	.blog_cta {
		margin-top: 48px;
	}
	.blog_cta_inner {
		padding: 56px 52px 58px;
	}
	.blog .blog_cta h2 {
		font-size: 34px;
		line-height: 42px;
	}
}
@container blog (min-width: 940px) {
	.blog_cta {
		margin-top: 56px;
	}
	.blog_cta_inner {
		padding: 64px 72px 66px;
	}
	.blog .blog_cta h2 {
		font-size: 38px;
		line-height: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.blog_card,
	.blog_card .blog_photo img,
	.blog_more span {
		transition: none;
	}
	.blog_card:hover,
	.blog_card:hover .blog_photo img,
	.blog_card:hover .blog_more span {
		transform: none;
	}
}
