/**
 * MH City notes (mh-notes) and the shared note card (template-parts/note-card.php).
 * Figma: Home "V10 City notes", single post "More city notes", City notes listing.
 * Desktop: 3 × 384 (photo 384 × 256) or 2 × 588 (photo 588 × 392), gap 24.
 * Tablet: columns kept. Phone: scroll row, 280 wide cards, photo 280 × 220.
 *
 * Templates can reuse the list: <div class="mh-notes__list mh-notes__list--cols-2 mh-scroll mh-bleed">
 * inside a .mh-container.
 */

/* ------------------------------------------------------------------ */
/* Card                                                                */
/* ------------------------------------------------------------------ */

.mh-note-card {
	position: relative;
	min-width: 0;
}

.mh-note-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 2;
	border-radius: var(--mh-radius);
	background: var(--mh-c-line);
}

/* Absolute fill: a percentage height alone does not stretch photos of another ratio. */
.mh-note-card__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.mh-note-card:hover .mh-note-card__media img {
	transform: scale(1.02);
}

.mh-note-card .mh-note-card__title {
	margin: 12px 0 0;
	color: var(--mh-heading, var(--mh-c-ink));
}

.mh-note-card__link {
	color: inherit;
	text-decoration: none;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

/* Stretched link: the whole card is the target. */
.mh-note-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: var(--mh-radius);
}

.mh-note-card:hover .mh-note-card__link,
.mh-note-card__link:focus-visible {
	text-decoration-line: underline;
}

.mh-note-card__link:focus-visible {
	outline: 0;
}

.mh-note-card__link:focus-visible::after {
	outline: 2px solid var(--mh-c-blue);
	outline-offset: 4px;
}

.mh-note-card .mh-note-card__meta {
	margin: 12px 0 0;
	color: var(--mh-muted, var(--mh-c-muted));
	font-size: var(--mh-fs-small);
	line-height: var(--mh-lh-small);
}

/* ------------------------------------------------------------------ */
/* List                                                                */
/* ------------------------------------------------------------------ */

.mh-notes__list--cols-2 .mh-note-card__media {
	aspect-ratio: 588 / 392;
}

@media (min-width: 768px) {
	.mh-notes__list.mh-scroll {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
		scroll-snap-type: none;
	}

	.mh-notes__list--cols-2.mh-scroll {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.mh-notes__list.mh-scroll {
		gap: 16px;
	}

	.mh-notes__list .mh-note-card {
		width: 280px;
		max-width: calc(100vw - 2 * var(--mh-gutter) - 24px);
	}

	.mh-notes__list .mh-note-card__media,
	.mh-notes__list--cols-2 .mh-note-card__media {
		aspect-ratio: 280 / 220;
	}
}

.mh-notes__empty {
	color: var(--mh-muted);
}
