/* Homepage "コラム" section (Option B: vertical cards).
   Everything is scoped under .gh-column-cards (class set on the Columns
   block), so no other section or page is affected. */

.gh-column-cards.wp-block-columns {
	gap: 24px;
	margin-top: 0;
	margin-bottom: 0;
}

.gh-column-cards > .wp-block-column {
	display: flex;
}

.gh-column-cards .gh-column-card {
	margin: 0 !important; /* core/Astra give a Group 24px top/bottom margin */
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	box-sizing: border-box;
	padding: 12px;
	background: #fff;
	border: 1px solid #efe6d3;
	border-radius: 16px;
}

/* Core's 24px block gap lands on children as margin; the card controls its
   own spacing with flex gap instead. */
.gh-column-cards .gh-column-card > * {
	margin-block: 0 !important;
}

.gh-column-cards .gh-column-card .wp-block-image,
.gh-column-cards .gh-column-card .wp-block-image a {
	display: block;
	width: 100%;
}
.gh-column-cards .gh-column-card .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
}

.gh-column-cards .gh-column-card .gh-column-date {
	margin: 0;
	padding: 0 4px;
	font-size: 12px;
	line-height: 1.6;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #6b7280;
}

.gh-column-cards .gh-column-card .gh-column-title {
	margin: 0;
	padding: 0 4px 6px;
	font-size: 15px !important;
	line-height: 1.7 !important;
	font-weight: 700 !important;
	letter-spacing: 0;
	word-spacing: 0;
	color: #222;
}
.gh-column-cards .gh-column-card .gh-column-title a {
	color: #222;
	text-decoration: none;
}
.gh-column-cards .gh-column-card .gh-column-title a:hover,
.gh-column-cards .gh-column-card .gh-column-title a:focus-visible {
	color: #f08205;
}

/* ---- Dynamic variant: Query Loop (core/query) with class .gh-column-cards
   on the Query block itself. Same card look, driven by the latest posts. ---- */
.gh-column-cards .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.gh-column-cards .wp-block-post-template > li {
	display: flex;
	margin: 0 !important;
	padding: 0 !important;
}
/* Core's flow-layout block gap (24px) and Astra's list margins would add
   extra space above the grid and between stacked cards. */
.gh-column-section > .wp-block-query.gh-column-cards {
	margin-block-start: 0 !important;
}
.gh-column-cards .wp-block-post-template {
	margin: 0 !important;
	padding: 0 !important;
}
.gh-column-cards .gh-column-card .wp-block-post-featured-image {
	display: block;
	width: 100%;
	margin: 0;
}
.gh-column-cards .gh-column-card .wp-block-post-featured-image a {
	display: block;
}
.gh-column-cards .gh-column-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
}
/* A post with no featured image: the Post Featured Image block renders
   nothing at all, so give the card a 4:3 slot with the site logo instead
   (same logo + cream background the /column/ list uses for such posts).
   The pseudo-element is the card's first flex child, so it sits on top. */
.gh-column-cards .gh-column-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	background: #fbf6ed url("../images/ouchi-dekiru-koto-logo.png") center / 68% auto no-repeat;
}
@media (max-width: 1024px) {
	.gh-column-cards .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 781px) {
	.gh-column-cards .wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
}

/* Space between the card grid and the "コラム一覧を見る" button (design: 40px). */
.gh-column-section > .wp-block-buttons {
	margin-top: 40px;
}

@media (max-width: 781px) {
	.gh-column-cards.wp-block-columns {
		gap: 16px;
	}
	.gh-column-section > .wp-block-buttons {
		margin-top: 28px;
	}
}
