/**
 * Checkhouse EVENT Display Fix
 *
 * These rules are scoped by body classes added by the plugin.
 */

/* Top-page EVENT slider: preserve the complete thumbnail. */
body.checkhouse-event-display-fix-front .top_event_slider .ev-thumb {
	background: #fff !important;
}

/* Affiliate front page: #eventArea uses thumbnail, not the official slider. */
body.checkhouse-event-display-fix-front #eventArea > li {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

body.checkhouse-event-display-fix-front #eventArea > li > a {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
}

body.checkhouse-event-display-fix-front #eventArea > li > a > img.wp-post-image {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: 4 / 5 !important;
	object-fit: contain !important;
	object-position: center !important;
	background: #fff;
}

/* Affiliate archive: replace fixed-height floats with equal-height grid rows. */
body.checkhouse-event-display-fix-archive #info_main .info_contents {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px 20px;
	align-items: stretch;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl {
	display: flex;
	flex-direction: column;
	float: none;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl > a {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl > a > dt {
	display: block;
	flex: 0 0 auto;
	width: 100% !important;
	height: auto;
	margin: 0;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: #fff;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl > a > dt > img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-height: none !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl > a > dd {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	width: 100%;
	margin: 0;
	padding: 12px 0 0;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents > dl > a > dd > p:last-child {
	margin-bottom: 0;
}

body.checkhouse-event-display-fix-archive #info_main .info_contents .event-day-link {
	margin-top: auto;
}

@media (max-width: 769px) {
	body.checkhouse-event-display-fix-archive #info_main .info_contents {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 16px;
	}
}

body.checkhouse-event-display-fix-front .top_event_slider .ev-thumb > img.wp-post-image {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
}

/* EVENT archive: complete thumbnails and bottom-aligned detail buttons. */
body.checkhouse-event-display-fix-archive .info_main .event-day-item {
	display: flex;
	flex-direction: column;
}

body.checkhouse-event-display-fix-archive .info_main .event-day-item > figure {
	width: 100%;
	aspect-ratio: 850 / 638;
	overflow: hidden;
	background: #f6f6f6;
}

body.checkhouse-event-display-fix-archive .info_main .event-day-item > figure > img {
	display: block;
	width: 100%;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: contain !important;
	object-position: center !important;
}

body.checkhouse-event-display-fix-archive .info_main .event-day-oher {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

body.checkhouse-event-display-fix-archive .info_main .event-day-link {
	margin-top: auto;
}

@media (max-width: 767px) {
	body.checkhouse-event-display-fix-archive .info_main .event-day-item > figure {
		aspect-ratio: 8 / 5;
	}
}
