/* Cookie consent (Complianz): dressed like the rest of the site. Complianz keeps its texts, options and behaviour;
   this only restyles its banner and its « Gérer le consentement » tab, so the colours, sizes and corners chosen
   in Complianz's own banner settings no longer show. Loaded on every page (lib/blocks.php). */

.cmplz-cookiebanner,
#cmplz-manage-consent {
  --cmplz_banner_width: 460px;
  --cmplz_banner_background_color: #ffffff;
  --cmplz_banner_border_color: #dcd8cf;
  --cmplz_banner_border_width: 1px;
  --cmplz_banner_border_radius: 0;
  --cmplz_banner_margin: 10px;
  --cmplz_title_font_size: 20px;
  --cmplz_text_font_size: 14px;
  --cmplz_text_line_height: 1.6;
  --cmplz_text_color: #4d4b46;
  --cmplz_hyperlink_color: #0e1a2e;
  --cmplz_link_font_size: 13px;
  --cmplz_category_body_font_size: 13px;
  --cmplz_category_header_title_font_size: 14px;
  --cmplz_category_header_active_font_size: 12.5px;
  --cmplz_category_header_always_active_color: #86754d;
  --cmplz_button_font_size: 12.5px;
  --cmplz_button_border_radius: 0;
  --cmplz_button_accept_background_color: #0e1a2e;
  --cmplz_button_accept_border_color: #0e1a2e;
  --cmplz_button_accept_text_color: #ffffff;
  --cmplz_button_deny_background_color: #ffffff;
  --cmplz_button_deny_border_color: #0e1a2e;
  --cmplz_button_deny_text_color: #0e1a2e;
  --cmplz_button_settings_background_color: transparent;
  --cmplz_button_settings_border_color: transparent;
  --cmplz_button_settings_text_color: #0e1a2e;
  --cmplz_slider_active_color: #0e1a2e;
  --cmplz_slider_inactive_color: #cfc9bc;
  --cmplz_slider_bullet_color: #ffffff;
}

/* The theme puts Montserrat on every p, li and button */
.cmplz-cookiebanner :is(div, p, span, a, button, li, label),
#cmplz-manage-consent .cmplz-manage-consent { font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; }

/* Card in the bottom right corner, sliding in gently */
#cmplz-cookiebanner-container .cmplz-cookiebanner {
  right: 24px;
  bottom: 24px;
  width: var(--cmplz_banner_width);
  min-width: 0;
  max-width: calc(100vw - 48px);
  padding: 28px 30px 24px;
  grid-row-gap: 14px;
  color: var(--cmplz_text_color);
  box-shadow: 0 24px 60px rgba(14, 26, 46, .16);
  animation: sfg-consent-in .7s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes sfg-consent-in {
  from { opacity: 0; transform: translateY(24px); }
}
.cmplz-cookiebanner .cmplz-divider { display: none; }
.cmplz-cookiebanner .cmplz-header { grid-template-columns: 1fr auto; }
.cmplz-cookiebanner .cmplz-header .cmplz-title {
  grid-column-start: 1;
  justify-self: start;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.005em;
  color: #0e1a2e;
}
.cmplz-cookiebanner .cmplz-body { max-height: 50vh; }
.cmplz-cookiebanner .cmplz-message,
.cmplz-cookiebanner .cmplz-categories { width: auto; }
.cmplz-cookiebanner .cmplz-message p { margin: 0; font-size: inherit; font-weight: 400; line-height: inherit; color: inherit; }

/* Preferences: one line per category, separated by thin rules */
.cmplz-cookiebanner .cmplz-categories { margin-top: 6px; border-top: 1px solid var(--cmplz_banner_border_color); }
.cmplz-cookiebanner .cmplz-categories .cmplz-category { background: none; border-bottom: 1px solid var(--cmplz_banner_border_color); }
.cmplz-cookiebanner .cmplz-categories .cmplz-category:not(:last-child) { margin-bottom: 0; }
.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header { padding: 12px 0; }
.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-title { font-weight: 400; color: #0e1a2e; }
.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-always-active { font-weight: 400; letter-spacing: .02em; }
.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-description { padding: 0 0 14px; line-height: 1.55; }
.cmplz-cookiebanner .cmplz-category-toggle svg { width: 12px; height: 12px; fill: #0e1a2e; }
.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-banner-checkbox input.cmplz-consent-checkbox:focus + .cmplz-label::before { box-shadow: 0 0 0 2px #86754d; }

/* Buttons: Accepter and Refuser side by side, same size; the preferences as a link underneath */
.cmplz-cookiebanner .cmplz-buttons { flex-flow: row wrap; gap: 10px; margin-top: 4px; }
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
  flex: 1 1 0;
  min-height: 46px;
  padding: 12px 16px;
  font-weight: 400;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
  transition: background-color .25s, border-color .25s, color .25s;
}
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:hover,
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept:focus-visible { background-color: #00558c; border-color: #00558c; }
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny:hover,
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-deny:focus-visible { color: #ffffff; background-color: #0e1a2e; }
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn:is(.cmplz-view-preferences, .cmplz-save-preferences) {
  flex-basis: 100%;
  min-height: 0;
  padding: 4px 0;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: #86754d;
  text-underline-offset: 4px;
}
.cmplz-cookiebanner .cmplz-buttons .cmplz-btn:is(.cmplz-view-preferences, .cmplz-save-preferences):hover { color: #86754d; }
.cmplz-cookiebanner .cmplz-btn:focus-visible { outline: 2px solid #86754d; outline-offset: 3px; }

/* Privacy policy link */
.cmplz-cookiebanner .cmplz-links.cmplz-documents ul { justify-content: flex-start; }
.cmplz-cookiebanner .cmplz-links .cmplz-link {
  line-height: 1.5;
  text-decoration-color: #86754d;
  text-underline-offset: 3px;
}
.cmplz-cookiebanner .cmplz-links .cmplz-link:hover { color: #86754d; }

/* « Gérer le consentement » tab, once a choice is made */
#cmplz-manage-consent .cmplz-manage-consent {
  right: 24px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #0e1a2e;
  background-color: #ffffff;
  border: 1px solid #dcd8cf;
  border-bottom: 0;
  box-shadow: 0 10px 30px rgba(14, 26, 46, .18);
}

/* Phones and small tablets: a full-width sheet at the bottom */
@media (max-width: 768px) {
  #cmplz-cookiebanner-container .cmplz-cookiebanner {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    padding: 20px 16px 16px;
    grid-row-gap: 12px;
    border-width: 1px 0 0;
  }
  .cmplz-cookiebanner { --cmplz_text_font_size: 13.5px; }
  .cmplz-cookiebanner .cmplz-body { max-height: 42vh; }
  .cmplz-cookiebanner .cmplz-buttons { flex-direction: row; }
  .cmplz-cookiebanner .cmplz-links.cmplz-documents ul { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  #cmplz-cookiebanner-container .cmplz-cookiebanner { animation: none; }
}
