/**
 * Bloc : Texte & Photo (ri-texte-photo)
 * Convention : classe complète sur la section, classes courtes scopées dedans.
 */

/* ========================================
   Base
   ======================================== */

.ri-texte-photo {
	width: 100%;
	padding-block: 0 var(--ri-block-padding-xl);
	background-color: var(--ri-color-white);
}

.ri-texte-photo > .ri-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: stretch;
	margin: 0;
	border: 1px solid var(--ri-color-yellow);
	padding: 16px;
}

/* ========================================
   Colonne texte
   ======================================== */

.ri-texte-photo .content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 24px;
}

.ri-texte-photo .surtitre,
.ri-texte-photo .title,
.ri-texte-photo .title p {
	margin: 0;
}

.ri-texte-photo .title {
	font: 700 var(--ri-size-title-h2) / 140% var(--ri-font-1);
}

.ri-texte-photo .title strong {
	color: var(--ri-color-yellow);
	font-weight: inherit;
}

.ri-texte-photo .description {
	font: 400 var(--ri-size-text-body) / 1.5 var(--ri-font-1);
}

.ri-texte-photo .description p:last-child {
	margin-bottom: 0;
}


/* ========================================
   Colonne photo — fond jaune + SVG
   ======================================== */

.ri-texte-photo .gallery {
	position: relative;
	overflow: hidden;
	background-color: var(--ri-color-yellow);
}

/* SVG décoratif en arrière-plan */
.ri-texte-photo .gallery-deco {
	position: absolute;
	inset: 0 0 auto auto;
	width: 60%;
	height: 100%;
	pointer-events: none;
}

.ri-texte-photo .figure {
	position: relative;
	z-index: 1;
	margin: 0;
	height: 100%;
}

.ri-texte-photo .img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ========================================
   Modificateur — galerie à gauche
   ======================================== */

.ri-texte-photo.is-inversed > .ri-container {
	grid-template-areas: "gallery content";
}

.ri-texte-photo.is-inversed .gallery {
	grid-area: gallery;
}

.ri-texte-photo.is-inversed .content {
	grid-area: content;
}

/* ========================================
   Variantes de fond
   ======================================== */

.ri-texte-photo.has-text-color .title,
.ri-texte-photo.has-text-color .description,
.ri-texte-photo.has-text-color .link-arrow,
.ri-texte-photo.has-text-color .link {
	color: inherit;
}

.ri-texte-photo.has-text-1-background-color {
	color: var(--ri-color-white);
}

.ri-texte-photo.has-text-1-background-color .link:hover {
	text-decoration-color: var(--ri-color-white);
}

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

@media (max-width: 782px) {

	.ri-texte-photo > .ri-container,
	.ri-texte-photo.is-inversed > .ri-container {
		grid-template-columns: 1fr;
		grid-template-areas: none;
		gap: 0;
	}

	.ri-texte-photo .gallery {
		order: -1;
		height: 260px;
		min-height: unset;
	}

	.ri-texte-photo .figure,
	.ri-texte-photo .img {
		height: 260px;
	}
}

/* ========================================
   Placeholder (éditeur)
   ======================================== */

.ri-texte-photo.is-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	padding: var(--ri-space-lg);
	background-color: var(--ri-color-grey-light);
	border: 2px dashed var(--ri-color-grey);
	text-align: center;
}
