/* Amani : palette clair/sombre réglable depuis Apparence > Personnaliser. */
/* Le dégradé global est indépendant des accents et personnalisable par mode.
   Les mêmes valeurs initiales sont utilisées pour les deux modes. */
html:not(.amani-dark) .theme-body .body-bg {
  background-image: var(--amani-light-bg-image) !important;
  background-color: var(--amani-light-bg-1) !important;
}
html.amani-dark .theme-body .body-bg {
  background-image: var(--amani-dark-bg-image) !important;
  background-color: var(--amani-dark-bg-1) !important;
}
/* Cartes et pages. Les différents layouts du thème partagent la même palette. */
html:not(.amani-dark) .theme-body:not(.blog_layout-masonry) .content,
html:not(.amani-dark) .theme-body.blog_layout-masonry .content .grid-item,
html:not(.amani-dark) .theme-body.blog_layout-masonry .content section,
html:not(.amani-dark) .theme-body.blog_layout-masonry .content .archive-header,
html:not(.amani-dark) .theme-body.blog_layout-masonry .content .empty-cat-wrap,
html:not(.amani-dark) .theme-body.blog_layout-masonry .content .nav-links a.page-numbers:not(.next),
html:not(.amani-dark) body.single .theme-body .content,
html:not(.amani-dark) body.page .theme-body .content,
html:not(.amani-dark) body.error404 .theme-body .content,
html:not(.amani-dark) body.search-no-results .theme-body .content {
  background-color: var(--amani-light-surface) !important;
}
html.amani-dark .theme-body {
  --amani-night-surface: var(--amani-dark-surface);
  --amani-night-raised: var(--amani-dark-raised);
  --amani-night-text: var(--amani-dark-title);
  --amani-night-subtle: var(--amani-dark-text);
  --amani-night-link: var(--amani-dark-link);
}
/* Les couleurs des textes clairs sont appliquées à l'intérieur des articles :
   cela conserve le logo et les icônes du header identiques à la V3. */
html:not(.amani-dark) .theme-body .content .post-content,
html:not(.amani-dark) .theme-body .content .post-content p,
html:not(.amani-dark) .theme-body .content .post-content li,
html:not(.amani-dark) .theme-body .content .comment-body,
html:not(.amani-dark) .theme-body .content .post-meta,
html:not(.amani-dark) .theme-body .content .comment-notes,
html:not(.amani-dark) .theme-body .content .widget p {
  color: var(--amani-light-text) !important;
}
html:not(.amani-dark) .theme-body .content h1,
html:not(.amani-dark) .theme-body .content h2,
html:not(.amani-dark) .theme-body .content h3,
html:not(.amani-dark) .theme-body .content h4,
html:not(.amani-dark) .theme-body .content h5,
html:not(.amani-dark) .theme-body .content h6,
html:not(.amani-dark) .theme-body .content .post-title a {
  color: var(--amani-light-title) !important;
}
html:not(.amani-dark) .theme-body .content .post-content a:not(.wp-block-button__link):not(.button),
html:not(.amani-dark) .theme-body .content .comment-body a:not(.wp-block-button__link):not(.button) {
  color: var(--amani-light-link) !important;
}
/*
 * V11 — Chaque mode possède maintenant DEUX couleurs réservées aux titres.
 * Les en-têtes principaux, leurs spans Gutenberg / Amani, et les titres des
 * listes d'articles utilisent ce dégradé indépendamment du fond et des boutons.
 * Plus de dépendance à l'option « couleur unie » du dégradé de l'arrière-plan.
 */
html:not(.amani-dark) .theme-body .fourofour,
html:not(.amani-dark) .theme-body .empty-cat h2,
html:not(.amani-dark) .theme-body .archive-header h1,
html:not(.amani-dark) .theme-body .title-search-no-results,
html:not(.amani-dark) .theme-body .content h1.post-title,
html:not(.amani-dark) .theme-body .content .blog-feed .post-title > a,
html:not(.amani-dark) .theme-body .featured-top .post-title > a,
html:not(.amani-dark) .theme-body .featured-bottom .post-title > a {
  background-image: var(--amani-light-title-gradient-image) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
html.amani-dark .theme-body .fourofour,
html.amani-dark .theme-body .empty-cat h2,
html.amani-dark .theme-body .archive-header h1,
html.amani-dark .theme-body .title-search-no-results,
html.amani-dark .theme-body .content h1.post-title,
html.amani-dark .theme-body .content .blog-feed .post-title > a,
html.amani-dark .theme-body .featured-top .post-title > a,
html.amani-dark .theme-body .featured-bottom .post-title > a {
  background-image: var(--amani-dark-title-gradient-image) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* V12 : un seul dégradé diagonal, calculé sur la totalité du titre,
   y compris quand le texte se répartit sur plusieurs lignes. */
html:not(.amani-dark) .theme-body .content h1.post-title,
html.amani-dark .theme-body .content h1.post-title {
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
html:not(.amani-dark) .theme-body .content h1.post-title > span,
html.amani-dark .theme-body .content h1.post-title > span {
  background: none !important;
  background-image: none !important;
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* Une ancre de titre ne doit pas hériter du remplissage cyan des liens. */
html:not(.amani-dark) .theme-body .content .post-title a,
html.amani-dark .theme-body .content .post-title a {
  text-decoration-color: currentColor;
}

/*
 * V10 - Les pastilles ajoutées sous la biographie sont des post-cats-inside,
 * et non des post-category. Elles doivent rester blanches même si le système
 * général de liens force une couleur d'accent avec !important.
 */
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats-inside a,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats-inside a:visited,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats-inside a:hover,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats-inside a:focus-visible,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats a,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats a:visited,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats a:hover,
html.amani-dark body .theme-body:is(.c-default, .c-inversed) .content.content-singular article .post-cats a:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* V13 — Masonry : fond unifie des widgets dans les deux modes.
 * Amani 2019 anime toutes les proprietes de .grid-item, y compris background-color,
 * alors que le <section> interne bascule instantanement. Deux couches de fond
 * se superposaient pendant le changement de mode, laissant une bande claire.
 * Le conteneur possede seul le fond ; l'animation d'entree (opacite) est conservee.
 */
html .theme-body.blog_layout-masonry .content .blog-feed .grid-item-widget {
  transition-property: opacity, transform !important;
}
html:not(.amani-dark) .theme-body.blog_layout-masonry .content .blog-feed .grid-item-widget > section,
html.amani-dark .theme-body.blog_layout-masonry .content .blog-feed .grid-item-widget > section {
  background-color: transparent !important;
}

/* V13 — Sous-lignement et bordure des liens textuels en theme sombre.
 * Amani conserve sur certaines ancres la bordure sombre du mode clair.
 * Le survol doit suivre « Couleurs – theme sombre > Liens » dans WordPress.
 * Ne pas toucher aux liens des icones sociales, aux boutons ni aux categories.
 */
html.amani-dark .theme-body .content .post-content a:not(.wp-block-button__link):not(.button):not(.wp-block-social-link-anchor):hover,
html.amani-dark .theme-body .content .comment-body a:not(.wp-block-button__link):not(.button):not(.wp-block-social-link-anchor):hover,
html.amani-dark .theme-body .content .post-meta a:hover,
html.amani-dark .theme-body .content .widget a:not(.wp-block-social-link-anchor):not(.wp-block-button__link):not(.button):hover,
html.amani-dark .theme-body footer.footer-main .copyright a:hover {
  color: var(--amani-dark-link, #c5b4ff) !important;
  border-bottom-color: var(--amani-dark-link, #c5b4ff) !important;
  text-decoration-color: var(--amani-dark-link, #c5b4ff) !important;
}
/* Liens soulignes meme en dehors de l'etat :hover : garder une seule teinte. */
html.amani-dark .theme-body .content .post-content a:not(.wp-block-button__link):not(.button):not(.wp-block-social-link-anchor),
html.amani-dark .theme-body .content .comment-body a:not(.wp-block-button__link):not(.button):not(.wp-block-social-link-anchor) {
  text-decoration-color: var(--amani-dark-link, #c5b4ff) !important;
}
/* Certains widgets Amani soulignent le titre via un <span> enfant du lien. */
html.amani-dark .theme-body .content .widget.widget_post_views_counter_list_widget .post-title span:hover,
html.amani-dark .theme-body .content .widget.bekento_thumbnail_recent_posts .post-title span:hover {
  border-bottom-color: var(--amani-dark-link, #c5b4ff) !important;
}
