/* Balises : correctif de design pour Avada. Chargé par mu-plugins/balises-design.php (aperçu ou public). */

/* ---------------------------------------------------------------
   1. Jetons. Les variables --xxx d'Avada sont celles que les Options
   globales génèrent : on les redéfinit ici, sans toucher aux options.
   Retour arrière : retirer ce fichier.
   --------------------------------------------------------------- */
html:root {
  --bal-encre: #1f2733;
  --bal-texte: #3e4958;
  --bal-texte-2: #55616c;
  --bal-orange: #f09a3e;      /* décor uniquement : filets, puces, barres */
  --bal-lien: #9c4f00;        /* orange foncé : tout texte coloré */
  --bal-bleu: #3f6e9a;        /* icônes et information, jamais les liens */
  --bal-nuit: #2c2f39;
  --bal-doux: #f7f5f2;
  --bal-filet: #e7e4e2;
  --bal-focus: #1f2733;

  /* Corps */
  --body_typography-font-size: 17px;
  --body_typography-line-height: 1.65;
  --body_typography-color: var(--bal-texte);
  --link_color: var(--bal-lien);
  --link_color-8a: rgba(156, 79, 0, .8);

  /* Échelle : 42 / 30 / 22 / 18 */
  --h1_typography-font-size: 42px;
  --h1_typography-line-height: 1.2;
  --h1_typography-letter-spacing: -.5px;
  --h1_typography-color: var(--bal-encre);
  --h2_typography-font-size: 30px;
  --h2_typography-line-height: 1.3;
  --h2_typography-color: var(--bal-encre);
  --h3_typography-font-size: 22px;
  --h3_typography-line-height: 1.35;
  --h3_typography-color: var(--bal-encre);
  --h4_typography-font-size: 18px;
  --h4_typography-line-height: 1.4;
  --h4_typography-color: var(--bal-encre);
  --h5_typography-font-size: 16px;
  --h5_typography-line-height: 1.4;
  --h5_typography-letter-spacing: 1px;
  --h5_typography-color: var(--bal-encre);
  --h6_typography-font-size: 15px;
  --h6_typography-line-height: 1.4;
  --h6_typography-letter-spacing: 1px;
  --h6_typography-color: var(--bal-texte-2);

  /* Menu */
  --nav_typography-color: var(--bal-encre);
  --menu_hover_first_color: var(--bal-lien);
  --mobile_menu_typography-color: var(--bal-encre);
  --mobile_menu_font_hover_color: var(--bal-encre);
  --mobile_menu_toggle_color: var(--bal-encre);

  /* Boutons : texte encre sur orange (6,7:1), inversion au survol */
  --button_accent_color: var(--bal-encre);
  --button_accent_hover_color: #fff;
  --button_gradient_top_color_hover: var(--bal-encre);
  --button_gradient_bottom_color_hover: var(--bal-encre);

  /* Formulaires : 16 px évite le zoom automatique sur mobile */
  --form_text_size: 16px;
  --form_focus_border_color: var(--bal-orange);

  /* Boîtes de contenu de l'accueil */
  --content_box_title_size: 22px;
  --content_box_title_color: var(--bal-encre);
  --content_box_body_color: var(--bal-texte);

  /* Pied de page */
  --footer_text_color: var(--bal-texte-2);
}

/* ---------------------------------------------------------------
   2. Surfaces du navigateur : sélection, curseur, barres de défilement
   --------------------------------------------------------------- */
::selection { background: var(--bal-orange); color: var(--bal-encre); }
html { accent-color: var(--bal-lien); scrollbar-color: var(--bal-texte-2) var(--bal-doux); }
.fusion-text p a, .fusion-text li a, .fusion-text td a, .post-content p a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.fusion-text p a:hover, .fusion-text li a:hover, .post-content p a:hover { text-decoration-thickness: 2px; }
.fusion-text p, .fusion-text li { max-width: 75ch; }
body .fusion-text table, body .fusion-text table p { max-width: none; }

/* ---------------------------------------------------------------
   3. Focus clavier. Avada l'éteint (fusion-disable-outline) : on le
   rétablit partout, lisible sur fond clair comme sur fond sombre.
   --------------------------------------------------------------- */
body :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--bal-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #fff !important;
  border-radius: 2px;
}
.fusion-page-title-bar :focus-visible, .fusion-footer :focus-visible {
  outline-color: #fff !important;
  box-shadow: 0 0 0 6px var(--bal-nuit) !important;
}
.skip-link:focus, .fusion-skip-link:focus, a.skip-link:focus {
  background: var(--bal-encre); color: #fff; padding: .8rem 1.2rem; z-index: 99999;
}

/* ---------------------------------------------------------------
   4. En-tête : logo (marque SVG + mot en Roboto Slab), zones tactiles
   --------------------------------------------------------------- */
.fusion-logo-link {
  display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
}
.fusion-logo-link img { width: 40px; height: 40px; }
.fusion-logo-link::after {
  content: "balises";
  font: 700 28px/1 "Roboto Slab", Georgia, serif;
  letter-spacing: -.5px; color: var(--bal-encre);
}
.fusion-main-menu .fusion-menu > li > a { text-underline-offset: .3em; }
.fusion-main-menu .fusion-menu > li.current-menu-item > a .menu-text,
.fusion-main-menu .fusion-menu > li.current-menu-ancestor > a .menu-text { color: var(--bal-lien); }
.fusion-mobile-menu-icons a, .fusion-header .fusion-main-menu .fusion-main-menu-icon {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.fusion-mobile-menu-icons { margin-top: 0 !important; }

/* ---------------------------------------------------------------
   5. Barre de titre : un seul titre de page, plus basse, fil lisible
   --------------------------------------------------------------- */
.fusion-page-title-bar { height: auto !important; min-height: 0; padding: 28px 30px !important; background: var(--bal-nuit); }
.fusion-page-title-bar h1, .fusion-page-title-bar .entry-title {
  font-size: clamp(1.75rem, 3.2vw + .6rem, 2.75rem) !important;
  line-height: 1.15 !important; letter-spacing: -.5px; color: #fff; text-wrap: balance;
}
.fusion-page-title-bar .fusion-breadcrumbs, .fusion-page-title-bar .fusion-breadcrumbs a {
  font-size: 14px !important; color: #d6dae0;
}
.fusion-page-title-bar .fusion-breadcrumbs { margin-top: .4rem; }
.fusion-page-title-bar .fusion-breadcrumbs a { text-decoration: underline; text-underline-offset: .2em; }
.fusion-page-title-bar .fusion-breadcrumbs span:last-child { color: #fff; font-weight: 600; }

/* Titres du contenu : respiration et lisibilité */
.post-content h1, .post-content h2, .post-content h3, .fusion-text h1, .fusion-text h2, .fusion-text h3 { text-wrap: balance; }
.fusion-text h2, .post-content h2 { margin-top: 1.6em; }

/* ---------------------------------------------------------------
   6. Barre latérale « dans cette section »
   --------------------------------------------------------------- */
#sidebar .widget .heading h4, #sidebar .widget h4, .sidebar .widget h4 {
  font: 700 18px/1.3 "Roboto Slab", Georgia, serif; color: var(--bal-encre);
}
#sidebar .widget li, .sidebar .widget li { border-color: var(--bal-filet); }
#sidebar .widget a, .sidebar .widget a {
  color: var(--bal-texte); font-size: 16px; display: block; padding: .45rem .6rem; text-decoration: none;
}
#sidebar .widget a:hover, .sidebar .widget a:hover { color: var(--bal-lien); background: var(--bal-doux); }
#sidebar .widget .current_page_item > a, #sidebar .widget .current-menu-item > a,
.sidebar .widget .current_page_item > a, .sidebar .widget .current-menu-item > a {
  font-weight: 700; color: var(--bal-encre); background: var(--bal-doux);
}
#sidebar .widget .current_page_item > a::before, .sidebar .widget .current_page_item > a::before {
  content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .5rem;
  background: var(--bal-orange); vertical-align: .05em;
}

/* ---------------------------------------------------------------
   7. Accueil : introduction visible et portes d'entrée
   --------------------------------------------------------------- */
.bal-intro { max-width: 46rem; margin: 0 auto 2.5rem; text-align: center; }
.bal-intro h1 { margin: 0 0 .8rem; font-size: clamp(2rem, 4vw + .5rem, 3rem); line-height: 1.12; text-wrap: balance; }
.bal-intro p { text-wrap: pretty; font-size: 1.15rem; color: var(--bal-texte); margin: 0 auto; max-width: 38rem; }

.fusion-content-boxes .fontawesome-icon { color: var(--bal-bleu) !important; }
.fusion-content-boxes .icon span, .fusion-content-boxes .icon .fontawesome-icon { border-color: var(--bal-bleu) !important; }
.fusion-content-boxes .heading h2 { font-size: 22px !important; line-height: 1.25 !important; margin-bottom: .35rem; }
.fusion-content-boxes .content-container, .fusion-content-boxes .content-container p { color: var(--bal-texte) !important; font-size: 16px; line-height: 1.55; }
.fusion-content-boxes .content-box-column { transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.fusion-content-boxes .content-box-column:hover { transform: translateY(-4px); }
.fusion-content-boxes .content-box-column:hover .heading h2 { text-decoration: underline; text-decoration-color: var(--bal-orange); text-decoration-thickness: 3px; text-underline-offset: .2em; }

/* ---------------------------------------------------------------
   8. Tableaux : défilement horizontal signalé sur mobile
   --------------------------------------------------------------- */
@media (max-width: 760px) {
  .fusion-text table, .post-content table {
    display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left / 2rem 100% no-repeat local,
      linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right / 2rem 100% no-repeat local,
      linear-gradient(to right, rgba(31, 39, 51, .22), rgba(31, 39, 51, 0)) left / .8rem 100% no-repeat scroll,
      linear-gradient(to left, rgba(31, 39, 51, .22), rgba(31, 39, 51, 0)) right / .8rem 100% no-repeat scroll;
  }
}

/* ---------------------------------------------------------------
   9. Boutons, formulaires, pied de page
   --------------------------------------------------------------- */
.fusion-button, .fusion-button .fusion-button-text { font-weight: 700; letter-spacing: .04em; }
.fusion-button:hover { color: #fff !important; }
#footer, .fusion-footer-copyright-area { background: var(--bal-nuit) !important; border-top: 4px solid var(--bal-orange) !important; }
.fusion-footer-copyright-area, .fusion-footer-copyright-area a, .fusion-copyright-notice, .fusion-copyright-notice a { color: #e6e8ec !important; }
.fusion-footer-copyright-area a { text-decoration: underline; text-underline-offset: .2em; }
.fusion-footer-copyright-area { padding: 28px 0 !important; font-size: 15px; }

/* Galeries de vidéos (YouTube Embed Plus) : 2 colonnes sur mobile, 3 sur tablette, légendes lisibles, survol et clavier */
.epyt-gallery-allthumbs .epyt-gallery-thumb { padding: 0 6px 14px; }
.epyt-gallery-title {
  font-size: 14px !important; line-height: 1.35 !important; color: var(--bal-texte) !important;
  text-align: left; text-wrap: pretty; padding-top: .45rem;
}
.epyt-gallery-thumb:hover .epyt-gallery-title, .epyt-gallery-thumb:focus-visible .epyt-gallery-title {
  color: var(--bal-lien) !important; text-decoration: underline; text-underline-offset: .18em;
}
/* Grille CSS : les vignettes ne se décalent plus quand les légendes ont des longueurs différentes */
div.epyt-gallery-allthumbs[class*="epyt-cols"] { display: grid; align-items: start; gap: 0; }
div.epyt-gallery-allthumbs[class*="epyt-cols"]::before, div.epyt-gallery-allthumbs[class*="epyt-cols"]::after, div.epyt-gallery-allthumbs .epyt-gallery-rowbreak { display: none; }
div.epyt-gallery-allthumbs[class*="epyt-cols"] .epyt-gallery-thumb { float: none; width: auto !important; }
div.epyt-gallery-allthumbs.epyt-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) {
  div.epyt-gallery-allthumbs[class*="epyt-cols"] { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  div.epyt-gallery-allthumbs[class*="epyt-cols"] { grid-template-columns: repeat(2, 1fr); }
  div.epyt-gallery-allthumbs[class*="epyt-cols"] .epyt-gallery-thumb { padding: 0 4px 12px; }
  .epyt-gallery-title { font-size: 13.5px !important; }
}

/* Lecteurs vidéo : fond sombre pendant le chargement de la vignette (au lieu d'un gris vide) */
.epyt-video-wrapper, .epyt-facade { background: var(--bal-nuit); }

@media (max-width: 800px) {
  .fusion-footer-copyright-area { padding-bottom: 76px !important; } /* laisse la place au bouton « haut de page » */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
