/*
Theme Name:         CAVAMAC
Theme URI:             https://www.e-labo.biz/
Description:            Thème CAVAMAC
Author:                   e-labo
Author URI:             https://www.e-labo.biz
Version:                  1.0.7
Requires at least :   5.0
Tested up to:          5.4
Require PHP:           7.0
Text Domain:          theme-capra-cavamac
Domain Path:          /languages
License:                  GPL-3.0-or-later
License URI:            https://www.gnu.org/licenses/gpl-3.0.html
Template:               theme-capra
*/
body {
  background-color: #fff;
}
body .a11y-toolbar ul li .icon-print,
body .a11y-toolbar ul li .aticon,
body .second-color,
body .first-color {
  color: #006cb4;
}
body .site-header .header-account,
body .entry-content.search-result h2 .type,
body .content-menu-mobile a,
body .content-menu-mobile .menu-item-has-children > a,
body .site-footer,
body .global-menu-mobile,
body .site-header,
body .first-bg-color {
  background-color: #006cb4;
}
body .first-border-color {
  border-color: #006cb4;
}

body #main .gform_footer input[type="submit"],
body .btn {
  border-color: #006cb4;
  color: #006cb4;
}
body #main .gform_footer input[type="submit"]:hover,
body #main .gform_footer input[type="submit"]:active,
body .btn:hover,
body .btn:active {
  background: #006cb4;
  color: #fff;
}

body .a11y-toolbar ul li a.active,
body .a11y-toolbar ul li button.active {
  background: #006cb4;
}
body .a11y-toolbar ul li a.active .aticon,
body .a11y-toolbar ul li button.active .aticon {
  color: #fff;
}

/* header*/
body .menu-mobile {
  color: #fff;
}
body .menu-mobile .menu-mobile-burger {
  border-color: #fff;
}
body .menu-mobile .menu-mobile-burger:before,
body .menu-mobile .menu-mobile-burger:after {
  background: #fff;
}

body .site-header .btn-search .label {
  text-indent: -500px;
  overflow: hidden;
  display: inline-block;
}
body .site-header .btn-account {
  color: #fff;
}
body .site-header .icon-search {
  color: #006cb4;
}

@media (max-width: 768px) {
  body .site-header .global-page .logo {
    right: 135px;
  }
}

@media (max-width: 768px) {
  .header-acceo {
    position: absolute;
    right: 90px;
    background: #fff;
    display: flex;
    align-items: center;
    height: 70px;
  }
}
@media (min-width: 769px) {
  .header-acceo {
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .header-acceo img.desktop {
    display: none;
  }
  .header-acceo img.mobile {
    display: block;
  }
}
@media (min-width: 769px) {
  .header-acceo img.desktop {
    display: block;
  }
  .header-acceo img.mobile {
    display: none;
  }
}
/* bg */
#main {
  background-image: url(img/bg.png);
  background-repeat: no-repeat;
  background-position: 50% 100px;
  background-size: 100% auto;
}
@media (max-width: 768px) {
  #main {
    background-position: 50% 70px;
  }
}

body.home #main {
  background-image: url(img/bg-home.jpg);
  padding-bottom: 0;
}
@media (max-width: 768px) {
  body.home #main {
    background-position: 50% 70px;
  }
}

body .home-news {
  background-image: url(img/bg-news.png);
  background-repeat: no-repeat;
  background-position: 50% 100px;
  background-size: 100% auto;
}
body .home-videos {
  background-image: url(img/bg-videos.png);
  background-repeat: no-repeat;
  background-position: 50% 100%;
  background-size: 100% auto;
  padding-bottom: 140px;
}
@media (max-width: 768px) {
  body .home-videos {
    padding-bottom: 40px;
  }
}

/* footer */
.site-footer .cols {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .site-footer .cols {
    display: block;
  }
  .site-footer .cols div.col {
    padding-bottom: 20px;
    width: 100%;
  }
  .site-footer .cols div.col.col-form {
    padding-top: 0;
    padding-bottom: 0;
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .site-footer .cols div.col {
    flex: 0 0 calc(50% - 30px);
  }

  .site-footer .cols div.col.col-form {
    flex: 0 0 calc(100% - 30px);
    width: calc(100% - 30px);
    padding-top: 20px;
  }
}

.site-footer .gform_wrapper {
  position: relative;
}
.site-footer .gform_wrapper .gfield {
  margin: 10px 0 15px;
}

.site-footer input {
  color: #535b61;
  box-sizing: border-box;
  line-height: 1.2em;
}
.site-footer .email .ginput_container_email {
  background: #fff;
  border-radius: 5px;
}
.site-footer .email input {
  border: 0;
  width: calc(100% - 150px);
  padding: 10px;
  height: 42px;
}


.site-footer input[type="submit"] {
  background: #003559;
  text-transform: uppercase;
  color: #fff;
  border: 0;
  width: 150px;
  padding: 10px;
  height: 42px;
}

.site-footer .gfield_required,
.site-footer .validation_error {
  display: none;
}
.site-footer .validation_message {
  font-weight: bold;
  font-size: 0.8rem;
  padding-top: 5px;
}
.site-footer .gform-field-label a {
  color: #ffffff;
}
.site-footer .gform-field-label a:hover {
  text-decoration: none;
}

.site-footer .gfield_description {
  margin-top: 10px;
  font-size: 0.8em;
}

.site-footer #field_1_1 .gform-field-label {
  display: block;
  margin-bottom: 5px;
}
#a11y-toolbar {
  position: fixed;
  top: 43vh;
  right: 0;
  z-index: 1000;
}


/* news */
body .news-min:after {
  background-color: #006cb4;
}
body .news-min.summary {
  border-color: #006cb4;
}
body .news-min:hover {
  box-shadow: 0 0 25px 0 rgba(0, 108, 180, 0.25);
}
.article-metas a,
.article-metas ul,
.article-metas .cat {
  color: #006cb4;
}
body .home-videos .first .img:after,
body .home-videos .video-link .img:after {
  background-color: rgba(0, 108, 180, 0.9);
}

body .nav-archives span.current,
body .nav-archives a {
  color: #006cb4;
  border: 1px #006cb4 solid;
}

body .nav-archives span.current:hover,
body .nav-archives span.current:active,
body .nav-archives a:hover,
body .nav-archives a:active {
  color: #fff;
  background: #006cb4;
}

body .nav-archives span.current {
  color: #fff;
  background: #006cb4;
}

/* entry content */
body .entry-content a,
body .entry-content h2,
body .entry-content h3,
body .entry-content h4,
body .entry-content h5 {
  color: #006cb4;
}
body .entry-content .wp-block-button a {
  border: 1px #006cb4 solid;
  border-radius: 5px;
  color: #fff;
}
body .entry-content .wp-block-button a:hover {
  text-decoration: none;
}

body .entry-content .wp-block-button.is-style-squared a {
  border-radius: 0;
}
body .entry-content .wp-block-button.is-style-outline a {
  color: #006cb4;
  background: #fff;
}
body .entry-content .wp-block-button.is-style-outline a:hover {
  color: #fff;
  background: #006cb4;
}

body .entry-content .wp-block-file__button {
  border: 1px #006cb4 solid;
  border-radius: 5px;
  color: #fff;
  background: #006cb4;
}
body .entry-content .wp-block-file__button:hover {
  color: #006cb4;
  background: #fff;
}

body .entry-content .wp-block-button__link {
  background: #006cb4;
}
body .entry-content .wp-block-button__link:hover {
  color: #006cb4;
  background: #fff;
}

body .entry-content h2,
body .entry-content h3,
body .entry-content h4,
body .entry-content h5 {
  font-weight: bold;
}

body .entry-content table,
body .entry-content .wp-block-table.is-style-stripes {
  border-color: #006cb4;
}

body .entry-content table td,
body .entry-content table th,
body .entry-content .wp-block-table.is-style-stripes td,
body .entry-content .wp-block-table.is-style-stripes th {
  border-color: #006cb4;
}

body .entry-content .glossary-tooltip-content {
  background: #006cb4;
}
body .entry-content .glossary-tooltip-content:after {
  border-top-color: #006cb4;
}

body .entry-content .is-open h2.c-accordion__title,
body .entry-content .is-open h2.c-accordion__title:after {
  color: #006cb4;
}

body .entry-content .wp-block-pb-accordion-item {
  border-color: #006cb4;
}

body .glossary-letter {
  color: #006cb4;
}

body aside .list-docs {
  border-color: #006cb4;
}
body aside .list-docs a:hover {
  color: #006cb4;
}

body .entry-content.search-result h2 {
  border-top-color: #cce2f0;
}
select.select-contact {
  width: auto;
}

.contact-form .form-infos {
  display: none;
  margin: 2em 0 1em;
}

.gfield--type-date .clear-multi {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* tools accessibility */
body .a11y-toolbar ul li a,
body .a11y-toolbar ul li button {
  border-color: #006cb4;
  border-left: 1px #006cb4 solid;
  color: #006cb4;
}

/* === Nouveau menu home accessible corrigé === */
.home-short-menu {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
}

.home-short-menu ul.home-menu {
  display: flex;
  flex-direction: column;
  width: 350px !important;
  min-width: 280px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0, 108, 180, 0.2);
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 2;
}

.home-short-menu ul.home-menu > li {
  border-top: 1px solid #3065b5;
  width: 100%;
}

.home-short-menu ul.home-menu > li:first-child {
  border-top: none;
}

.home-short-menu .disclosure-btn.menu-link {
  width: 100%;
  background: #fff;
  color: #006cb4;
  font-weight: bold;
  font-size: 1.2em;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  border: none;
  outline: none;
  padding: 1.2em 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 0;
  box-sizing: border-box;
}

.home-short-menu ul.home-menu > li > .disclosure-btn[aria-expanded="true"] {
  background: #006cb4;
  color: #fff;
}

.home-short-menu .disclosure-btn .icon-disclosure {
  margin-left: 1em;
  font-size: 1.5em;
  line-height: 1;
  transition: color 0.2s;
}

.home-short-menu
  ul.home-menu
  > li
  > .disclosure-btn[aria-expanded="true"]
  .icon-disclosure {
  color: #fff;
}

.home-short-menu ul.home-menu > li > .sub-menu {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 320px;
  background: #006cb4;
  color: #fff;
  border-radius: 0 8px 8px 0;
  padding: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 25px rgba(0, 108, 180, 0.2);
  height: 100%;
  align-items: flex-start;
}

.home-short-menu ul.home-menu > li > .sub-menu > li {
  width: 100%;
}

.home-short-menu ul.home-menu > li > .sub-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: normal;
  transition: color 0.2s;
}

.home-short-menu ul.home-menu > li > .sub-menu a:hover,
.home-short-menu ul.home-menu > li > .sub-menu a:focus {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .home-short-menu {
    flex-direction: column;
    max-width: 100%;
  }
  .home-short-menu ul.home-menu {
    max-width: 100%;
    /* min-width: 0; */
    border-radius: 8px 8px 0 0;
  }
  .home-short-menu ul.home-menu > li > .sub-menu {
    position: static;
    left: auto;
    top: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: none;
    padding: 1em 1.2em;
    /* min-width: 0; */
    width: 100%;
    height: auto;
  }
}

/* Accessibilité menu home disclosure */
.home-short-menu [hidden] {
  display: none !important;
}

.home-short-menu .disclosure-btn:focus {
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
  z-index: 2;
}

.home-short-menu .disclosure-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  /* Hérite du style .menu-link */
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-short-menu .disclosure-btn .icon-disclosure {
  margin-left: 0.5em;
  font-size: 1.2em;
  line-height: 1;
}

/* === Menu principal : sous-menu superposé à droite sur desktop, accordéon sur mobile === */

.header-menu-main .menu-main-btn.disclosure-btn {
  width: 100%;
  background: none;
  color: #ffffff;
  text-transform: uppercase;
  border-top: 1px #fff solid;
  outline: none;
  padding: 1em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

/* === Animation et accessibilité des sous-menus du menu principal === */
.header-menu-main > li > .sub-menu {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateX(0);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  min-width: 260px;
  padding: 1em 1.2em;
  z-index: 10;
  position: absolute;
  top: 0;
}

.header-menu-main > li.open > .sub-menu {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateX(390px); /* ou la valeur souhaitée pour l'animation */
}

@media (max-width: 900px) {
  .header-menu-main > li > .sub-menu {
    position: static;
    left: auto;
    top: auto;
    border-radius: 0 0 8px 8px;
    box-shadow: none;
    padding: 0.5em 0.5em;
    /* min-width: 0; */
    width: 100%;
    border-left: none;
    display: none;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: none;
  }
  .header-menu-main > li.open > .sub-menu {
    display: flex;
  }
}

/* Focus visible sur les boutons du menu principal */
.header-menu-main .menu-main-btn.disclosure-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px #ffcc00, 0 0 0 6px #006cb4;
    background: #006cb4;
    color: #fff;
    z-index: 3;
    position: relative;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.header-menu-main .menu-main-btn.disclosure-btn:focus .chevron svg {
    stroke: #fff;
}

/* Utilitaire accessibilité : cacher visuellement mais laisser accessible */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Modale de recherche accessible */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.search-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.search-modal-content {
  position: relative;
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.search-modal.is-open .search-modal-content {
  transform: scale(1);
}

.search-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.search-modal-close:hover,
.search-modal-close:focus {
  color: #006cb4;
  background-color: #f5f5f5;
  outline: 2px solid #006cb4;
  outline-offset: 2px;
}

.search-modal-close .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-form-modal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.search-form-modal .search-field {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form-modal .search-field:focus {
  outline: none;
  border-color: #006cb4;
  box-shadow: 0 0 0 3px rgba(0, 108, 180, 0.1);
}

.search-form-modal .search-submit {
  background: #006cb4;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.search-form-modal .search-submit:hover,
.search-form-modal .search-submit:focus {
  background: #003559;
  outline: 2px solid #006cb4;
  outline-offset: 2px;
}

.search-form-modal .search-submit:active {
  transform: scale(0.98);
}

.search-form-modal .icon-search {
  font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
  .search-modal-content {
    padding: 30px 20px;
    margin: 20px;
  }
  
  .search-form-modal {
    flex-direction: column;
    gap: 15px;
  }
  
  .search-form-modal .search-field,
  .search-form-modal .search-submit {
    width: 100%;
  }
}

#main {
    container-type: inline-size;
}

@container (max-width: 60em) {
    .home-short-menu .disclosure-btn.menu-link {
    font-size: 0.95em;
  }
  .home-short-menu ul.home-menu > li > .sub-menu a {
    font-size: 0.85em;
  }
}
@container (max-width: 50em) {
    .home-short-menu .disclosure-btn.menu-link {
    font-size: 0.85em;
  }
  .home-short-menu ul.home-menu > li > .sub-menu a {
    font-size: 0.75em;
  }
}

/* Bouton recherche large sous le menu mobile */
.content-menu-mobile .btn-search-full {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90%;
  max-width: 320px;
  margin: 20px auto 0 auto;
  padding: 1em 1.2em;
  background: #fff;
  color: #006cb4;
  font-weight: bold;
  font-size: 1.1em;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  gap: 0.7em;
}
.content-menu-mobile .btn-search-full .icon-search {
  font-size: 1.3em;
  color: #006cb4;
}
.content-menu-mobile .btn-search-full:focus,
.content-menu-mobile .btn-search-full:hover {
  background: #e6f0fa;
  color: #003559;
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}
@media (max-width: 400px) {
  .content-menu-mobile .btn-search-full {
    font-size: 1em;
    padding: 0.8em 0.7em;
  }
}

/* Cacher le bouton recherche mobile sur desktop */
@media (min-width: 901px) {
  .content-menu-mobile .btn-search-full {
    display: none !important;
    pointer-events: none;
  }
}

/* === Correction label contact sur les dates === */
.gfield_date_dropdown_day .screen-reader-text, .gfield_date_dropdown_month .screen-reader-text, .gfield_date_dropdown_year .screen-reader-text {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 5px 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  -webkit-clip-path: none !important;
  clip-path: none !important;
  border: none !important;
  word-wrap: normal !important;
}

/* === Correction couleur des champs obligatoires === */
#main .gfield_required.gfield_required_asterisk {
  color: #B00E37;
}
/* === Correction couleur bordure des champs de formulaires === */
#main input, #main textarea, #main select {
  border: 1px #585858 solid;
}

/* === Correction couleur des liens dans les champs de formulaires === */
.gform-field-label a {
  text-decoration: underline;
  color: #006cb4;
}
.gform-field-label a:hover {
  text-decoration: none;
}

/* === Mise en forme formulaire non legacy === */
#main .gform_fields .gfield {
  -webkit-box-flex: 0;
    -ms-flex: 0 0 50%;
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    padding: 10px 15px;
}
#main .gform_fields .gfield.gsection, #main .gform_fields .gfield.large {
  -webkit-box-flex: 0;
  -ms-flex: 0 0 100%;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
}
#main .gform-grid-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
legend.gfield_label.gform-field-label {
  padding-bottom: 0;
}

/* === Correction position des filtres sur les actualités === */
.filters .cols-3 {
  align-items: end; /* ou flex-end selon le contexte */
  display: flex;
}
.filters .col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
@media (max-width: 768px) {
  .filters .cols-3 {
    flex-direction: column;
    align-items: stretch;
  }
  .filters .col {
    width: 100%;
    margin-bottom: 1em;
    /* Optionnel : pour espacer les colonnes sur mobile */
  }
  .filters .filter-actions {
    margin-top: 0.5em;
  }
}

/* === Responsive articles actualités avec container queries === */
.cols-news {
  container-type: inline-size;
}

@container (max-width: 1100px) and (min-width: 701px) {
  .cols-news {
    flex-wrap: wrap;
    flex-direction: column;
  }
  .cols-news .col {
    width: 48% !important;
    max-width: 48% !important;
    margin-left: 1%;
    margin-right: 1%;
    margin-bottom: 2em;
  }
}

@container (max-width: 700px) {
  .cols-news {
    flex-direction: column !important;
  }
  .cols-news .col {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 2em;
  }
}

/* === Accessibilité : barre alphabétique du glossaire === */
.glossary-term-bar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

/* === Correction couleur icones toolbar === */
body .a11y-toolbar ul li .icon-print, body .a11y-toolbar ul li .aticon {
  color: #003559 !important;
}
.a11y-toolbar ul li button:hover .icon-print, .a11y-toolbar ul li button:hover .aticon {
  color: #fff !important;
}
body .a11y-toolbar ul li a, body .a11y-toolbar ul li button {
  border-color: #003559 !important;
  border-left: 1px #003559 solid !important;
  color: #003559 !important;
}
.a11y-toolbar ul li button.active, .a11y-toolbar ul li button:hover {
  background: #003559 !important;
}

/* === Menu d'accès rapide === */
.direct-menu ul {
  display: flex;
}
.skip-link-target:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  left: 0 !important;
  outline: 2px solid #005ea5;
  background: #fff;
  color: #000;
  z-index: 10000;
}

/* === Correction champs Complianz === */
