/* =====================================================================
   MAFOP — Page d'accueil (redesign novembre 2026)
   Toutes les règles sont limitées à .mh-home : aucune autre page n'est touchée.
   ===================================================================== */

.mh-home {
	--mh-green: #0c6d2a;
	--mh-green-dark: #08501f;
	--mh-green-soft: #e8f3ec;
	--mh-orange: #f39200;
	--mh-orange-dark: #d35400;
	--mh-yellow: #ffc20e;
	--mh-ink: #1d2a22;
	--mh-muted: #5f6b64;
	--mh-line: #e3e8e5;
	--mh-bg: #f6f8f7;
	--mh-radius: 12px;
	--mh-shadow: 0 1px 2px rgba(16, 40, 24, .06), 0 6px 18px rgba(16, 40, 24, .07);
	--mh-gap: 24px;

	/* compense le margin-top:-100px de #content (layout partagé) */
	padding: 120px 0 48px;
	color: var(--mh-ink);
	font-family: 'Lato', sans-serif;
	line-height: 1.55;
}

.mh-home *,
.mh-home *::before,
.mh-home *::after { box-sizing: border-box; }

.mh-home h2, .mh-home h3 { font-family: 'Poppins', sans-serif; color: var(--mh-ink); margin: 0; letter-spacing: 0; }
.mh-home p { margin: 0; }
.mh-home a { text-decoration: none; }
.mh-home img { max-width: 100%; display: block; }

.mh-sr-only {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Éléments communs ---------- */
.mh-card {
	background: #fff;
	border: 1px solid var(--mh-line);
	border-radius: var(--mh-radius);
	box-shadow: var(--mh-shadow);
	overflow: hidden;
}

.mh-section { margin-top: 48px; }

.mh-section-head {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
	margin-bottom: 16px;
}
.mh-section-title {
	font-size: 1.45rem; font-weight: 700; text-transform: none;
	position: relative; padding-left: 14px;
}
.mh-section-title::before {
	content: ""; position: absolute; left: 0; top: .2em; bottom: .2em;
	width: 5px; border-radius: 3px; background: var(--mh-green);
}
.mh-link-more {
	font-weight: 700; font-size: .92rem; color: var(--mh-green) !important; white-space: nowrap;
}
.mh-link-more:hover { color: var(--mh-orange-dark) !important; }

.mh-eyebrow {
	display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--mh-muted);
}

.mh-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 10px 20px; border-radius: 999px; border: 0;
	font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .92rem; line-height: 1.2;
	cursor: pointer; transition: transform .15s ease, background-color .15s ease;
}
.mh-btn:hover { transform: translateY(-1px); }
.mh-btn--accent { background: var(--mh-yellow); color: var(--mh-ink) !important; }
.mh-btn--accent:hover { background: #ffd23f; }
.mh-btn--light { background: #fff; color: var(--mh-orange-dark) !important; }
.mh-btn--block { width: 100%; padding: 12px 20px; }

.mh-grid { display: grid; gap: var(--mh-gap); }
.mh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mh-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 2. Communiqué (surbrillance) ---------- */
.mh-communique {
	margin-top: 32px;
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
	padding: 20px 24px;
	border-radius: var(--mh-radius);
	background: linear-gradient(110deg, var(--mh-orange-dark) 0%, var(--mh-orange) 100%);
	color: #fff;
	box-shadow: 0 8px 24px rgba(211, 84, 0, .28);
}
.mh-communique__icon {
	width: 56px; height: 56px; border-radius: 50%;
	display: grid; place-items: center;
	background: rgba(255, 255, 255, .18); font-size: 1.6rem;
}
.mh-communique__label {
	display: flex; align-items: center; gap: 8px;
	font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .95;
}
.mh-badge-pulse {
	width: 9px; height: 9px; border-radius: 50%; background: #fff;
	box-shadow: 0 0 0 0 rgba(255, 255, 255, .8);
	animation: mh-pulse 1.8s infinite;
}
@keyframes mh-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .8); }
	70%  { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.mh-home .mh-communique__title { color: #fff; font-size: 1.35rem; font-weight: 700; margin: 2px 0 4px; }
.mh-communique__text { font-size: 1rem; opacity: .95; max-width: 70ch; }
.mh-communique__action { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mh-communique__all {
	color: #fff !important; font-weight: 600; font-size: .9rem;
	text-decoration: underline !important; text-underline-offset: 3px; white-space: nowrap;
}
.mh-communique__all:hover { color: var(--mh-yellow) !important; }

/* ---------- 1. Hero : slide + mot du Président ---------- */
.mh-hero {
	display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: var(--mh-gap); align-items: stretch;
}

/* Le slide garde TOUJOURS la même hauteur : ratio fixe + recadrage */
.mh-slider { border-radius: var(--mh-radius); overflow: hidden; box-shadow: var(--mh-shadow); }
.mh-slider .flexslider,
.mh-slider .slider-wrap,
.mh-slider .slide { margin: 0; }
.mh-slide { position: relative; display: block; aspect-ratio: 16 / 9; background: #10281a; }
.mh-home .mh-slide__img {
	width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
}
.mh-slide__caption {
	position: absolute; inset: auto 0 0 0;
	padding: 56px 28px 24px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .78) 100%);
	color: #fff;
}
.mh-slide__date { font-size: .82rem; opacity: .85; }
.mh-home .mh-slide__title {
	color: #fff; font-size: 1.35rem; font-weight: 600; margin: 4px 0 14px; max-width: 46ch;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* puces et flèches du slider au-dessus du dégradé */
.mh-slider .flex-control-nav { z-index: 5; top: 16px; right: 16px; bottom: auto; }
.mh-slider .flex-direction-nav a { z-index: 5; }

/* Mot du Président (à droite du slide) */
.mh-hero__side { display: flex; padding-top: 52px; }
.mh-home .mh-president {
	flex: 1; margin: 0; padding: 28px 24px; text-align: center;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	background: linear-gradient(170deg, #fff 0%, var(--mh-green-soft) 100%);
}
.mh-home .mh-president__photo {
	width: 240px; height: 240px; object-fit: cover; object-position: top; border-radius: 50%;
	border: 5px solid #fff; box-shadow: 0 0 0 3px var(--mh-green);
}
.mh-president__quote {
	margin: 6px 0 10px; padding: 0; border: 0;
	font-family: 'PT Serif', serif; font-style: italic; font-size: 1.2rem; line-height: 1.45; color: var(--mh-ink);
}
.mh-president__name { font-weight: 700; color: var(--mh-green); font-size: .95rem; }

/* ---------- 3. Accès rapides (3 cartes) ---------- */
.mh-quick { margin-top: var(--mh-gap); }

.mh-tile {
	display: flex; flex-direction: column; gap: 4px; padding: 22px;
	color: var(--mh-ink) !important; transition: transform .15s ease, box-shadow .15s ease;
}
.mh-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 40, 24, .14); }
.mh-tile__icon {
	width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
	font-size: 1.4rem; margin-bottom: 10px;
}
.mh-tile__title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.1rem; }
.mh-tile__cta { margin-top: auto; padding-top: 12px; font-weight: 700; font-size: .92rem; }
.mh-tile--cantine { background: #fff8e6; border-color: #ffe3a3; }
.mh-tile--cantine .mh-tile__icon { background: var(--mh-yellow); color: var(--mh-ink); }
.mh-tile--cantine .mh-tile__cta { color: var(--mh-orange-dark); }
.mh-tile--prestations .mh-tile__icon { background: var(--mh-green-soft); color: var(--mh-green); }
.mh-tile--prestations .mh-tile__cta { color: var(--mh-green); }
.mh-tile--espace { background: var(--mh-green); border-color: var(--mh-green); color: #fff !important; }
.mh-tile--espace .mh-eyebrow { color: rgba(255, 255, 255, .8); }
.mh-tile--espace .mh-tile__icon { background: var(--mh-yellow); color: var(--mh-ink); }
.mh-tile--espace .mh-tile__cta { color: var(--mh-yellow); }

/* ---------- 4. Actualités (cartes) ---------- */
.mh-news { display: flex; flex-direction: column; }
.mh-news__media { display: block; aspect-ratio: 16 / 10; background: var(--mh-bg); overflow: hidden; }
.mh-home .mh-news__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mh-news:hover .mh-news__media img { transform: scale(1.04); }
.mh-news__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.mh-home .mh-news__title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; }
.mh-news__title a { color: var(--mh-ink) !important; }
.mh-news__title a:hover { color: var(--mh-green) !important; }
.mh-news__date { font-size: .85rem; color: var(--mh-muted); }
.mh-news__excerpt { font-size: .95rem; color: #3d4842; }
.mh-news__more { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: .92rem; color: var(--mh-green) !important; }

/* ---------- 5. Offres & annonces (affiches) ---------- */
.mh-poster { display: flex; flex-direction: column; color: var(--mh-ink) !important; transition: transform .15s ease; }
.mh-poster:hover { transform: translateY(-3px); }
.mh-poster__media { display: block; aspect-ratio: 4 / 3; background: var(--mh-bg); }
.mh-home .mh-poster__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mh-poster__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.mh-poster__title {
	font-weight: 700; font-size: .95rem; line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mh-poster__cta { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--mh-green); }

/* ---------- 6. Vie de la mutuelle ---------- */
.mh-feed { display: flex; flex-direction: column; }
.mh-home .mh-feed__head {
	padding: 12px 18px; font-size: .9rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff;
}
.mh-feed__head--green  { background: var(--mh-green); }
.mh-home .mh-feed__head--yellow { background: var(--mh-yellow); color: var(--mh-ink); }
.mh-feed__head--dark   { background: #3b4540; }
.mh-feed__list {
	list-style: none; margin: 0; padding: 6px 18px; max-height: 340px; overflow-y: auto;
}
.mh-feed__item {
	display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
	padding: 12px 0; border-bottom: 1px solid var(--mh-line);
}
.mh-feed__item:last-child { border-bottom: 0; }
.mh-home .mh-feed__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--mh-bg); }
.mh-feed__title { font-weight: 600; font-size: .92rem; line-height: 1.4; color: var(--mh-ink); }
.mh-feed__title p { margin: 0; }
.mh-feed__title a { color: var(--mh-ink) !important; }
.mh-feed__title a:hover { color: var(--mh-green) !important; }
.mh-feed__meta { font-size: .8rem; color: var(--mh-muted); margin-top: 2px; }
.mh-feed__empty { padding: 16px 0; color: var(--mh-muted); font-style: italic; }

/* ---------- 7. Médiathèque : défilement horizontal ---------- */
.mh-scroller-nav { display: flex; align-items: center; gap: 8px; }
.mh-scroller-btn {
	width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--mh-line); background: #fff;
	color: var(--mh-green); font-size: 1.1rem; display: grid; place-items: center; cursor: pointer;
	box-shadow: var(--mh-shadow);
}
.mh-scroller-btn:hover { background: var(--mh-green); color: #fff; }
.mh-scroller-nav .mh-link-more { margin-left: 8px; }
.mh-scroller {
	display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 14px) / 4);
	gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	padding-bottom: 12px; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
	scrollbar-color: var(--mh-green) var(--mh-line);
}
.mh-scroller:focus-visible { outline: 3px solid var(--mh-yellow); outline-offset: 4px; }
.mh-scroller__item {
	display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--mh-bg);
	scroll-snap-align: start;
}
.mh-home .mh-scroller__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.mh-scroller__item:hover img { transform: scale(1.05); }

/* ---------- Page /communiques ---------- */
.mh-page-head {
	display: flex; align-items: center; gap: 20px; padding: 24px 28px; border-radius: var(--mh-radius);
	background: linear-gradient(110deg, var(--mh-orange-dark) 0%, var(--mh-orange) 100%); color: #fff;
	box-shadow: 0 8px 24px rgba(211, 84, 0, .28);
}
.mh-home .mh-page-head__title { color: #fff; font-family: 'Poppins', sans-serif; font-size: 1.9rem; font-weight: 700; margin: 2px 0; }
.mh-page-head__sub { opacity: .92; }
.mh-breadcrumb { font-size: .85rem; opacity: .9; }
.mh-breadcrumb a { color: #fff !important; text-decoration: underline !important; text-underline-offset: 3px; }
.mh-section--tight { margin-top: 28px; }
.mh-news--communique { border-top: 4px solid var(--mh-orange); }
.mh-communique-tag {
	align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: #fff1de;
	color: var(--mh-orange-dark); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.mh-btn--ghost { background: #fff; border: 1px solid var(--mh-line); color: var(--mh-green) !important; }
.mh-btn--ghost.is-disabled { opacity: .45; pointer-events: none; }
.mh-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.mh-pager__info { color: var(--mh-muted); font-size: .9rem; }
.mh-empty { padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
	.mh-home { padding-top: 110px; --mh-gap: 18px; }
	.mh-hero { grid-template-columns: 1fr; }
	.mh-hero__side { padding-top: 0; }
	.mh-home .mh-president { flex-direction: row; text-align: left; }
	.mh-home .mh-president__photo { width: 170px; height: 170px; flex: none; }
	.mh-grid--3 { grid-template-columns: 1fr; }
	.mh-quick.mh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.mh-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mh-scroller { grid-auto-columns: calc((100% - 2 * 14px) / 2.6); }
}

@media (max-width: 575.98px) {
	.mh-communique { grid-template-columns: 1fr; text-align: left; gap: 12px; padding: 18px; }
	.mh-communique__icon { display: none; }
	.mh-communique__action .mh-btn { width: 100%; }
	.mh-page-head { padding: 18px; }
	.mh-page-head .mh-communique__icon { display: none; }
	.mh-home .mh-page-head__title { font-size: 1.5rem; }
	.mh-quick.mh-grid--3 { grid-template-columns: 1fr; }
	.mh-home .mh-president { flex-direction: column; text-align: center; padding: 20px 16px; gap: 12px; }
	.mh-home .mh-president__photo { width: 180px; height: 180px; flex: none; }
	.mh-president__quote { font-size: 1.05rem; }
	.mh-scroller { grid-auto-columns: 78%; }
	.mh-scroller-btn { display: none; }
	/* cartes compactes : icône à gauche, texte à droite */
	.mh-tile { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; align-items: center; }
	.mh-tile__icon { grid-row: 1 / span 3; margin: 0; }
	.mh-tile__cta { padding-top: 4px; }
	.mh-slide { aspect-ratio: 4 / 3; }
	.mh-slide__caption { padding: 40px 16px 16px; }
	.mh-home .mh-slide__title { font-size: 1.05rem; }
	.mh-section { margin-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
	.mh-badge-pulse { animation: none; }
	.mh-home * { transition: none !important; }
}
