/* ==========================================================================
   MAYA FACEBOOK – styles du module
   Version : v0.2.9.1-beta-facebook-build-211105 · Mayamedia
   --------------------------------------------------------------------------
   Habillage autonome (ambiance sombre / verre, comme Maya Avis).
   Les couleurs reprennent les variables --cda-* du template quand elles
   existent (ex. custom.css section 56 sur charcuterie-d-antan.fr), sinon les
   valeurs de repli ci-dessous. Pour adapter à un site : définir --cda-rose,
   --cda-rose-rgb, --cda-font-titre… dans le CSS du template.
   Les règles de titre / bouton sont en :where() (priorité nulle) : le style
   du template passe devant s'il en propose un.

   Sommaire
     1. Variables
     2. Section, titres, bouton (repli faible priorité)
     3. Grille : texte + flux
     4. Colonne texte (liste à puces)
     5. En-tête de la page Facebook
     6. Vignettes de publications
     7. Badge « À la une »
     8. Message vide, diagnostic
     9. Tablette / mobile
   ========================================================================== */

/* 1. Variables ----------------------------------------------------------- */
.cda-fb {
	--mfb-surface: var(--cda-surface, rgba(22, 20, 19, .86));
	--mfb-surface2: var(--cda-surface2, rgba(255, 255, 255, .04));
	--mfb-ligne: var(--cda-line, rgba(255, 255, 255, .10));
	--mfb-ink: var(--cda-ink, #F2EAE2);
	--mfb-ink2: var(--cda-ink2, #D2C4B9);
	--mfb-muted: var(--cda-muted, #BCAEA3);
	--mfb-accent: var(--cda-rose, #F7A8C2);
	--mfb-rgb: var(--cda-rose-rgb, 238, 106, 149);
	--mfb-rayon: var(--cda-radius-sm, 16px);
	position: relative;
	color: var(--mfb-ink);
}

/* 2. Section, titres, bouton (repli) ------------------------------------ */
:where(.cda-fb.cda-section, .mavis-section.cda-section) { box-sizing: border-box; width: 100%; max-width: var(--cda-largeur, 1200px); margin-inline: auto; padding: 8px 20px; }
:where(.cda-fb, .mavis-section) :where(.cda-eyebrow) {
	display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--cda-rose, #F7A8C2);
}
:where(.cda-fb, .mavis-section) :where(h2) {
	margin: 0 0 14px; font-family: var(--cda-font-titre, inherit); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15;
	color: var(--cda-ink, #F2EAE2);
}
:where(.cda-fb, .mavis-section) :where(.cda-accent) { color: var(--cda-rose, #F7A8C2); }
:where(.mavis-section) :where(.cda-section-tete) { margin-bottom: 18px; text-align: var(--cda-titre-align, left); }
:where(.cda-fb) :where(.cda-btn) {
	display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; white-space: nowrap;
	font-weight: 600; text-decoration: none; color: #fff;
	background: linear-gradient(135deg, var(--nt-btn-a, var(--mfb-accent)), var(--nt-btn-b, rgba(var(--mfb-rgb), .75)));
	box-shadow: 0 8px 22px rgba(var(--mfb-rgb), .28); transition: transform .2s, box-shadow .2s;
}
:where(.cda-fb) :where(.cda-btn):hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(var(--mfb-rgb), .38); color: #fff; }
.cda-fb .cda-btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
/* le texte du bouton reste blanc même si le template colore les liens (a:link, a:visited) */
.cda-fb a.cda-btn, .cda-fb a.cda-btn:link, .cda-fb a.cda-btn:visited, .cda-fb a.cda-btn span { color: #fff; }

/* 3. Grille -------------------------------------------------------------- */
.cda-fb-grille { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px 40px; align-items: center; }
.cda-fb--seul .cda-fb-grille { grid-template-columns: minmax(0, 1fr); }
.cda-fb-flux { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* 4. Colonne texte ------------------------------------------------------- */
.cda-fb-texte p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.65; color: var(--mfb-ink2); }
.cda-fb-liste { margin: 0 0 20px; padding: 0; list-style: none; display: grid; gap: 8px; }
.cda-fb .cda-fb-liste li { position: relative; margin: 0; padding: 0 0 0 22px; border: 0; background: none; font-size: 15px; color: var(--mfb-ink2); }
.cda-fb .cda-fb-liste li::after { content: none; }
.cda-fb-liste li::before {
	content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%;
	background: var(--mfb-accent); box-shadow: 0 0 0 4px rgba(var(--mfb-rgb), .18);
}

/* 5. En-tête de la page Facebook ---------------------------------------- */
.cda-fb-entete {
	position: relative; display: block; overflow: hidden; text-decoration: none; color: var(--mfb-ink);
	border: 1px solid var(--mfb-ligne); border-radius: var(--mfb-rayon); background: var(--mfb-surface);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .25s;
}
.cda-fb-entete:hover { border-color: rgba(var(--mfb-rgb), .45); color: var(--mfb-ink); }
.cda-fb-couverture { display: block; height: 84px; background: center / cover no-repeat; opacity: .55; }
.cda-fb-identite { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cda-fb-couverture + .cda-fb-identite { margin-top: -30px; position: relative; }
.cda-fb-logo { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--mfb-surface); background: var(--mfb-surface); }
.cda-fb-nom { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cda-fb-nom strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mfb-ink); }
.cda-fb-nom small { font-size: 12px; color: var(--mfb-muted); }
.cda-fb-pastille { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #1877F2; color: #fff; }
.cda-fb-pastille svg { width: 18px; height: 18px; }

/* 6. Vignettes ----------------------------------------------------------- */
.cda-fb-vignettes { display: grid; grid-template-columns: repeat(var(--cda-fb-n, 3), minmax(0, 1fr)); gap: 14px; }
.cda-fb-vignette {
	position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none; color: var(--mfb-ink);
	border: 1px solid var(--mfb-ligne); border-radius: var(--mfb-rayon); background: var(--mfb-surface);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .25s, transform .25s;
}
.cda-fb-vignette:hover { border-color: rgba(var(--mfb-rgb), .45); transform: translateY(-2px); color: var(--mfb-ink); }
.cda-fb-photo { display: block; overflow: hidden; background: var(--mfb-surface2); }
.cda-fb-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.cda-fb-vignette:hover .cda-fb-photo img { transform: scale(1.04); }
.cda-fb-photo--carre { aspect-ratio: 1 / 1; }
.cda-fb-photo--portrait { aspect-ratio: 4 / 5; }
.cda-fb-photo--paysage { aspect-ratio: 16 / 10; }
.cda-fb-corps { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.cda-fb-date { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mfb-accent); }
.cda-fb-texte-post { font-size: 13.5px; line-height: 1.5; color: var(--mfb-ink2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.cda-fb-compteurs { display: flex; gap: 14px; margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--mfb-muted); }
.cda-fb-compteurs span { display: inline-flex; align-items: center; gap: 4px; }
.cda-fb-compteurs svg { width: 14px; height: 14px; }

/* 6b. Tuile unique (une seule publication) --------------------------- */
.cda-fb-vignettes--solo { grid-template-columns: minmax(0, 1fr); }
.cda-fb-vignettes--solo .cda-fb-vignette { flex-direction: row; align-items: stretch; }
.cda-fb-vignettes--solo .cda-fb-photo { flex: 0 0 44%; max-width: 44%; aspect-ratio: auto; min-height: 220px; }
.cda-fb-vignettes--solo .cda-fb-corps { justify-content: center; padding: 18px 20px; }
.cda-fb-vignettes--solo .cda-fb-texte-post { -webkit-line-clamp: 7; font-size: 14.5px; }

/* 7. Badge « À la une » -------------------------------------------------- */
.cda-fb-une {
	position: absolute; z-index: 2; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
	padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
	color: #fff; background: var(--mfb-accent); box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.cda-fb-une svg { width: 12px; height: 12px; }
.cda-fb-vignette--une { outline: 2px solid rgba(var(--mfb-rgb), .55); outline-offset: -2px; }

/* 8. Message vide, diagnostic ------------------------------------------- */
.cda-fb-vide { margin: 0; padding: 22px; text-align: center; border: 1px dashed var(--mfb-ligne); border-radius: var(--mfb-rayon); background: var(--mfb-surface); }
.cda-fb-vide a { color: var(--mfb-ink2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--mfb-rgb), .5); }
.cda-fb-vide a:hover { color: var(--mfb-accent); }
.cda-fb-diagnostic { margin-top: 12px; padding: 10px; font-size: 12px; white-space: pre-wrap; border-radius: 8px; background: var(--mfb-surface2); color: var(--mfb-muted); }

/* 9. Tablette / mobile --------------------------------------------------- */
@media (max-width: 991px) {
	.cda-fb-grille { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575px) {
	.cda-fb-vignettes { grid-template-columns: minmax(0, 1fr); }
	.cda-fb-vignettes--solo .cda-fb-vignette { flex-direction: column; }
	.cda-fb-vignettes--solo .cda-fb-photo { flex: none; max-width: none; width: 100%; min-height: 0; aspect-ratio: 16 / 10; }
	.cda-fb-vignettes--solo .cda-fb-corps { padding: 14px; }
	.cda-fb .cda-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.cda-fb-vignette, .cda-fb-photo img, .cda-fb .cda-btn { transition: none; }
}
