/**
 * Territory Music Gallery — equal-height grid + expanding details.
 *
 * Tiles are laid out with CSS Grid (no JavaScript). The expanding content
 * uses the native <details>/<summary> element, animated with the CSS
 * grid-template-rows technique.
 */

/* ---- Grid container (equal-height tiles) -------------------------------- */
.tmg-gallery {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 1.25rem;
}

@media (min-width: 40rem) {
	.tmg-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64rem) {
	.tmg-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---- Card --------------------------------------------------------------- */
.tmg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #4d4d4d;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tmg-card__media img {
	display: block;
	width: 100%;
	height: auto;
}

.tmg-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 1rem 1.1rem 1.1rem;
}

.tmg-card__title {
	margin: 0 0 0.25rem;
	font-size: 1.15rem;
	line-height: 1.25;
}

.tmg-card__meta {
	margin: 0 !important;
	font-size: 0.9rem;
	font-weight: 600;
	color: #4b5563;
}

.tmg-card__credit {
	margin: 0.1rem 0 0.75rem !important;
	font-size: 0.82rem;
	color: #6b7280;
}

/* ---- Expandable summary ------------------------------------------------- */
.tmg-card__details {
	margin-top: auto;
}

.tmg-card__summary {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	list-style: none;
	font-size: 0.9rem;
	font-weight: 600;
	color: #4b5563;
	padding: 0.4rem 0;
	user-select: none;
}

.tmg-card__summary::-webkit-details-marker {
	display: none;
}

.tmg-card__summary:hover {
	color: #374151;
}

/* Swap "Read more" / "Read less" labels when open */
.tmg-summary-label--less {
	display: none;
}

.tmg-card__details[open] .tmg-summary-label--more {
	display: none;
}

.tmg-card__details[open] .tmg-summary-label--less {
	display: inline;
}

/* ---- Smooth expand (grid-template-rows 0fr -> 1fr) ---------------------- */
.tmg-card__content {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.35s ease;
}

.tmg-card__details[open] .tmg-card__content {
	grid-template-rows: 1fr;
}

.tmg-card__content-inner {
	overflow: hidden;
	min-height: 0;
}

.tmg-card__content p {
	margin: 0 0 0.75rem !important;
	font-size: 0.92rem;
	line-height: 1.55;
	color: #374151;
}

.tmg-card__content p:last-child {
	margin-bottom: 0 !important;
}

/* Optional: respect the block's wide/full alignment. */
.wp-block-musicnt-territory-gallery.alignwide .tmg-gallery {
	/* widen the gallery inside a "wide" aligned block if desired */
}
