/* Rendu contenu Gutenberg injecté (home + pages institutionnelles) */

.wp-gutenberg-content {
  width: 100%;
  max-width: min(960px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: inherit;
}

/*
 * Typographie du contenu Gutenberg, et d'elle seule.
 *
 * Une page Elementor arrive mise en forme : c'est son CSS qui décide des
 * polices, des interlignes et des écarts, et notre rôle s'arrête à la place
 * qu'elle occupe. Ces règles étaient posées sur tout contenu WordPress, puis
 * annulées plus bas pour Elementor par un `margin: unset` — qui ne rendait pas
 * la main, il mettait les marges à zéro. Les paragraphes se touchaient donc sur
 * le site publié alors qu'ils respirent dans l'éditeur. La portée est
 * maintenant dans le sélecteur : rien à annuler.
 */
.wp-gutenberg-content:not(.wp-elementor-content) {
  line-height: 1.6;
}

.wp-gutenberg-content:not(.wp-elementor-content) :where(h1, h2, h3, h4) {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}

.wp-gutenberg-content:not(.wp-elementor-content) :where(p, ul, ol, blockquote) {
  margin: 0 0 1rem;
}

.wp-gutenberg-content :where(img, video) {
  max-width: 100%;
  height: auto;
}

.wp-gutenberg-content:not(.wp-elementor-content) :where(.wp-block-image, figure) {
  margin: 1.25rem 0;
}

.wp-gutenberg-content :where(.alignwide) {
  max-width: min(1100px, 100%);
}

.wp-gutenberg-content :where(.alignfull) {
  width: 100%;
  max-width: none;
}

.wp-gutenberg-content :where(.wp-block-columns) {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.wp-gutenberg-content :where(.wp-block-column) {
  flex: 1 1 240px;
  min-width: 0;
}

.wp-gutenberg-content :where(.wp-block-cover) {
  border-radius: 8px;
  overflow: hidden;
  margin: 1.25rem 0;
}

.wp-gutenberg-content:not(.wp-elementor-content) :where(a) {
  color: var(--accent, #e30613);
  text-decoration: underline;
}

.wp-gutenberg-content:not(.wp-elementor-content) :where(a:hover) {
  text-decoration: none;
}

/*
 * Liens d'une page Elementor : la couleur du texte qui les entoure.
 *
 * C'est la règle du CMS (`color: currentColor`), et le lien n'y ressort donc
 * pas du paragraphe ; peint en rouge accentué comme sur le contenu Gutenberg,
 * il se voyait sur le site publié là où l'éditeur n'en montre pas. Le
 * sélecteur ne pèse que le poids d'un élément, comme celui du CMS : une
 * couleur choisie dans l'éditeur, elle, porte une classe et l'emporte.
 */
:where(.wp-gutenberg-content.wp-elementor-content) a {
  color: currentColor;
}

/* TablePress : lien admin « Edit » (ne doit pas apparaître sur le site public) */
.wp-gutenberg-content :where(.tablepress-edit) {
  display: none !important;
}

.landing-home-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Accueil + pages institutionnelles WordPress : scroll classique (sans snap plein écran) */
.landing--wp-home,
.landing--wp-institutional {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.landing--wp-home .landing-overlay,
.landing--wp-institutional .landing-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.landing--wp-home .landing-chrome--top,
.landing--wp-institutional .landing-chrome--top {
  flex-shrink: 0;
}

.landing--wp-home .landing-home-scroll,
.landing--wp-institutional .landing-home-scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.landing--wp-home .landing-home-body,
.landing--wp-home .wp-gutenberg-content,
.landing--wp-institutional .landing-home-body,
.landing--wp-institutional .wp-gutenberg-content {
  color: var(--text, #f1f5f9);
}

.landing--wp-institutional .landing-screens-scroll.landing-home-scroll {
  scroll-snap-type: none;
}

.landing-home-scroll .wp-gutenberg-content {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Elementor : pleine largeur, la typographie reste celle du CMS */
.wp-gutenberg-content.wp-elementor-content {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.landing-home-scroll .wp-gutenberg-content.wp-elementor-content {
  padding-top: 0;
  padding-bottom: 0;
}

.wp-gutenberg-content.wp-elementor-content .elementor {
  width: 100%;
}

.landing--wp-institutional .landing-screens-scroll > .landing-chrome--bottom {
  scroll-snap-align: unset;
  scroll-snap-stop: unset;
  min-height: unset;
}

.wp-content-unavailable {
  text-align: center;
  padding: 3rem 1rem;
}

.admin-wp-cms-panel {
  max-width: 640px;
  padding: 1rem 0 2rem;
}

.admin-wp-cms-panel__actions {
  margin: 1.25rem 0;
}

.admin-wp-cms-translate {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
}

.admin-wp-cms-translate__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-wp-cms-translate__row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.admin-wp-cms-translate__row select {
  max-width: 100%;
}

.admin-wp-cms-translate__actions {
  margin-top: 0.5rem;
}
