/* ==========================================================================
   Blog: /articles/, single articles, /3d-flip-book/ and other archives
   (inc/blog.php). Matched to live's Porto "large alt" blog, measured
   2026-10-08 at 1920px: a 70/30 split with a 20px gap, a 40px date badge
   20px left of each item, the sidebar's Recent Articles and Shop
   Categories widgets.
   ========================================================================== */

.blog-layout {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	column-gap: 20px;
	padding-top: 10px;
	padding-bottom: 60px;
}

/* --------------------------------------------------------------------------
   Item: date badge column, then the body
   -------------------------------------------------------------------------- */

.blog-item {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	grid-template-areas:
		"date image"
		".    body";
	column-gap: 20px;
	margin-bottom: 50px;
	font-family: "Open Sans", sans-serif;
}

/* Items without an image (the flip-book list): badge beside the text. */
.blog-item:not(:has(.blog-item__image)) {
	grid-template-areas: "date body";
}

.blog-date { grid-area: date; align-self: start; }
.blog-item__image { grid-area: image; }
.blog-item__body { grid-area: body; }

.blog-date {
	display: flex;
	flex-direction: column;
	text-align: center;
}

.blog-date__day {
	padding: 10px 0;
	background: #f4f4f4;
	color: #589f3c;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
}

.blog-date__month {
	padding: 1px 0;
	background: #589f3c;
	color: #fff;
	font-size: 14.4px;
	line-height: 22px;
}

.blog-item__image {
	display: block;
	margin-bottom: 29px;
}

.blog-item__image img {
	display: block;
	width: 100%;
	height: auto;
	/* Live crops list images to Porto's blog size (1068 x 634 at 1920). */
	aspect-ratio: 1068 / 634;
	object-fit: cover;
}

/* List titles: 28.8px/600 green. */
.blog-item__title {
	margin: 0 0 15px;
	color: #589f3c;
	font-family: "Open Sans", sans-serif;
	font-size: 28.8px;
	font-weight: 600;
	line-height: 37.44px;
}

.blog-item__title a {
	color: inherit;
	text-decoration: none;
}

.blog-item__excerpt {
	margin: 0 0 20px;
	color: #7b858a;
	font-size: 16px;
	line-height: 22px;
}

/* Meta on its own line, then "Read more..." below it on the right. */
.blog-item__footer {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
}

.blog-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	color: #7b858a;
	font-size: 14.4px;
	line-height: 22px;
}

.blog-meta a {
	color: inherit;
	text-decoration: none;
}

.blog-meta__icon {
	width: 12px;
	height: 12px;
	margin-right: 5px;
	fill: currentColor;
	vertical-align: -1px;
}

/* "Read more..." is Porto's small default button. */
.blog-item__more {
	align-self: flex-end;
	padding: 3.2px 8px;
	border: 1px solid #ccc;
	background: #fff;
	color: #666;
	font-size: 10px;
	line-height: 1.5;
	text-decoration: none;
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Single article: a small 18px title, meta 20px above the content
   -------------------------------------------------------------------------- */

.blog-item--single .blog-item__title {
	margin-bottom: 5px;
	font-size: 18px;
	font-weight: 700;
	line-height: 42px;
}

.blog-layout--search .blog-item__image img,
.blog-item--single .blog-item__image img {
	/* Single articles use a wider crop (1068 x 476 at 1920). */
	aspect-ratio: 1068 / 476;
}

.blog-item--single .blog-item__image {
	margin-bottom: 30px;
}

.blog-item--single .blog-meta {
	margin-bottom: 20px;
}

.blog-content {
	color: #7b858a;
	font-size: 16px;
	line-height: 22px;
}

.blog-content p {
	margin: 0 0 20px;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
	margin: 0 0 20px;
	color: #589f3c;
	font-size: 14px;
	font-weight: 700;
	line-height: 32px;
}

/* Live's article headings: H1 36px, H3 14px, H4 16px in a brighter green. */
.blog-content .pb-rich-text h1 {
	margin-bottom: 32px;
	color: #589f3c;
	font-size: 36px;
	font-weight: 700;
}

.blog-content .pb-rich-text h3 {
	margin-bottom: 20px;
	color: #589f3c;
	font-size: 14px;
	font-weight: 700;
	line-height: 32px;
}

.blog-content .pb-rich-text h4 {
	margin-bottom: 14px;
	color: #2bb436;
	font-size: 16px;
	font-weight: 700;
}

/*
 * Product grids in an article show 4 per row (3 below 1200px), as live's
 * do in its narrower article column; the migrated block says 6, set inline
 * as --pb-cols, hence !important.
 */
.blog-content .pb-products__grid {
	--pb-cols: 4 !important;
}

@media (max-width: 1199px) {
	.blog-content .pb-products__grid {
		--pb-cols: 3 !important;
	}
}

/*
 * Page blocks inside the article column: their sections are full-width
 * page sections elsewhere, so drop the page gutters and vertical padding
 * here and let the column set the width.
 */
.blog-content .pb-section {
	padding-top: 0;
	padding-bottom: 0;
}

.blog-content .pb-section__inner.site-container {
	padding-left: 0;
	padding-right: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.blog-sidebar {
	padding: 10px 10px 0;
	font-family: "Open Sans", sans-serif;
}

.blog-widget + .blog-widget {
	margin-top: 30px;
}

.blog-widget__title {
	margin: 0 0 15px;
	color: #222529;
	font-family: "Open Sans", sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 22.4px;
	text-transform: uppercase;
}

.blog-widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-widget--recent li {
	padding: 6px 0;
	color: #6b7479;
	font-size: 14.86px;
	line-height: 22px;
}

/* Live's chevron before each recent article. */
.blog-widget--recent li::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 10px 2px 2px;
	border-top: 1.5px solid currentColor;
	border-right: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.blog-widget--recent a {
	color: inherit;
	text-decoration: none;
}

.blog-widget--categories li {
	padding: 5px 0 0;
	font-size: 14.86px;
	line-height: 22px;
}

.blog-widget--categories .children {
	margin-left: 10px;
}

.blog-widget--categories a {
	color: #010101;
	font-size: 14px;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Below 992px: one column; the sidebar slides in from the right when the
   tab on the right edge is tapped (assets/js/blog-sidebar.js), as live's
   Porto blog does.
   -------------------------------------------------------------------------- */

.blog-sidebar-toggle,
.blog-sidebar-overlay {
	display: none;
}

@media (max-width: 991px) {
	.blog-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.blog-sidebar-toggle {
		position: fixed;
		top: 20%;
		right: 0;
		z-index: 9998;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid #e7e7e7;
		border-right: 0;
		background: #fff;
		color: #222529;
		cursor: pointer;
	}

	.blog-sidebar-overlay:not([hidden]) {
		position: fixed;
		inset: 0;
		z-index: 9998;
		display: block;
		background: rgba(0, 0, 0, 0.5);
	}

	.blog-sidebar {
		position: fixed;
		top: 0;
		right: 0;
		z-index: 9999;
		width: 350px;
		max-width: 90%;
		height: 100%;
		padding: 20px;
		overflow-y: auto;
		background: #fff;
		transform: translateX(100%);
		transition: transform 0.3s ease;
	}

	.blog-sidebar-open .blog-sidebar {
		transform: none;
	}

	/* Logged-in staff: start below the WordPress admin bar. */
	.admin-bar .blog-sidebar {
		top: 32px;
		height: calc(100% - 32px);
	}
}

@media (max-width: 782px) {
	.admin-bar .blog-sidebar {
		top: 46px;
		height: calc(100% - 46px);
	}
}

/* Phones: badge beside the image, then the text full width. */
@media (max-width: 575px) {
	.blog-item {
		grid-template-areas:
			"date image"
			"body body";
	}

	.blog-item__title {
		font-size: 23.4px;
		line-height: 30px;
	}

	/* Live drops the author on phones and puts "Read more..." on the left. */
	.blog-meta__author {
		display: none;
	}

	.blog-item__more {
		align-self: flex-start;
	}
}
