/* ==========================================================================
   META EVENTS — thème clair
   L'inverse du thème sombre : fond gris du logo, textes indigo du logo, comme
   la partie « M= » du logo. Les photos sont moins voilées pour être mises en
   valeur. Le jaune reste l'accent décoratif (lueurs, pastilles, repères) ; les
   textes et icônes d'accent passent en indigo.
   Actif quand <html data-theme="clair"> (bouton de bascule, voir main.js).
   ========================================================================== */

[data-theme="clair"] {
  --c-vellum: #221c35;       /* texte principal, bouton principal */
  --c-blanc: #120e1f;        /* survol du bouton principal */
  --c-nuit: #e8e8e8;         /* fond de page : gris du logo */
  --c-voile: #f1f1f3;        /* navigation, menu mobile */
  --c-graphite: #f6f6f8;     /* surfaces surélevées */
  --c-fumee: #625d76;        /* texte secondaire */
  --c-cendre: #4b4662;       /* paragraphes */
  --c-charbon: #cfcdd8;      /* filets */
  --c-crepuscule: #bdb7d4;   /* bordures des cartes */
  --c-lueur-pale: #4b4170;   /* survols d'accent */
  --c-accent-texte: #221c35; /* textes et icônes d'accent */
  --halo: 0 0 0 1px #c9c4dc, 0 0 50px rgba(34, 28, 53, 0.06);
  --ombre-video: 0 24px 48px rgba(34, 28, 53, 0.16);
  color-scheme: light;
}

[data-theme="clair"] :focus-visible {
  outline-color: var(--c-indigo);
}

[data-theme="clair"] ::selection {
  background: var(--c-lueur);
  color: var(--c-indigo);
}

/* Surtitres : texte indigo sur un trait de surligneur jaune */
[data-theme="clair"] .surtitre {
  background: linear-gradient(transparent 58%, rgba(var(--c-lueur-rgb), 0.85) 58%, rgba(var(--c-lueur-rgb), 0.85) 92%, transparent 92%);
  padding-inline: 2px;
}

/* --------------------------------------------------------------------------
   Fonds de section
   -------------------------------------------------------------------------- */

[data-theme="clair"] .atmo-hero {
  background:
    radial-gradient(ellipse 70% 55% at 78% 105%, rgba(var(--c-lueur-rgb), 0.08), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 0%, rgba(255, 255, 255, 0.8), transparent 70%),
    linear-gradient(195deg, #f3f3f5 0%, #e8e8e8 55%, #e1e0e8 100%);
}

[data-theme="clair"] .atmo-a {
  background:
    radial-gradient(ellipse 70% 75% at 0% 0%, #f6f6f8 0%, rgba(232, 232, 232, 0) 72%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(189, 183, 212, 0.25), transparent 70%),
    var(--c-nuit);
}

[data-theme="clair"] .atmo-b {
  background:
    radial-gradient(ellipse 60% 65% at 100% 40%, rgba(189, 183, 212, 0.3), transparent 70%),
    radial-gradient(ellipse 50% 50% at 0% 100%, rgba(255, 255, 255, 0.6), transparent 70%),
    linear-gradient(180deg, var(--c-nuit), #e3e2e9);
}

[data-theme="clair"] .atmo-c {
  background:
    radial-gradient(ellipse 80% 70% at 50% 120%, rgba(var(--c-lueur-rgb), 0.1), transparent 70%),
    linear-gradient(180deg, #e6e5eb 0%, #dddce4 100%);
}

/* Photos de fond : plus présentes, sans voile sombre ; elles se fondent dans le gris.
   Les fonds révélés au survol (page Matériel) restent cachés jusqu'au survol. */
[data-theme="clair"] :where(.fond:not(.fond--survol)) .fond__img {
  opacity: min(1, calc(var(--fond-opacite, 0.3) * 1.3));
}

/* Les voiles clairs se posent en mode normal : en « multiply » (thème sombre), un
   gris clair n'éclaircirait pas la photo */
[data-theme="clair"] .fond::after {
  background: none;
  mix-blend-mode: normal;
}

/* Hauts de page : un voile clair sous les textes, à gauche */
[data-theme="clair"] .hero .fond::after,
[data-theme="clair"] .entete-page .fond::after,
[data-theme="clair"] .entete-page.entete-page--scene .fond::after {
  background:
    linear-gradient(90deg, rgba(232, 232, 232, 0.9) 0%, rgba(232, 232, 232, 0.66) 34%, rgba(232, 232, 232, 0.14) 58%, transparent 72%),
    linear-gradient(180deg, rgba(232, 232, 232, 0.35) 0%, transparent 20%);
}

[data-theme="clair"] .hero .fond--diaporama::after {
  background: linear-gradient(180deg, rgba(241, 241, 243, 0.4) 0%, transparent 16%, transparent 82%, rgba(232, 232, 232, 0.6) 100%);
}

/* Zone de dégradé sous les textes du héro d'accueil : gris clair au lieu de bleu sombre */
[data-theme="clair"] .hero__voile {
  background:
    radial-gradient(ellipse 56% 92% at calc(14% + var(--tx, 0) * 6%) calc(54% + var(--ty, 0) * 8%), rgba(240, 240, 242, 0.86) 0%, rgba(236, 236, 239, 0.62) 45%, rgba(236, 236, 239, 0.14) 75%, transparent 90%),
    linear-gradient(90deg, rgba(240, 240, 242, 0.8) 0%, rgba(236, 236, 239, 0.5) 30%, rgba(236, 236, 239, 0.08) 52%, transparent 62%);
}

[data-theme="clair"] .hero .chapo,
[data-theme="clair"] .entete-page .chapo,
[data-theme="clair"] .hero .surtitre,
[data-theme="clair"] .entete-page .surtitre {
  text-shadow: 0 1px 14px rgba(240, 240, 242, 0.9);
}

@media (max-width: 900px) {
  [data-theme="clair"] .hero .fond::after,
  [data-theme="clair"] .entete-page .fond::after,
  [data-theme="clair"] .entete-page.entete-page--scene .fond::after {
    background: linear-gradient(180deg, rgba(236, 236, 239, 0.55) 0%, rgba(236, 236, 239, 0.75) 55%, rgba(236, 236, 239, 0.35) 100%);
  }

  [data-theme="clair"] .hero__voile {
    background: linear-gradient(180deg, rgba(240, 240, 242, 0.55) 0%, rgba(236, 236, 239, 0.8) 50%, rgba(236, 236, 239, 0.45) 100%);
  }
}

/* En-tête lumineux et appels : pas de voile sur la photo, les textes reposent sur
   un halo gris clair au lieu du bleu nuit */
[data-theme="clair"] .entete-page.entete-page--lumineuse .fond::after {
  background: none;
}

[data-theme="clair"] .halo-texte::before,
[data-theme="clair"] .appel > .conteneur::before {
  background: rgba(238, 238, 241, 0.8);
}

[data-theme="clair"] .halo-texte .fil-ariane {
  color: var(--c-cendre);
  text-shadow: 0 1px 12px rgba(240, 240, 242, 0.9);
}

/* Le sommaire du Matériel garde son verre dépoli, sans halo en plus */
[data-theme="clair"] .sommaire.halo-texte::before {
  content: none;
}

/* --------------------------------------------------------------------------
   Navigation et barre d'appel mobile
   -------------------------------------------------------------------------- */

[data-theme="clair"] .nav {
  background: rgba(236, 236, 239, 0.86);
  border-bottom-color: rgba(34, 28, 53, 0.1);
}

[data-theme="clair"] .nav.nav--defile {
  background: rgba(241, 241, 243, 0.94);
}

[data-theme="clair"] .nav__logo img {
  box-shadow: 0 0 0 1px rgba(34, 28, 53, 0.12);
}

[data-theme="clair"] .nav__lien::after {
  background: var(--c-indigo);
}

[data-theme="clair"] .barre-appel {
  background: rgba(241, 241, 243, 0.92);
  box-shadow: var(--halo), 0 12px 32px rgba(34, 28, 53, 0.18);
}

/* --------------------------------------------------------------------------
   Cartes, encarts et étiquettes vitrées
   -------------------------------------------------------------------------- */

[data-theme="clair"] .annonce {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="clair"] .annonce:hover {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="clair"] .carte-flottante {
  background: rgba(246, 246, 248, 0.9);
}

[data-theme="clair"] .pilule {
  background: rgba(255, 255, 255, 0.55);
}

[data-theme="clair"] .pilule:hover {
  box-shadow: 0 10px 24px rgba(34, 28, 53, 0.12);
}

[data-theme="clair"] .cadre.vitrine {
  background: rgba(255, 255, 255, 0.16);
}

[data-theme="clair"] .vitrine::after {
  background: linear-gradient(180deg, rgba(12, 10, 20, 0) 60%, rgba(12, 10, 20, 0.12) 85%, rgba(12, 10, 20, 0.25) 100%);
}

[data-theme="clair"] .hero-chiffres {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(34, 28, 53, 0.12), 0 18px 40px rgba(34, 28, 53, 0.12);
  color: var(--c-cendre);
}

[data-theme="clair"] .hero-chiffres li + li {
  border-left-color: rgba(34, 28, 53, 0.12);
}

[data-theme="clair"] .repere__texte {
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 1px rgba(34, 28, 53, 0.12);
  color: var(--c-cendre);
}

[data-theme="clair"] .scene:hover .repere__texte {
  background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="clair"] .fiche,
[data-theme="clair"] .produit {
  background: linear-gradient(180deg, #f6f6f8, #eeeef2);
}

[data-theme="clair"] .fiche__specs dt,
[data-theme="clair"] .fiche__specs dd {
  border-bottom-color: var(--c-charbon);
}

[data-theme="clair"] .fiche:hover,
[data-theme="clair"] .condition:hover {
  box-shadow: inset 0 0 0 1px var(--c-crepuscule), 0 24px 50px rgba(34, 28, 53, 0.14);
}

[data-theme="clair"] .produit__visuel {
  background:
    radial-gradient(ellipse 55% 70% at 50% 45%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.3) 55%, transparent 75%),
    linear-gradient(180deg, #ecebf0, #e2e1e8);
}

[data-theme="clair"] .produit__visuel img {
  filter: drop-shadow(0 14px 16px rgba(34, 28, 53, 0.25));
}

[data-theme="clair"] .produit__badge {
  background: rgba(255, 255, 255, 0.82);
}

[data-theme="clair"] .tableau thead th {
  background: rgba(34, 28, 53, 0.06);
}

[data-theme="clair"] .condition {
  background: rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------
   Formulaire
   -------------------------------------------------------------------------- */

[data-theme="clair"] .formulaire {
  background: linear-gradient(180deg, #f6f6f8, #efeff3);
}

[data-theme="clair"] .champ input,
[data-theme="clair"] .champ select,
[data-theme="clair"] .champ textarea {
  background: #fff;
}

[data-theme="clair"] .champ select option {
  background: #fff;
}

[data-theme="clair"] .champ input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}

[data-theme="clair"] .message--erreur {
  background: rgba(200, 40, 40, 0.06);
  box-shadow: inset 0 0 0 1px rgba(200, 40, 40, 0.35);
  color: #8a1c1c;
}

/* Sommaire de l'en-tête Matériel : posé sur la photo, il prend un verre dépoli
   clair, à angles droits */
[data-theme="clair"] .sommaire {
  padding: 4px 24px;
  background: rgba(240, 240, 242, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 24px 48px rgba(34, 28, 53, 0.12);
}

[data-theme="clair"] .sommaire ol {
  border-top: 0;
}

[data-theme="clair"] .sommaire li:last-child a {
  border-bottom: 0;
}

/* --------------------------------------------------------------------------
   Bandeaux photo, appels « Une date, un lieu ? »
   -------------------------------------------------------------------------- */

[data-theme="clair"] .cine__media::after {
  background:
    linear-gradient(180deg, rgba(232, 232, 232, 0.25) 0%, rgba(232, 232, 232, 0) 28%, rgba(232, 232, 232, 0.12) 55%, rgba(232, 232, 232, 0.88) 100%),
    radial-gradient(ellipse 58% 68% at 16% 84%, rgba(236, 236, 239, 0.9), rgba(236, 236, 239, 0.55) 55%, transparent 82%);
}

[data-theme="clair"] .cine:has(.cine__carte) .cine__media::after {
  background: linear-gradient(180deg, rgba(232, 232, 232, 0.2) 0%, rgba(232, 232, 232, 0) 25%, rgba(232, 232, 232, 0) 70%, rgba(232, 232, 232, 0.5) 100%);
}

[data-theme="clair"] .cine--photo .cine__media::after {
  background: linear-gradient(180deg, rgba(232, 232, 232, 0.25) 0%, transparent 25%, transparent 75%, rgba(232, 232, 232, 0.35) 100%);
}

/* Le rectangle de texte s'inverse : indigo du logo, texte gris */
[data-theme="clair"] .cine__carte {
  background: var(--c-indigo);
  color: #e8e8e8;
  box-shadow: 0 40px 90px rgba(34, 28, 53, 0.35);
}

[data-theme="clair"] .cine__carte .cine__texte {
  color: #e8e8e8;
}

[data-theme="clair"] .cine__carte .surtitre {
  color: var(--c-lueur);
  background: none;
}

[data-theme="clair"] .appel .chapo {
  color: var(--c-vellum);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 20px rgba(240, 240, 242, 0.9);
}

[data-theme="clair"] .appel .surtitre,
[data-theme="clair"] .appel .titre-display,
[data-theme="clair"] .appel__tel {
  text-shadow: 0 2px 24px rgba(240, 240, 242, 0.8);
}

/* --------------------------------------------------------------------------
   Animations de la page Matériel
   -------------------------------------------------------------------------- */

[data-theme="clair"] .cable__fil {
  background: linear-gradient(90deg, rgba(34, 28, 53, 0.85), rgba(34, 28, 53, 0.4));
}

/* --------------------------------------------------------------------------
   Zones qui restent sombres, en contrepoint : le bandeau défilant et le pied
   de page reprennent l'indigo du logo (ses variables sombres y sont rétablies)
   -------------------------------------------------------------------------- */

[data-theme="clair"] .defilant,
[data-theme="clair"] .pied {
  --c-vellum: #e8e8e8;
  --c-blanc: #f6f5fa;
  --c-nuit: #0c0a14;
  --c-voile: #07060c;
  --c-fumee: #9a94b3;
  --c-cendre: #b9b4cc;
  --c-charbon: #3b3456;
  --c-crepuscule: #5a4f88;
  --c-lueur-pale: #fff09a;
  --c-accent-texte: var(--c-lueur);
  color: var(--c-vellum);
  background: var(--c-indigo);
}

[data-theme="clair"] .defilant {
  border-block-color: transparent;
}

[data-theme="clair"] .defilant__liste li {
  color: #8a82ab;
}

[data-theme="clair"] .pied .surtitre {
  background: none;
}

/* --------------------------------------------------------------------------
   Bouton de bascule du thème
   -------------------------------------------------------------------------- */

.bascule-theme {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--c-charbon);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-vellum);
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bascule-theme:hover {
  border-color: var(--c-accent-texte);
  transform: rotate(-20deg);
}

.bascule-theme .icone-lune,
[data-theme="clair"] .bascule-theme .icone-soleil {
  display: none;
}

[data-theme="clair"] .bascule-theme .icone-lune {
  display: block;
}

/* Dans le menu replié (petits écrans) : une ligne du menu */
.nav__theme {
  display: none;
}

.bascule-theme--menu {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: auto;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--c-charbon);
  border-radius: 0;
  font: inherit;
  font-size: 18px;
  text-align: left;
}

.bascule-theme--menu:hover {
  transform: none;
}

@media (max-width: 1100px) {
  .nav__actions .bascule-theme {
    display: none;
  }

  .nav__theme {
    display: block;
  }
}

/* Changement de thème : fondu enchaîné de toute la page (navigateurs compatibles) */
.bascule-en-cours::view-transition-old(root) {
  animation: 0.45s ease both vt-sortie;
}

.bascule-en-cours::view-transition-new(root) {
  animation: 0.45s ease both bascule-entree;
}

@keyframes bascule-entree {
  from {
    opacity: 0;
  }
}
