/**
 * Homepage Section 9 — Blog Masonry Grid
 * Primary wrapper selector: .sm-section--home-9
 *
 * Matches studiom.ai Section 4 (data-section-id: 65c1ffa13d750d56de42100a):
 *   - data-section-theme: "white"
 *   - typeName: "blog-masonry"
 *   - sectionHeight: "section-height--medium"
 *   - contentWidth: "content-width--medium"
 *
 * Pixel-match values sourced from studiom.ai tweakJSON:
 *   - Columns       : 3 (desktop) / 2 (tablet) / 1 (mobile)
 *   - Column gap    : 75px (desktop), 40px (tablet)
 *   - Row gap       : 80px (desktop), 48px (tablet), 36px (mobile)
 *   - Image→title   : 37px  (tweakBlogMetaDataSpacing)
 *   - Title→date    : 20px
 *   - Section v-pad : 80px top/bottom desktop (section-height--medium)
 *                     48px mobile
 *
 * Empty-state behaviour: when no posts are published the section collapses
 * to zero height, matching studiom.ai which also shows nothing in that slot.
 *
 * SCOPE: Every selector MUST start with .sm-section--home-9.
 *        No bare/global selectors exist in this file.
 *
 * @package StudioM_Child
 */

/* ========================================================================
   Section Outer Container — full-width white block
   Zero own padding; vertical rhythm is applied on the post template so the
   section collapses cleanly when no posts are published (empty-state parity
   with the studiom.ai reference which also shows nothing in that slot).
   ======================================================================== */

.sm-section--home-9 {
	background-color: #ffffff;
	padding-top: 0;
	padding-bottom: 0;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Suppress TT5 global-padding on the outer wrapper */
.sm-section--home-9.has-global-padding,
.sm-section--home-9.is-layout-constrained {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Suppress TT5 global-padding on nested constrained blocks */
.sm-section--home-9 .has-global-padding,
.sm-section--home-9 .is-layout-constrained {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* ========================================================================
   Inner Container — max-width 1200px, centred (content-width--medium)
   ======================================================================== */

.sm-section--home-9 .sm-container {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px !important;
	padding-right: 20px !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

@media (min-width: 560px) {
	.sm-section--home-9 .sm-container {
		padding-left: 32px !important;
		padding-right: 32px !important;
	}
}

@media (min-width: 900px) {
	.sm-section--home-9 .sm-container {
		padding-left: 40px !important;
		padding-right: 40px !important;
	}
}

/* ========================================================================
   Query Block Wrapper
   ======================================================================== */

.sm-section--home-9 .wp-block-query {
	margin: 0;
	padding: 0;
}

.sm-section--home-9 .sm-masonry {
	width: 100%;
}

/* ========================================================================
   Vertical Rhythm — section-height--medium (80px desktop / 48px mobile)
   Applied to the post template so the section collapses to zero when empty.
   ======================================================================== */

.sm-section--home-9 .sm-masonry .wp-block-post-template {
	padding-top: 48px;
	padding-bottom: 48px;
}

@media (min-width: 900px) {
	.sm-section--home-9 .sm-masonry .wp-block-post-template {
		padding-top: 80px;
		padding-bottom: 80px;
	}
}

/* ========================================================================
   Post Template Grid — 1 → 2 → 3 columns
   Gaps from studiom.ai tweakJSON: 75px column / 80px row (desktop).
   align-items: start keeps natural card heights (masonry feel without JS).
   ======================================================================== */

.sm-section--home-9 .wp-block-post-template {
	display: grid !important;
	grid-template-columns: 1fr;
	gap: 36px 0;
	list-style: none;
	margin: 0;
	padding-left: 0;
	padding-right: 0;
	align-items: start;
}

@media (min-width: 560px) {
	.sm-section--home-9 .wp-block-post-template {
		grid-template-columns: repeat(2, 1fr);
		gap: 48px 40px;
	}
}

@media (min-width: 900px) {
	.sm-section--home-9 .wp-block-post-template {
		grid-template-columns: repeat(3, 1fr);
		gap: 80px 75px;
	}
}

/* ========================================================================
   Post Card Item
   ======================================================================== */

.sm-section--home-9 .wp-block-post {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin: 0;
	padding: 0;
}

/* WP block spacing normalisation */
.sm-section--home-9 .wp-block-post .wp-block-group {
	gap: 0;
}

/* ========================================================================
   Featured Image
   Full-width, natural height, 4px radius, linked.
   ======================================================================== */

.sm-section--home-9 .sm-masonry__thumb {
	width: 100%;
	margin: 0;
	padding: 0;
}

.sm-section--home-9 .sm-masonry__thumb a {
	display: block;
	line-height: 0;
}

.sm-section--home-9 .sm-masonry__thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
	object-fit: cover;
	transition: opacity 0.2s ease;
}

.sm-section--home-9 .sm-masonry__thumb a:hover img,
.sm-section--home-9 .sm-masonry__thumb a:focus-visible img {
	opacity: 0.88;
}

/* Posts without a featured image: hide the empty figure */
.sm-section--home-9 .sm-masonry__thumb:not(:has(img)) {
	display: none;
}

/* ========================================================================
   Post Title  (h3)
   Lexend Mega 500, 15px/1.45, dark #111111, linked.
   Image → title spacing: 37px  (studiom.ai tweakBlogMetaDataSpacing)
   ======================================================================== */

.sm-section--home-9 .sm-masonry__title {
	margin-top: 37px;
	margin-bottom: 0;
	padding: 0;
}

/* When no featured image precedes the title, reduce top gap */
.sm-section--home-9 .sm-masonry__thumb:not(:has(img)) + .sm-masonry__title {
	margin-top: 0;
}

.sm-section--home-9 .sm-masonry__title.wp-block-post-title {
	font-family: 'Lexend Mega', sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.01em;
	color: #111111;
}

.sm-section--home-9 .sm-masonry__title a,
.sm-section--home-9 .sm-masonry__title.wp-block-post-title a {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	color: #111111;
	text-decoration: none;
	transition: color 0.18s ease;
}

.sm-section--home-9 .sm-masonry__title a:hover,
.sm-section--home-9 .sm-masonry__title a:focus-visible {
	color: #555555;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sm-section--home-9 .sm-masonry__title a:focus-visible {
	outline: 2px solid #111111;
	outline-offset: 2px;
}

/* ========================================================================
   Post Date
   Chivo 300, 12px, muted gray #999999.
   Title → date spacing: 20px  (studiom.ai tweakBlogMetaDataSpacing)
   ======================================================================== */

.sm-section--home-9 .sm-masonry__date {
	margin-top: 20px;
	margin-bottom: 0;
	padding: 0;
}

.sm-section--home-9 .sm-masonry__date.wp-block-post-date,
.sm-section--home-9 .sm-masonry__date.wp-block-post-date a,
.sm-section--home-9 .sm-masonry__date.wp-block-post-date time {
	font-family: 'Chivo', sans-serif;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.6;
	letter-spacing: 0.01em;
	color: #999999;
	text-decoration: none;
}

/* ========================================================================
   Query No-Results — intentionally empty to match studiom.ai empty state
   ======================================================================== */

.sm-section--home-9 .wp-block-query-no-results {
	display: none;
}

/* ========================================================================
   WordPress Block Gap & List Normalisation — Section 9 scope only
   ======================================================================== */

.sm-section--home-9 .wp-block-post-template li {
	list-style: none;
	margin: 0;
	padding: 0;
}
