/* =====================================================================
   Chants de France — Dark Mode
   Override visuel piloté par html[data-theme="dark"].
   Les variables --cdm-* + --e-global-color-* sont injectées en inline
   par enqueue.php (lecture des options admin).
   ===================================================================== */

/* ---------------------------------------------------------------------
   Niveau body : background + couleur de texte fallback
   --------------------------------------------------------------------- */
html[data-theme="dark"] body[class*="elementor-kit-"] {
    background-color: var(--e-global-color-secondary) !important;
    color: var(--e-global-color-text);
}

/* Liens hérités du thème */
html[data-theme="dark"] body a {
    color: var(--e-global-color-primary);
}

/* ---------------------------------------------------------------------
   Conteneurs / cartes utilisant des fonds blancs en dur
   --------------------------------------------------------------------- */
html[data-theme="dark"] .ncdf-block,
html[data-theme="dark"] .ncdf-review,
html[data-theme="dark"] .cdf-search-link:hover,
html[data-theme="dark"] .cdf-header-search-inner {
    background: var(--cdm-surface);
    color: var(--cdm-text);
    border-color: var(--cdm-border);
}

/* ---------------------------------------------------------------------
   Plugin recherche-cdf — couleurs en dur dans search.css
   --------------------------------------------------------------------- */
html[data-theme="dark"] .cdf-search {
    --cdf-border: var(--cdm-border);
    --cdf-bg:     var(--cdm-surface);
    --cdf-accent: var(--cdm-primary);
}
html[data-theme="dark"] .cdf-search-q,
html[data-theme="dark"] .cdf-header-search-q {
    background: var(--cdm-surface);
    color: var(--cdm-text);
    border-color: var(--cdm-border);
}
html[data-theme="dark"] .cdf-search-summary,
html[data-theme="dark"] .cdf-search-empty,
html[data-theme="dark"] .cdf-search-pageinfo,
html[data-theme="dark"] .cdf-search-excerpt,
html[data-theme="dark"] .cdf-suggest-type,
html[data-theme="dark"] .cdf-header-empty {
    color: var(--cdm-muted);
}
html[data-theme="dark"] .cdf-search-link:hover {
    background: var(--cdm-surface);
}
html[data-theme="dark"] .cdf-search-pagination a,
html[data-theme="dark"] .cdf-search-pagination button {
    background: var(--cdm-surface);
    color: var(--cdm-text);
    border-color: var(--cdm-border);
}
html[data-theme="dark"] .cdf-search-pagination a:hover,
html[data-theme="dark"] .cdf-search-pagination button:hover {
    background: var(--cdm-bg);
}
html[data-theme="dark"] .cdf-search-type-badge {
    background: var(--cdm-bg);
    color: var(--cdm-muted);
}
html[data-theme="dark"] .cdf-search-item--chant .cdf-search-type-badge {
    background: var(--cdm-primary-15);
    color: var(--cdm-primary);
}
html[data-theme="dark"] .cdf-search-item--carnet .cdf-search-type-badge {
    background: var(--cdm-accent-15);
    color: var(--cdm-accent);
}
html[data-theme="dark"] .cdf-header-search {
    background: rgba(0, 0, 0, .82);
}
html[data-theme="dark"] .cdf-header-suggestions li {
    border-top-color: var(--cdm-border);
}
html[data-theme="dark"] .cdf-header-suggestions li a:hover {
    background: var(--cdm-bg);
}
html[data-theme="dark"] .cdf-header-search-close {
    color: var(--cdm-muted);
}

/* ---------------------------------------------------------------------
   Plugin notation-cdf — couleurs en dur dans rating.css
   --------------------------------------------------------------------- */
html[data-theme="dark"] .ncdf-label,
html[data-theme="dark"] .ncdf-meta,
html[data-theme="dark"] .ncdf-feedback,
html[data-theme="dark"] .ncdf-hint,
html[data-theme="dark"] .ncdf-review-author {
    color: var(--cdm-muted);
}
html[data-theme="dark"] .ncdf-vote,
html[data-theme="dark"] .ncdf-reviews {
    border-top-color: var(--cdm-border);
}
html[data-theme="dark"] .ncdf-stars-static .ncdf-stars-empty,
html[data-theme="dark"] .ncdf-star {
    color: var(--cdm-border);
}
html[data-theme="dark"] .ncdf-review-form {
    background: var(--cdm-bg);
    color: var(--cdm-text);
}
html[data-theme="dark"] .ncdf-review-form label {
    color: var(--cdm-text);
}
html[data-theme="dark"] .ncdf-review-form input,
html[data-theme="dark"] .ncdf-review-form textarea {
    background: var(--cdm-surface);
    color: var(--cdm-text);
    border-color: var(--cdm-border);
}
html[data-theme="dark"] .ncdf-review {
    background: var(--cdm-surface);
    border-color: var(--cdm-border);
    color: var(--cdm-text);
}
html[data-theme="dark"] .ncdf-login-prompt {
    background: var(--cdm-bg);
    color: var(--cdm-text);
}

/* ---------------------------------------------------------------------
   Images, iframes, vidéos : éviter le blanc éclatant
   --------------------------------------------------------------------- */
html[data-theme="dark"] img,
html[data-theme="dark"] video,
html[data-theme="dark"] iframe {
    background-color: transparent;
}

/* ---------------------------------------------------------------------
   Form inputs natifs (Elementor / WP) → s'aligner sur la palette
   --------------------------------------------------------------------- */
html[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background-color: var(--cdm-surface);
    color: var(--cdm-text);
    border-color: var(--cdm-border);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--cdm-muted);
}

/* ---------------------------------------------------------------------
   Transitions douces (uniquement sur background/color, jamais sur layout)
   --------------------------------------------------------------------- */
html[data-theme="dark"] body[class*="elementor-kit-"],
html[data-theme="dark"] .ncdf-block,
html[data-theme="dark"] .ncdf-review,
html[data-theme="dark"] .cdf-search-q,
html[data-theme="dark"] .cdf-header-search-inner {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
