
/* tinymce-content.css — shared styling for editor and frontend */
.tinymce-body { line-height: 1.75; font-size: 1rem; color: #111827; }
.tinymce-body h1, .tinymce-body h2, .tinymce-body h3, .tinymce-body h4 { line-height: 1.25; margin: 1.5em 0 .6em; font-weight: 700; }
.tinymce-body h1 { font-size: 2rem; }
.tinymce-body h2 { font-size: 1.5rem; }
.tinymce-body h3 { font-size: 1.25rem; }
.tinymce-body h4 { font-size: 1.125rem; }
.tinymce-body p { margin: 1em 0; }
.tinymce-body a { text-decoration: underline; }
.tinymce-body ul, .tinymce-body ol { margin: 1em 0 1em 1.25em; padding: 0; }
.tinymce-body li { margin: .25em 0; }
.tinymce-body blockquote { margin: 1.2em 0; padding: .6em 1em; border-left: 4px solid #e5e7eb; background: #f9fafb; }
.tinymce-body img { max-width: 100%; height: auto; }
.tinymce-body figure { margin: 1.2em 0; }
.tinymce-body figcaption { font-size: .875rem; color: #6b7280; text-align: center; }
.tinymce-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.tinymce-body th, .tinymce-body td { border: 1px solid #e5e7eb; padding: .5em .75em; }
.tinymce-body code, .tinymce-body pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: .95em; }
.tinymce-body pre { padding: .75em 1em; overflow: auto; background: #f3f4f6; border-radius: .375rem; }
.tinymce-body hr { border: 0; border-top: 1px solid #e5e7eb; margin: 2rem 0; }
.tinymce-body .align-left { float: left; margin: .25em 1em .5em 0; }
.tinymce-body .align-right { float: right; margin: .25em 0 .5em 1em; }
.tinymce-body .align-center { display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 640px) {
  .tinymce-body { font-size: 1.0625rem; }
  .tinymce-body .align-left, .tinymce-body .align-right { float: none; margin: .5em auto; }
}
/* Ensure editor selection highlights look normal inside iframe too */
.mce-content-body.tinymce-body { padding: 1rem; }


/* === Embeds (cartes & médias) === */
.tinymce-body .embed-article{ display:block; border:1px solid #e5e7eb; border-radius:.5rem; padding:.75rem; margin:1.25rem 0; background:#fafafa; }
.tinymce-body .embed-article .embed-label{ font-size:.75rem; letter-spacing:.02em; color:#6b7280; text-transform:uppercase; margin-bottom:.25rem; }
.tinymce-body .embed-article .embed-card{ display:grid; grid-template-columns: 120px 1fr; gap:.75rem; text-decoration:none; color:inherit; }
.tinymce-body .embed-article .thumb img{ width:100%; height:100%; object-fit:cover; border-radius:.375rem; }
.tinymce-body .embed-article .meta .t{ font-size:1rem; font-weight:700; margin:.1rem 0 .25rem; }
.tinymce-body .embed-article .meta .x{ font-size:.875rem; color:#6b7280; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
/* Variantes */
.tinymce-body .embed-article.card-sm .embed-card{ grid-template-columns: 96px 1fr; }
.tinymce-body .embed-article.card-lg .embed-card{ grid-template-columns: 200px 1fr; }
.tinymce-body .embed-article.card-wide .embed-card{ grid-template-columns: 1fr; }
.tinymce-body .embed-article.card-wide .thumb{ order:2; }
.tinymce-body .embed-article.card-wide .meta{ order:1; }
.tinymce-body .embed-article.card-square .thumb img{ aspect-ratio:1/1; }

/* Vidéo responsive pour iframe TinyMCE et auto-embed */
.tinymce-body .embed-video, .tinymce-body iframe[src*="youtube"], .tinymce-body iframe[src*="vimeo"]{ width:100%; aspect-ratio:16/9; display:block; }
.tinymce-body .embed-video iframe{ width:100%; height:100%; }


/* Facebook iframe fallback */
.tinymce-body .embed-fb iframe{ width:100%; min-height:320px; border:0; overflow:hidden; display:block; }


/* Vidéos (YouTube/Vimeo) */
.tinymce-body .embed-video{ width:100%; aspect-ratio:16/9; display:block; margin: 1rem 0; }
.tinymce-body .embed-video iframe{ width:100%; height:100%; }

/* Facebook via SDK : wrapper auto-géré par FB, on garantit la largeur */
.tinymce-body .fb-post,
.tinymce-body .fb_iframe_widget { max-width: 650px; margin: 1rem auto; }
.tinymce-body .fb_iframe_widget > span { display:block !important; width:100% !important; }
.tinymce-body .fb_iframe_widget iframe { width:100% !important; }

/* Sur petit écran, on limite un peu */
@media (max-width: 640px) {
  .tinymce-body .fb-post,
  .tinymce-body .fb_iframe_widget { max-width: 100%; }
}




/* Social embeds: centrés, largeur réduite */
.tinymce-body .social-embed{ display:flex; justify-content:center; margin:1rem auto; }
.tinymce-body .social-embed > *{ width:100%; max-width:325px; } /* ÷2 sur desktop (650 -> 325) */

/* Instagram specific: assure le centrage */
.tinymce-body .social-embed.instagram .instagram-media{ margin: 0 auto !important; }

/* Facebook via SDK */
.tinymce-body .fb-post,
.tinymce-body .fb_iframe_widget { max-width: 325px; margin: 1rem auto; }
.tinymce-body .fb_iframe_widget > span { display:block !important; width:100% !important; }
.tinymce-body .fb_iframe_widget iframe { width:100% !important; }

/* Vidéo (YouTube/Vimeo) */
.tinymce-body .embed-video{ width:100%; aspect-ratio:16/9; display:block; }
.tinymce-body .embed-video iframe{ width:100%; height:100%; }

/* Mobile: ÷1.5 (≈433px) */
@media (max-width: 640px){
  .tinymce-body .social-embed > *{ max-width:433px; }
  .tinymce-body .fb-post,
  .tinymce-body .fb_iframe_widget { max-width: 433px; }
}
