/* ==========================================================================
   DJFORM Blog - Sélecteur de langue Header + Bandeau de suggestion de langue
   Identité visuelle DJFORM (#1a1922 / #7DBB00), zéro CLS, accessible WCAG AA+
   ========================================================================== */

/* --- 1. Sélecteur de langue en haut du blog --- */
.djf-header-lang-slot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.djf-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 950;
}

.djf-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 38px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(26, 25, 34, 0.14);
  background: #ffffff;
  color: #1a1922;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.djf-lang-trigger:hover,
.djf-lang-trigger[aria-expanded="true"] {
  border-color: #7DBB00;
  box-shadow: 0 4px 14px rgba(125, 187, 0, 0.22);
}

.djf-lang-trigger:focus-visible {
  outline: 3px solid #7DBB00;
  outline-offset: 2px;
}

.djf-lang-chevron {
  transition: transform 0.18s ease;
  opacity: 0.72;
}

.djf-lang-trigger[aria-expanded="true"] .djf-lang-chevron {
  transform: rotate(180deg);
}

.djf-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
  display: block;
}

.djf-flag-fallback {
  font-size: 0.72rem;
  font-weight: 700;
}

.djf-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 175px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  background: #1a1922;
  border: 1.5px solid #7DBB00;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  z-index: 100010;
}

.djf-lang-dropdown[hidden] {
  display: none !important;
}

.djf-lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #f4f5f7 !important;
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.djf-lang-option:hover,
.djf-lang-option:focus-visible {
  background: rgba(125, 187, 0, 0.18);
  color: #ffffff !important;
  outline: none;
}

.djf-lang-option.is-current {
  background: rgba(125, 187, 0, 0.26);
  color: #9be019 !important;
}

.djf-lang-name {
  flex: 1 1 auto;
}

.djf-lang-code {
  font-size: 0.72rem;
  opacity: 0.7;
  font-weight: 700;
}

@media (max-width: 767px) {
  .djf-lang-trigger {
    padding: 6px 9px;
    min-block-size: 36px;
    gap: 5px;
  }
}

/* --- 2. Bandeau intelligent de suggestion de langue (jumeau exact de djformlangsuggest) --- */
.djfls-visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.djfls-banner {
  position: fixed;
  inset: 12px 12px auto 12px;
  margin-inline: auto;
  margin-block: 0;
  padding: 0;
  width: fit-content;
  max-width: min(760px, calc(100vw - 24px));
  border: 1.5px solid #7DBB00;
  border-radius: 12px;
  background: #1a1922;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(125, 187, 0, 0.22);
  font-family: "Open Sans", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.45;
  z-index: 100020;
  overflow: visible;
}

@supports not selector(:popover-open) {
  .djfls-banner:not(.djfls-is-open) {
    display: none;
  }
}

.djfls-banner:is(:popover-open, .djfls-is-open) {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .djfls-banner {
    opacity: 0;
    translate: 0 -10px;
    transition:
      opacity 0.22s ease-out,
      translate 0.22s ease-out,
      display 0.22s ease-out,
      overlay 0.22s ease-out;
    transition-behavior: allow-discrete;
  }

  .djfls-banner:is(:popover-open, .djfls-is-open) {
    opacity: 1;
    translate: 0 0;
  }

  @starting-style {
    .djfls-banner:is(:popover-open, .djfls-is-open) {
      opacity: 0;
      translate: 0 -10px;
    }
  }
}

.djfls-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 44px 10px 14px;
  position: relative;
}

.djfls-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(125, 187, 0, 0.16);
  color: #9be019;
}

.djfls-message {
  margin: 0;
  color: #f4f5f7;
  font-size: 0.9375rem;
  font-weight: 400;
  flex: 1 1 auto;
  min-width: 0;
}

.djfls-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.djfls-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  background-color: #7DBB00;
  color: #14170f !important;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.djfls-cta:hover,
.djfls-cta:active {
  background-color: #92d40c;
  color: #0e100a !important;
  text-decoration: none !important;
}

.djfls-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 32px;
  min-block-size: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.djfls-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.djfls-cta:focus-visible,
.djfls-close:focus-visible {
  outline: 3px solid #9be019;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .djfls-banner {
    inset: 8px 8px auto 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .djfls-inner {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 10px;
    padding: 10px 44px 12px 12px;
  }

  .djfls-icon {
    width: 28px;
    height: 28px;
    margin-top: 2px;
  }

  .djfls-message {
    flex: 1 1 calc(100% - 42px);
    font-size: 0.875rem;
  }

  .djfls-actions {
    width: 100%;
    padding-inline-start: 38px;
  }

  .djfls-cta {
    white-space: normal;
    text-align: center;
  }
}
