/*
 * Header CSS - Conforme à la maquette officielle de l'Assemblée nationale du Tchad
 */

/* 1. Barre utilitaire supérieure */
.ant-utilitybar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  font-size: 0.78rem;
}

.ant-utilitybar-inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ant-republic {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ant-mini-flag {
  display: inline-grid;
  grid-template-columns: repeat(3, 7px);
  height: 14px;
  width: 21px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.ant-mini-flag i:nth-child(1) { background: #002664; }
.ant-mini-flag i:nth-child(2) { background: #fecb00; }
.ant-mini-flag i:nth-child(3) { background: #c60c30; }

.ant-republic strong {
  color: #002664;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

.ant-motto-sep {
  color: #94a3b8;
}

.ant-devise {
  color: #475569;
  font-size: 0.78rem;
}

.ant-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ant-languages {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.ant-language {
  cursor: pointer;
  transition: color 0.15s ease;
}

.ant-language.is-active,
.ant-language:hover {
  color: #002664;
  font-weight: 800;
}

.ant-lang-sep {
  color: #cbd5e1;
  font-weight: 400;
}

.ant-accessibility-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
  font-weight: 600;
  font-size: 0.75rem;
  text-decoration: none;
}

.ant-accessibility-link:hover {
  color: #002664;
  text-decoration: underline;
}

.ant-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #c60c30 !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(198, 12, 48, 0.25);
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ant-live:hover {
  background: #a50a28 !important;
  transform: translateY(-1px);
  text-decoration: none;
}

.ant-live-pulse {
  font-size: 0.8rem;
  animation: antPulse 1.8s infinite;
}

@keyframes antPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.ant-search-form {
  display: flex;
  align-items: center;
}

.ant-search-form input {
  width: 200px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  padding: 0 10px;
  font-size: 0.75rem;
  background: #ffffff;
  color: #1e293b;
  outline: none;
}

.ant-search-form input:focus {
  border-color: #002664;
}

.ant-search-form button {
  width: 34px;
  height: 32px;
  border: 0;
  background: #002664;
  color: #ffffff;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.ant-search-form button:hover {
  background: #0a357a;
}

/* 2. Bandeau de marque principal */
.ant-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.ant-brand-row {
  min-height: 88px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 12px 0;
}

.ant-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.ant-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.ant-brand-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 700;
  color: #002664;
}

.ant-brand-motto {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  color: #64748b;
  font-size: 0.95rem;
  border-left: 1px solid #e2e8f0;
  padding-left: 24px;
}

.ant-brand-mission {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #64748b;
}

.ant-building-mark {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.ant-mission-text {
  font-size: 0.65rem;
  line-height: 1.25;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #64748b;
}

/* 3. Bande de navigation principale */
.ant-menu-band {
  background: #002664;
  color: #ffffff;
  position: relative;
  z-index: 90;
  box-shadow: 0 4px 15px rgba(0, 38, 100, 0.16);
  border-bottom: 2px solid #dfbb62;
}

.ant-menu-band-inner {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 8px;
}

.ant-home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 46px;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.15s ease;
}

.ant-home-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fecb00;
}

.ant-menu-band .ant-nav {
  flex: 1;
}

/* Liste principale de premier niveau */
.ant-menu-band .ant-nav > ul,
.ant-menu-band .ant-nav > div > ul {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ant-menu-band .ant-nav > ul > li,
.ant-menu-band .ant-nav > div > ul > li {
  position: relative;
}

.ant-menu-band .ant-nav > ul > li > a,
.ant-menu-band .ant-nav > div > ul > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 14px 10px;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.ant-menu-band .ant-nav > ul > li > a:hover,
.ant-menu-band .ant-nav > div > ul > li > a:hover,
.ant-menu-band .ant-nav > ul > li:hover > a,
.ant-menu-band .ant-nav > div > ul > li:hover > a {
  color: #fecb00;
  text-decoration: none;
}

.ant-dropdown-arrow {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* ==========================================================================
   Sous-menus déroulants verticaux (Dropdowns)
   Masqués par défaut, affichés au survol / focus sur l'élément parent
   ========================================================================== */
.ant-menu-band .ant-nav ul.sub-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  width: max-content;
  max-width: 320px;
  background: #002664;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border-top: 3px solid #fecb00;
  border-radius: 0 0 6px 6px;
  padding: 8px 0;
  z-index: 999;
  list-style: none;
  margin: 0;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* Alignement à droite pour le dernier sous-menu (Coopération) pour éviter qu'il ne déborde de l'écran */
.ant-menu-band .ant-nav > ul > li:last-child ul.sub-menu,
.ant-menu-band .ant-nav > div > ul > li:last-child ul.sub-menu {
  left: auto;
  right: 0;
}

/* Affichage au survol ou au focus clavier */
.ant-menu-band .ant-nav li:hover > ul.sub-menu,
.ant-menu-band .ant-nav li:focus-within > ul.sub-menu {
  display: flex !important;
}

.ant-menu-band .ant-nav ul.sub-menu li {
  width: 100%;
  display: block;
  margin: 0;
  padding: 0;
}

.ant-menu-band .ant-nav ul.sub-menu a {
  display: block !important;
  padding: 9px 18px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #e2e8f0 !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, padding 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.ant-menu-band .ant-nav ul.sub-menu a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fecb00 !important;
  border-left-color: #fecb00;
  padding-left: 22px !important;
  text-decoration: none;
}

.ant-menu-toggle {
  display: none;
  border: 0;
  background: #002664;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1100px) {
  .ant-brand-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .ant-brand-motto,
  .ant-brand-mission {
    display: none;
  }
  .ant-menu-toggle {
    display: block;
  }
  .ant-menu-band .ant-nav {
    display: none;
  }
  .ant-menu-band .ant-nav.ant-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #002664;
    padding: 10px 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  }
  .ant-menu-band .ant-nav.ant-open ul {
    flex-direction: column;
    align-items: stretch;
  }
  .ant-menu-band .ant-nav.ant-open .sub-menu {
    position: static;
    border-top: 0;
    box-shadow: none;
    padding-left: 14px;
  }
}

@media (max-width: 768px) {
  .ant-utilitybar-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
    gap: 8px;
  }
  .ant-tools {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .ant-search-form input {
    width: 140px;
  }
}

/* Topbar pleine largeur + réseaux sociaux */
.ant-utilitybar{width:100%;background:#0b2346;border-bottom:2px solid #d4a62a;color:#fff}
.ant-utilitybar-inner{width:100%;max-width:none;margin:0;padding:0 clamp(18px,4vw,72px);min-height:42px}
.ant-republic strong,.ant-republic .ant-devise,.ant-republic .ant-motto-sep{color:#fff}
.ant-tools{gap:11px;color:#fff}
.ant-top-contact{display:inline-flex;align-items:center;gap:6px;color:#fff;font-size:.72rem;white-space:nowrap;text-decoration:none;opacity:.92}
.ant-top-contact:hover{color:#fecb00;text-decoration:none}
.ant-socials{display:flex;align-items:center;gap:6px;padding:0 8px;border-left:1px solid rgba(255,255,255,.22);border-right:1px solid rgba(255,255,255,.22)}
.ant-socials a,.ant-socials .ant-social-placeholder{display:inline-grid;place-items:center;width:25px;height:25px;border-radius:50%;color:#fff;border:1px solid rgba(255,255,255,.24);font-size:.69rem;font-weight:800;line-height:1;text-decoration:none}
.ant-socials a:hover{background:#fecb00;border-color:#fecb00;color:#0b2346;text-decoration:none}
.ant-social-placeholder{opacity:.78;cursor:default}.ant-social-youtube{font-size:.58rem!important}.ant-social-instagram{font-size:.9rem!important}
.ant-languages,.ant-language,.ant-language.is-active,.ant-language:hover,.ant-accessibility-link{color:#fff}
.ant-lang-sep{color:rgba(255,255,255,.45)}.ant-accessibility-link:hover{color:#fecb00}
@media(max-width:1250px){.ant-utilitybar-inner{padding-inline:18px}.ant-top-contact span{display:none}.ant-tools{gap:8px}.ant-search-form input{width:160px}}
@media(max-width:860px){.ant-utilitybar-inner{align-items:flex-start}.ant-socials{order:3}.ant-search-form{flex:1 1 100%}.ant-search-form input{width:100%}}

/* Finition bannière institutionnelle : 2 mm sous le topbar + voile or léger */
.ant-banner-shell{
  position:relative;
  width:100%;
  margin-top:2mm;
  padding:0;
  background:#fff;
  border:0;
  overflow:hidden;
}
.ant-banner-link{position:relative;display:block;width:100%;overflow:hidden;text-decoration:none;line-height:0}
.ant-banner-image{display:block;width:100%;height:auto;max-width:none;object-fit:contain}
.ant-banner-link::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(0,38,100,.24) 0%, rgba(0,38,100,.05) 25%, rgba(0,38,100,.04) 72%, rgba(0,38,100,.24) 100%),
    linear-gradient(180deg, rgba(255,255,255,0) 54%, rgba(223,187,98,.18) 100%);
}
@media(max-width:768px){.ant-banner-shell{margin-top:2mm}.ant-banner-image{object-fit:contain;object-position:center}}

/* Icônes sociales vectorielles, sans dépendance externe */
.ant-socials svg{width:12px;height:12px;display:block}
.ant-socials a,.ant-socials .ant-social-placeholder{background:rgba(255,255,255,.025)}
.ant-socials .ant-social-youtube svg{width:13px;height:13px}
.ant-socials .ant-social-instagram svg{width:13px;height:13px}

/* Ajustements mobile topbar et bannière : aucun élément tronqué */
@media(max-width:600px){
  .ant-utilitybar-inner{padding:7px 14px}
  .ant-tools{width:100%;justify-content:flex-start;gap:8px;flex-wrap:wrap}
  .ant-top-contact{order:1}.ant-languages{order:2}.ant-accessibility-link{order:3}.ant-live{order:4;margin-left:0}
  .ant-search-form{order:5;flex:1 1 100%;width:100%}.ant-search-form input{width:100%}
  .ant-socials{order:6;margin-top:1px}
  .ant-banner-image{width:100%;height:auto;min-height:0;object-fit:contain;object-position:center}
}
