/* ==========================================================================
   Masonry Posts Block
   ========================================================================== */

.masonry-posts-block {
	padding: 2rem 0;
}

.masonry-posts-block__header {
	max-width: 1200px;
	margin: 0 auto 1.5rem;
	padding: 0 1rem;
}

.masonry-posts-block__title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0;
	color: var(--wdg-color-primary);
}

/* Grid container
   ========================================================================== */

.masonry-posts-grid {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

.masonry-posts-grid::after {
	content: '';
	display: block;
	clear: both;
}

.masonry-posts-sizer {
	width: calc(33.333% - 12px);
	height: 0;
	float: left;
}

/* Tile
   ========================================================================== */

.masonry-posts-item {
	display: block;
	position: relative;
	overflow: hidden;
	float: left;
	width: calc(33.333% - 12px);
	margin-bottom: 16px;
	border-radius: 8px;
	border: 4px solid var(--wdg-color-white, white);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: transparent;
	text-decoration: none;
	transition: border 0.25s ease;
	cursor: pointer;
	box-sizing: border-box;
	outline:none;
}

.masonry-posts-item:hover,
.masonry-posts-item:focus-visible {
	border: 4px solid var(--wdg-color-secondary);
	outline: none;
}

/* Height variations â€” all tiles same width for gap-free packing */

.masonry-posts-item--tall {
	height: 360px;
}

.masonry-posts-item--medium {
	height: 280px;masonry-posts
}

.masonry-posts-item--short {
	height: 220px;
}

/* Gradient overlay â€” covers bottom third */

.masonry-posts-item__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		transparent 20%,
		color-mix(in srgb, var(--wdg-color-primary) 70%, transparent) 55%,
		var(--wdg-color-primary)
	);
	pointer-events: none;
	border-radius: inherit;
}

/* Coverage layer: keeps the tile at a >=50% tint at rest for contrast,
   then fades out on hover to reveal the lighter base gradient. */
.masonry-posts-item__overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		color-mix(in srgb, var(--wdg-color-primary) 50%, transparent) 20%,
		transparent 65%
	);
	border-radius: inherit;
	opacity: 1;
	transition: opacity 0.5s ease;
}

.masonry-posts-item:hover .masonry-posts-item__overlay::before,
.masonry-posts-item:focus-visible .masonry-posts-item__overlay::before {
	opacity: 0;
}

/* Content area (title + pill + date) */

.masonry-posts-item__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 1rem 1.125rem;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.masonry-posts-item__title {
	color: var(--wdg-color-white);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.masonry-posts-item__date {
	color: var(--wdg-color-white);
	font-size: 0.75rem;
	opacity: 0.85;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	padding-top: 0;
	margin-top: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
	.masonry-posts-sizer,
	.masonry-posts-item {
		width: calc(50% - 10px);
	}

	.masonry-posts-item--tall {
		height: 300px;
	}

	.masonry-posts-item--medium {
		height: 240px;
	}

	.masonry-posts-item--short {
		height: 200px;
	}
}

@media (max-width: 560px) {
	.masonry-posts-sizer,
	.masonry-posts-item {
		width: 100%;
	}

	.masonry-posts-item--tall {
		height: 280px;
	}

	.masonry-posts-item--medium {
		height: 240px;
	}

	.masonry-posts-item--short {
		height: 200px;
	}

	.masonry-posts-block__title {
		font-size: 1.375rem;
	}
}
