@charset "UTF-8";

/**
 * Home page styles.
 *
 * @package museegodf
 * @author  Grégoire Noyelle
 * @license GPL-2.0-or-later
 * @link    https://www.gregoirenoyelle.com/
 */

/* Useful info */
.tw-usefull-logo {
	background: var(--wp--preset--color--tw-light) url("../img/patterns/assiette--optim.webp") left center no-repeat;
	background-size: 9%;
}

.tw-home-usefull-info {
	background: url("../img/patterns/fond-info-pratique-optim.webp") right center no-repeat;
	background-size: cover;
}

.tw-expos-content {
	position: relative;
}

.tw-expos-symbole {
	background: url("../img/patterns/triangle.png") center bottom no-repeat;
	position: absolute;
	top: -66px;
	left: 50%;
	transform: translateX(-50%);
	min-width: 257px;
	min-height: 68px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.tw-expos-content {
	min-height: 180px;
}

.tw-expos-button {
	position: absolute;
	bottom: -24px;
	left: 0;
	right: 0;
	text-align: center;
	z-index: 1;
}

/* News loops (#tw-news-loops)
   ========================================================================== */

#tw-news-loops {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: repeat(2, minmax(300px, 1fr));
	gap: var(--wp--preset--spacing--tw-small);
}

/* Featured card fills the full height on the left */
#tw-news-loops .tw-news-card--featured {
	grid-column: 1;
	grid-row: 1 / 3;
}

/* Query + post-template stretch to fill the grid cell so cards match height */
#tw-news-loops .tw-news-card,
#tw-news-loops .wp-block-post-template {
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

#tw-news-loops .wp-block-post-template > li {
	height: 100%;
}

/* Card — media + body side by side */
.tw-news-card__inner {
	display: flex;
	height: 100%;
	overflow: hidden;
}

.tw-news-card__media {
	margin: 0;
	overflow: hidden;
}

.tw-news-card__media a {
	display: block;
	height: 100%;
}

.tw-news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Body — content flows from the top; vertical offset comes from padding-top */
.tw-news-card__body {
	flex: 1;
}

/* Featured card proportions */
.tw-news-card--featured .tw-news-card__media {
	flex: 0 0 50%;
}

.tw-news-card--featured .tw-news-card__body {
	padding: var(--wp--preset--spacing--tw-intermediate) var(--wp--preset--spacing--tw-normal) var(--wp--preset--spacing--tw-large);
}

/* Small cards proportions */
.tw-news-card--small .tw-news-card__media {
	flex: 0 0 33%;
}

/* Small cards: clamp the excerpt so cards keep the same height whatever the text length */
.tw-news-card--small .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

.tw-news-card--small .tw-news-card__body {
	padding: var(--wp--preset--spacing--tw-extra-small) var(--wp--preset--spacing--tw-small) var(--wp--preset--spacing--tw-small);
}

/* Mobile / tablet */
@media (max-width: 1019px) {
	.tw-home-cover-title-column-logo {
		/* Semi-transparent white — no theme variable available for alpha variants */
		background-color: #ffffffeb;
		padding: var(--wp--preset--spacing--tw-normal);
	}

	#tw-news-loops {
		grid-template-columns: 1fr;
		grid-template-rows: none;
	}

	#tw-news-loops .tw-news-card--featured {
		grid-column: auto;
		grid-row: auto;
	}

	#tw-news-loops .tw-news-card,
	#tw-news-loops .wp-block-post-template,
	#tw-news-loops .wp-block-post-template > li,
	.tw-news-card__inner {
		height: auto;
	}

	.tw-news-card__inner {
		flex-direction: column;
	}

	.tw-news-card__media {
		flex: none;
		aspect-ratio: auto !important;
		height: auto !important;
	}

	.tw-news-card__media a {
		height: auto;
	}

	.tw-news-card__media img {
		height: auto;
		aspect-ratio: 16 / 9 !important;
	}
}

@media (min-width: 1020px) {
	.tw-expos-content {
		min-height: 300px;
	}
}

@media (min-width: 1250px) {
	.tw-expos-content {
		min-height: 232px;
	}
}

@media (max-width: 1198px) {
	.tw-home-cover-title-content {
		padding-left: 0 !important;
	}
}

