/* ============================================================
   DAL'ALU — Page Blog : bandeau + filtres + grille d'articles
   Même structure que la page Réalisations (realisations.css).
   Les cartes elles-mêmes sont les .dal-actu de l'accueil
   (home.css, chargé aussi par le shortcode).
   ============================================================ */

.dal-blog {
	padding-bottom: 80px;
}

/* ── Fil d'ariane ── */
.dal-blog__fil {
	padding: 18px 0 8px;
	font-size: 13px;
	color: #888;
}

.dal-blog__fil .dal-container {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.dal-blog__fil a {
	color: #888;
	text-decoration: none;
}

.dal-blog__fil a:hover {
	color: var(--dal-red, #DC0D15);
}

.dal-blog__fil span {
	margin: 0 6px;
}

/* ── Bandeau : image + languette rouge à gauche ──
   Centrage/alignement en flex : aucun transform ni z-index sur le panneau,
   sinon le mix-blend-mode du fond rouge serait piégé dans un stacking context. */
.dal-blog__hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 80%;
	min-height: 260px;
	margin: 8px auto 0;
}

/* Fond de repli si l'image ne charge pas, même retrait qu'elle */
.dal-blog__hero::before {
	content: "";
	position: absolute;
	inset: 0 0 0 50px;
	background: #cfcfcf;
	border-radius: 24px;
}

.dal-blog__hero-img {
	position: absolute;
	inset: 0 0 0 50px;
	width: calc(100% - 50px);
	height: 100%;
	object-fit: cover;
	object-position: center 40%;
	border-radius: 24px;
	display: block;
}

/* Languette : part du bord gauche du conteneur, l'image est en retrait */
.dal-blog__hero-panel {
	position: relative;
	color: #fff;
	padding: 32px 90px;
	border-radius: 30px 200px 200px 30px;
	max-width: 75%;
}

.dal-blog__hero-panel-bg {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--dal-red, #DC0D15);
	mix-blend-mode: hard-light;
	/* Dépliage à l'arrivée sur la page (keyframes dans global.css) */
	transform-origin: left center;
	animation: dal-vignette-deplie .6s cubic-bezier(.22, .61, .36, 1) both;
}

.dal-blog__hero-panel-texte {
	position: relative;
	z-index: 1;
	display: block;
	/* Le texte apparaît après le dépliage du fond */
	animation: dal-vignette-titre .45s ease .5s both;
}

.dal-blog__hero-titre {
	margin: 0;
	font-size: clamp(1.85rem, 2.6vw, 44px);
	font-weight: 600;
}

.dal-blog__hero-sous {
	margin: 6px 0 0;
	font-size: clamp(1rem, 1.4vw, 17px);
	font-weight: 500;
}

/* ── Corps : colonne de filtres + grille ──
   Gap filtres↔grille fluide, comme sur les réalisations. */
.dal-container.dal-blog__body {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	row-gap: 48px;
	column-gap: clamp(32px, 12%, 200px);
	margin-top: 48px;
	align-items: start;
}

/* ── Filtres : colonne collée à gauche pendant le scroll ── */
.dal-blog__filtres {
	position: sticky;
	top: 140px;
	align-self: start;
	max-height: calc(100vh - 160px);
	overflow-y: auto;
}

.dal-blog__filtre-groupe {
	margin-bottom: 32px;
}

.dal-blog__filtre-titre {
	font-size: 20px;
	font-weight: 600;
	color: #000;
	margin: 0 0 16px;
}

.dal-blog__check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 400;
	font-size: 16px;
	cursor: pointer;
	margin-bottom: 12px;
}

.dal-blog__check input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.dal-blog__check-box {
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--dal-red, #DC0D15);
	border-radius: 4px;
	flex-shrink: 0;
	position: relative;
	transition: border-color .15s ease;
}

.dal-blog__check input:checked+.dal-blog__check-box {
	border-color: var(--dal-red, #DC0D15);
	background: var(--dal-red, #DC0D15);
}

.dal-blog__check input:checked+.dal-blog__check-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ── Grille d'articles ──
   2 colonnes égales maximum, cartes jamais plus étroites que 320px :
   - calc(50% - 24px) (24 = moitié du gap 48px) : 2 colonnes max ;
   - max(..., 320px) : sous ce seuil, auto-fill bascule en 1 colonne ;
   - min(100%, 320px) : sur très petit écran la carte prend 100%. */
.dal-blog__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 320px), calc(50% - 24px)), 1fr));
	gap: 48px;
	align-items: start;
}

/* Neutralise le dimensionnement "carrousel" des cartes de l'accueil */
.dal-blog__item.dal-actu {
	flex: none;
	width: 100%;
	min-width: 0;
}

.dal-blog__item[hidden] {
	display: none;
}

.dal-blog__vide {
	grid-column: 1 / -1;
	font-size: 16px;
	color: #555;
}

/* Bouton "Voir plus" sous la grille, pleine largeur, centré */
.dal-blog__more {
	grid-column: 2;
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.dal-blog__more-btn {
	padding: 12px 40px;
	font-size: 18px;
	font-weight: 500;
	cursor: pointer;
}

.dal-blog__more-btn[hidden] {
	display: none;
}

/* ── Bouton "Filtrer" (mobile uniquement) ── */
.dal-blog__filtres-toggle {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 12px 20px;
	border: 1.5px solid var(--dal-red, #DC0D15);
	border-radius: 12px;
	background: #fff;
	color: var(--dal-red, #DC0D15);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.dal-blog__filtres-toggle-fleche {
	width: 9px;
	height: 9px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	transition: transform .2s ease;
	margin-top: -4px;
}

.dal-blog__filtres-toggle[aria-expanded="true"] .dal-blog__filtres-toggle-fleche {
	transform: rotate(-135deg);
	margin-top: 4px;
}

/* ── Apparition légère des cartes au scroll ──
   .dal-anim-ready n'est posée que par le JS → sans JS rien n'est masqué. */
@media (prefers-reduced-motion: no-preference) {
	.dal-blog__item.dal-anim-ready {
		opacity: 0;
		transform: translateY(14px);
		transition: opacity .5s ease, transform .5s ease;
		will-change: opacity, transform;
	}

	.dal-blog__item.dal-anim-ready.is-visible {
		opacity: 1;
		transform: none;
	}
}

/* ── Responsive ── */
@media (max-width: 1100px) {
	.dal-container.dal-blog__body {
		grid-template-columns: 180px minmax(0, 1fr);
	}
}

@media (max-width: 768px) {
	.dal-container.dal-blog__body {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 24px;
	}

	.dal-blog__grid {
		gap: 32px;
	}

	.dal-blog__more {
		grid-column: 1;
	}

	/* Filtres repliés derrière le bouton "Filtrer" */
	.dal-blog__filtres-toggle {
		display: flex;
	}

	.dal-blog__filtres {
		display: none;
		position: static;
		max-height: none;
		overflow: visible;
	}

	.dal-blog__filtres.is-open {
		display: block;
	}

	.dal-blog__filtres .dal-blog__filtre-groupe:last-child {
		margin-bottom: 8px;
	}
}

@media (max-width: 700px) {
	/* Hauteur de référence mobile : celle du hero de la page histoire */
	.dal-blog__hero {
		min-height: 220px;
	}

	/* Retrait de l'image réduit : la languette ne déborde plus que de 16px */
	.dal-blog__hero::before,
	.dal-blog__hero-img {
		inset: 0 0 0 16px;
	}

	.dal-blog__hero-img {
		width: calc(100% - 16px);
	}

	.dal-blog__hero-panel {
		padding: 20px 32px 20px 48px;
		box-sizing: border-box;
		max-width: 85%;
	}
}

/* Mobile : marge latérale 16px (comme .dal-container de global.css) */
@media (max-width: 600px) {
	.dal-blog .dal-container {
		width: 100%;
		padding-left: max(16px, 4vw);
		padding-right: max(16px, 4vw);
		box-sizing: border-box;
	}

	.dal-blog__hero {
		width: auto;
		margin-left: max(16px, 4vw);
		margin-right: max(16px, 4vw);
	}

	/* La languette du titre vient toucher le bord gauche de l'écran */
	.dal-blog__hero-panel {
		margin-left: calc(-1 * max(16px, 4vw));
		max-width: calc(100% + max(16px, 4vw) - 24px);
		padding: 20px 32px 20px calc(max(16px, 4vw) + 32px);
		border-radius: 0 200px 200px 0;
	}
}
