/* ==========================================================================
   ANEM Centrale — Blocs Gutenberg, widgets et compléments
   ========================================================================== */

/* --- Alignements --- */
.prose .alignwide {
  width: min(var(--wrap), 100vw - (var(--gutter) * 2));
  margin-inline: calc(50% - min(var(--wrap), 100vw - (var(--gutter) * 2)) / 2);
  max-width: none;
}
.prose .alignfull {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  max-width: none;
}
.alignleft  { float: left;  margin: .4rem 1.8rem 1.2rem 0; }
.alignright { float: right; margin: .4rem 0 1.2rem 1.8rem; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }

/* --- Palette générée par WordPress --- */
.has-flame-color { color: var(--anem-flame) !important; }
.has-ember-color { color: var(--anem-ember) !important; }
.has-sahel-color { color: var(--anem-sahel) !important; }
.has-ink-color   { color: var(--anem-ink) !important; }
.has-flame-background-color { background-color: var(--anem-flame) !important; }
.has-ember-background-color { background-color: var(--anem-ember) !important; }
.has-sahel-background-color { background-color: var(--anem-sahel) !important; }
.has-ink-background-color   { background-color: var(--anem-ink) !important; }
.has-night-background-color { background-color: var(--anem-night) !important; }
.has-mist-background-color  { background-color: var(--anem-mist) !important; }
.has-sand-background-color  { background-color: var(--anem-sand) !important; }
.has-paper-background-color { background-color: #fff !important; }

.has-night-background-color,
.has-ink-background-color { color: #fff; padding: clamp(1.6rem, 4vw, 3rem); border-radius: var(--radius-lg); }

/* --- Boutons --- */
.wp-block-button__link {
  border-radius: var(--radius-pill);
  padding: .82rem 1.5rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.wp-block-button__link:hover { transform: translateY(-2px); box-shadow: var(--shadow-flame); color: #fff; }

.is-style-anem-ghost .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
}
.is-style-anem-ghost .wp-block-button__link:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* --- Groupes stylés --- */
.is-style-anem-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--surface);
}
.is-style-anem-notice {
  border-left: 3px solid var(--accent);
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  font-size: var(--fs-sm);
}

/* --- Images & médias --- */
.is-style-anem-rounded img { border-radius: var(--radius-lg); }
.wp-block-image figcaption,
.wp-block-embed figcaption {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-align: center;
  padding-top: .6rem;
}
.wp-block-cover { border-radius: var(--radius-lg); overflow: hidden; }

/* --- Citations --- */
.wp-block-quote { border-left: 3px solid var(--accent); padding-left: 1.5rem; }
.is-style-anem-pull {
  border: 0;
  border-block: 1px solid var(--line);
  padding: 2rem 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1.25;
  letter-spacing: var(--tracking-display);
}
.wp-block-quote cite, .wp-block-pullquote cite {
  display: block;
  margin-top: .9rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-style: normal;
  color: var(--text-faint);
}

/* --- Listes à cocher --- */
.is-style-anem-checklist { list-style: none; padding-left: 0; }
.is-style-anem-checklist li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .65em;
}
.is-style-anem-checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: .42em;
  width: 1.05rem; height: .55rem;
  border-left: 2.2px solid var(--anem-sahel);
  border-bottom: 2.2px solid var(--anem-sahel);
  transform: rotate(-45deg);
}

/* --- Tableaux --- */
.wp-block-table table { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.is-style-anem-clean table { border: 0; }
.is-style-anem-clean th { background: transparent; border-bottom: 2px solid var(--line-strong); }

/* --- Séparateur --- */
.wp-block-separator { border-top: 1px solid var(--line); border-bottom: 0; max-width: 100%; }
.wp-block-separator.is-style-dots { border: 0; }

/* --- Code --- */
.wp-block-code { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.15rem 1.3rem; }

/* --- Galerie --- */
.wp-block-gallery img { border-radius: var(--radius-sm); }

/* ==========================================================================
   Widgets
   ========================================================================== */

.sidebar { display: grid; gap: 1.5rem; align-content: start; }
.widget {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.45rem;
  background: var(--surface);
}
.widget-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: 1rem; letter-spacing: -.01em; }
.widget ul { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.widget li { margin-bottom: .55em; }
.widget a { text-decoration: none; color: var(--text-muted); }
.widget a:hover { color: var(--accent); }
.site-footer .widget { border: 0; background: transparent; padding: 0; }

.wp-calendar-table { font-size: var(--fs-xs); }
.wp-block-tag-cloud a {
  display: inline-block;
  padding: .3rem .7rem;
  margin: 0 .25rem .35rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs) !important;
  text-decoration: none;
}
.wp-block-tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Commentaires
   ========================================================================== */

.comments { margin-top: var(--space-8); }
.comment-list li { margin-bottom: 1.6rem; }
.comment-body {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  background: var(--surface);
}
.comment-meta { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; font-size: var(--fs-xs); color: var(--text-faint); }
.comment-author img { border-radius: 50%; }
.comment-author .fn { font-weight: 650; color: var(--text); font-style: normal; }
.comment-list .children { list-style: none; padding-left: clamp(1rem, 3vw, 2.4rem); }
.comment-reply-link { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); text-decoration: none; }
.comment-form { margin-top: 2rem; display: grid; gap: .2rem; }
.comment-form label { font-size: var(--fs-sm); font-weight: 600; display: block; margin-bottom: .35rem; }
.comment-form .submit { justify-self: start; }
.comment-form-cookies-consent { display: flex; gap: .6rem; align-items: center; font-size: var(--fs-xs); }
.comment-form-cookies-consent input { width: auto; }

/* ==========================================================================
   Bascule clair / sombre
   ========================================================================== */

html[data-theme="light"] .only-dark,
html[data-theme="dark"] .only-light { display: none; }

/* ==========================================================================
   Mode sombre : ajustements ponctuels
   ========================================================================== */

html[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--surface) 90%, transparent); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .organ-card,
html[data-theme="dark"] .region-card,
html[data-theme="dark"] .member,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .quicklink { background: var(--surface-alt); }
html[data-theme="dark"] .quicklinks { background: var(--line); }
html[data-theme="dark"] .btn--ghost { --btn-fg: var(--text); }
html[data-theme="dark"] .site-footer { background: #070B17; }
html[data-theme="dark"] .block--deep { background: #070B17; }
