/* Fond campagne actif sur le site public (option Visuels). */
body.public.vc-site-bg {
  background-color: #0b1a33;
  background-image:
    linear-gradient(rgba(10, 20, 40, 0.42), rgba(10, 20, 40, 0.55)),
    var(--vc-site-bg);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

@media (max-width: 767.98px) {
  body.public.vc-site-bg {
    background-image:
      linear-gradient(rgba(10, 20, 40, 0.42), rgba(10, 20, 40, 0.55)),
      var(--vc-site-bg-mobile);
    background-attachment: scroll;
  }
}

/* Cartes / surfaces restent lisibles sur le fond photo. */
body.public.vc-site-bg .footer {
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(4px);
}

/*
 * Thème Light : le fond photo est sombre, --text est presque noir.
 * Titres, sous-titres et textes hors carte passent près du blanc.
 * Les cartes et les autres surfaces claires gardent le texte du thème.
 */
[data-bs-theme="light"] body.public.vc-site-bg main {
  color: #F8FAFC;
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  color: #F8FAFC;
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(.text-muted, .help, small, .small) {
  color: #E8EEF6 !important;
}
[data-bs-theme="light"] body.public.vc-site-bg main a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
  color: #F8FAFC;
}
[data-bs-theme="light"] body.public.vc-site-bg main .btn-ghost,
[data-bs-theme="light"] body.public.vc-site-bg main .btn-ghost:hover {
  color: #F8FAFC;
  background: transparent;
  border-color: rgba(248, 250, 252, .55);
}
[data-bs-theme="light"] body.public.vc-site-bg main .btn-ghost:hover {
  background: rgba(15, 23, 42, .35);
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(
  .card,
  .modal-content,
  .dropdown-menu,
  .list-group-item,
  .accordion-item,
  .alert,
  .toast,
  .offcanvas,
  .popover
) {
  color: var(--text);
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(
  .card,
  .modal-content,
  .dropdown-menu,
  .list-group-item,
  .accordion-item,
  .alert
) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  color: var(--text);
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(.card, .modal-content, .dropdown-menu, .alert) :is(.text-muted, .help, small, .small) {
  color: var(--text-muted) !important;
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(.card, .modal-content, .dropdown-menu, .alert) a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
  color: var(--primary);
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(.card, .dropdown-menu) .btn-ghost,
[data-bs-theme="light"] body.public.vc-site-bg main :is(.card, .dropdown-menu) .btn-ghost:hover {
  color: var(--text);
  border-color: var(--border);
  background: transparent;
}
[data-bs-theme="light"] body.public.vc-site-bg main :is(.card, .dropdown-menu) .btn-ghost:hover {
  background: var(--surface-2);
}

/* To-Do public : surface claire. Le fond photo ne doit pas y laisser le texte blanc. */
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app {
  color: var(--text);
}
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
  color: var(--text);
}
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app :is(.text-muted, .help, small, .small, .todo-empty, .todo-nav-section) {
  color: var(--text-muted) !important;
}
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app a.todo-nav-item:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
  color: var(--text);
}
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app a.todo-nav-item.is-active:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item),
[data-bs-theme="light"] body.public.vc-site-bg main .todo-app .todo-nav-row.is-active a.todo-nav-item:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) {
  color: var(--primary);
}

/*
 * Thème Light, site public sans photo : libellés, cellules et titres de page
 * restent sombres. Sur le fond photo (Dry-run et pages publiques), les titres
 * hors carte restent clairs : le visuel est assombri.
 */
[data-bs-theme="light"] body.public main :is(
  label,
  .form-label,
  .col-form-label,
  .form-check-label,
  .form-floating > label,
  legend,
  .input-group-text
),
[data-bs-theme="light"] body.public.vc-site-bg main :is(
  label,
  .form-label,
  .col-form-label,
  .form-check-label,
  .form-floating > label,
  legend,
  .input-group-text
) {
  color: #0F172A;
}
[data-bs-theme="light"] body.public main :is(.form-control, .form-select, textarea),
[data-bs-theme="light"] body.public.vc-site-bg main :is(.form-control, .form-select, textarea) {
  color: #0F172A;
}
[data-bs-theme="light"] body.public main :is(.form-control, .form-select, textarea)::placeholder,
[data-bs-theme="light"] body.public.vc-site-bg main :is(.form-control, .form-select, textarea)::placeholder {
  color: #5D6B81;
  opacity: 1;
}
[data-bs-theme="light"] body.public main form :is(.help, .form-text, .text-muted, small, .small),
[data-bs-theme="light"] body.public.vc-site-bg main form :is(.help, .form-text, .text-muted, small, .small) {
  color: #5D6B81 !important;
}
[data-bs-theme="light"] body.public main :is(table, .table),
[data-bs-theme="light"] body.public.vc-site-bg main :is(table, .table) {
  --bs-table-color: #0F172A;
  --bs-table-bg: #FFFFFF;
  color: #0F172A;
  background-color: #FFFFFF;
}
[data-bs-theme="light"] body.public main :is(table, .table) :is(th, td, caption),
[data-bs-theme="light"] body.public.vc-site-bg main :is(table, .table) :is(th, td, caption) {
  color: #0F172A;
}
[data-bs-theme="light"] body.public:not(.vc-site-bg) main :is(h1, .h1),
[data-bs-theme="light"] body.public:not(.vc-site-bg) main .page-head :is(h1, h2, h3, .h1, .h2, .h3),
[data-bs-theme="light"] body.public:not(.vc-site-bg) main .section > .container > h2 {
  color: #0F172A;
}
[data-bs-theme="light"] body.public.vc-site-bg main .page-head :is(h1, h2, h3, .h1, .h2, .h3) {
  color: #F8FAFC;
}

/* Bandeau sombre derrière le texte posé sur la photo (zones claires ou sombres). */
body.public.vc-site-bg .vc-photo-copy {
  background: rgba(8, 18, 40, 0.88);
  color: #fff;
  border-radius: .75rem;
  padding: .85rem 1.1rem;
}
body.public.vc-site-bg .vc-photo-copy--line {
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: .4rem .85rem;
}
body.public.vc-site-bg .vc-photo-copy :is(h1, h2, h3, h4, h5, h6, p, .text-muted, .help) {
  color: #fff !important;
}
body.public.vc-site-bg .vc-photo-copy .btn-ghost,
body.public.vc-site-bg .vc-photo-copy .btn-ghost:hover {
  color: #fff !important;
  border-color: rgba(255, 255, 255, .7);
  background: transparent;
}
body.public.vc-site-bg .vc-photo-copy .btn-ghost:hover {
  background: rgba(255, 255, 255, .14);
}

/* /events et /sessions, thème Light : le titre de chaque carte reste bleu marque.
   Le fond photo force les titres de main en #F8FAFC ; .session-card n'est pas une .card. */
[data-bs-theme="light"] .events-list .session-card h3,
[data-bs-theme="light"] .sessions-page .session-card h3,
[data-bs-theme="light"] body.public.vc-site-bg main .events-list .session-card h3,
[data-bs-theme="light"] body.public.vc-site-bg main .sessions-page .session-card h3 {
  color: #0F6CBD;
}
