/* ==========================================================================
   LycéeBac — style.css
   Modèle visuel inspiré de flpce.org :
   Tailwind CDN pour les utilitaires + cette feuille pour les composants
   (nav, sidebar, dropdowns, cartes, footer) et le mode sombre.
   Support RTL (arabe) inclus.
   ========================================================================== */

/* ---------- 1. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Utilitaire accessible, sans impact sur la mise en page */
.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;
}

body {
  overflow-x: hidden;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  background-color: #ffffff;
  color: #111827;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }

:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: #2563eb; color: #ffffff; }

.hidden { display: none !important; }

/* ---------- 2. Lien d'évitement (accessibilité) ---------- */
.skip-link {
  position: fixed;
  top: -100%;
  inset-inline-start: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: #2563eb;
  color: #ffffff;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- 3. Header / Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
}

/* Hamburger : 3 barres */
#menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}
#menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background-color: #111827;
  transition: transform 0.2s ease;
}
#menu-toggle:hover { background-color: #f3f4f6; }

/* Logo centré */
.nav-logo { position: absolute; left: 50%; transform: translateX(-50%); }
[dir="rtl"] .nav-logo { transform: translateX(-50%); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  flex-shrink: 0;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

/* Boutons icônes (recherche · langue · thème · fermer) */
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}
.icon-button:hover { background-color: #f3f4f6; }
.nav-actions { gap: 0.35rem; }
#close-sidebar { inset-inline-end: 1rem; }

/* Dropdowns (recherche / langue) */
.dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  inset-inline-end: 0;
  z-index: 50;
  width: 17rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}
.language-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
  color: #374151;
}
.language-item:hover, .language-item:focus-visible { background-color: #f3f4f6; }
.language-item.active { background-color: #dbeafe; font-weight: 600; }
.search-results { max-height: 15rem; overflow-y: auto; }
.search-result {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.375rem;
  color: #1d4ed8;
  font-size: 0.875rem;
  font-weight: 600;
}
.search-result:hover, .search-result:focus-visible { background: #eff6ff; }

/* ---------- 4. Sidebar (tiroir de navigation) ---------- */
#sidebar {
  position: fixed;
  overscroll-behavior: contain;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 60;
  width: min(85vw, 20rem);
  background-color: #ffffff;
  border-inline-end: 1px solid #e5e7eb;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-110%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
[dir="rtl"] #sidebar { transform: translateX(110%); }
body.sidebar-open #sidebar { transform: translateX(0); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #374151;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}
.sidebar-link:hover {
  background-color: #f3f4f6;
  color: #2563eb;
  transform: translateX(4px);
}
[dir="rtl"] .sidebar-link:hover { transform: translateX(-4px); }

/* Voile assombri */
#backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.sidebar-open #backdrop { opacity: 1; pointer-events: auto; }

/* ---------- 5. Contenu principal ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  position: relative;
}

/* Cartes (offres + niveaux) — identiques au modèle flpce.org */
.feature-card {
  background-color: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.feature-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Reserve space for client-rendered homepage taxonomy to prevent layout shift. */
#taxo-countries { min-height: 96px; }
#taxo-crumbs { min-height: 24px; }
#taxo-levels { min-height: 170px; }

/* ---------- 6. Dernières nouveautés ---------- */
.latest-list { list-style: none; margin: 0; padding: 0; }
.latest-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.latest-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}
.tag {
  flex-shrink: 0;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background-color: #dbeafe;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.latest-title {
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: #111827;
}
.latest-title:hover { color: #2563eb; }
.latest-time {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
}
.arrow-ico { transition: transform 0.2s ease; }
[dir="rtl"] .arrow-ico { transform: scaleX(-1); }

.resource-view {
  min-height: 24rem;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}
.resource-eyebrow {
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.resource-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}
.resource-types a {
  padding: 1rem;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
}
.resource-types a:hover, .resource-types a:focus-visible { border-color: #2563eb; background: #eff6ff; }
@media (max-width: 640px) {
  .resource-types { grid-template-columns: 1fr; }
}

/* ---------- 7. Footer sombre (comme flpce.org) ---------- */
.site-footer {
  background-color: #1f2937;
  color: #f9fafb;
  margin-top: auto;
}
.site-footer a { transition: color 0.2s ease; }
.site-footer a:hover { color: #3b82f6; }
.site-footer .brand-name { color: #ffffff; }

/* ---------- 8. MODE SOMBRE — palette noire du modèle flpce.org ----------
   Le sélecteur `.dark-mode` fonctionne que la classe soit posée sur <html>
   ou sur <body> (le script anti-flash la pose sur <html>). */
.dark-mode { background-color: #000000; color: #ffffff; }
.dark-mode body { background-color: #000000; color: #ffffff; }

/* Navigation & sidebar */
.dark-mode .site-nav { background-color: #000000; border-bottom-color: #333333; }
.dark-mode .brand-name { color: #ffffff; }
.dark-mode #menu-toggle span { background-color: #ffffff; }
.dark-mode #menu-toggle:hover,
.dark-mode .icon-button:hover { background-color: #1a1a1a; }
.dark-mode #sidebar { background-color: #0a0a0a; border-inline-end-color: #333333; }
.dark-mode .sidebar-link { color: #ffffff; }
.dark-mode .sidebar-link:hover { background-color: #1a1a1a; color: #60a5fa; }
.dark-mode #sidebar .border-b { border-color: #333333; }

/* Dropdowns & champs */
.dark-mode .dropdown { background-color: #0a0a0a; border-color: #333333; color: #ffffff; }
.dark-mode .language-item { color: #ffffff; }
.dark-mode .language-item:hover { background-color: #1a1a1a; }
.dark-mode .language-item.active { background-color: #1e3a8a; }
.dark-mode input {
  background-color: #1a1a1a;
  border-color: #333333;
  color: #ffffff;
}
.dark-mode input::placeholder { color: #888888; }

/* Sections : tout passe au noir, comme flpce.org */
.dark-mode section { background-color: #000000 !important; color: #ffffff; }
.dark-mode .bg-gradient-to-br { background: #000000 !important; }
.dark-mode .bg-gray-50 { background-color: #0a0a0a !important; }

/* Cartes */
.dark-mode .feature-card,
.dark-mode .latest-item {
  background-color: #0a0a0a;
  border-color: #333333;
  color: #ffffff;
}
.dark-mode .feature-card:hover { border-color: #60a5fa; background-color: #1a1a1a; }
.dark-mode .latest-item:hover { border-color: #60a5fa; }
.dark-mode .resource-view { background: #0a0a0a; border-top-color: #333; }
.dark-mode .resource-types a { background: #1a1f2e; border-color: #2b3a55; color: #93c5fd; }
.dark-mode .resource-types a:hover, .dark-mode .resource-types a:focus-visible { background: #1e293b; border-color: #60a5fa; }
.dark-mode .feature-card h3,
.dark-mode .latest-title { color: #ffffff; }
.dark-mode .feature-card p { color: #d1d5db; }
.dark-mode .bg-blue-100 { background-color: #1e3a8a !important; }

/* Textes : hiérarchie grise remappée (ordre = priorité) */
.dark-mode h1, .dark-mode h2, .dark-mode h3,
.dark-mode h4, .dark-mode h5, .dark-mode h6 { color: #ffffff; }
.dark-mode p, .dark-mode span, .dark-mode div { color: #ffffff; }
.dark-mode .text-gray-900 { color: #ffffff !important; }
.dark-mode .text-gray-800 { color: #f3f4f6 !important; }
.dark-mode .text-gray-700 { color: #e5e7eb !important; }
.dark-mode .text-gray-600 { color: #d1d5db !important; }
.dark-mode .text-gray-500 { color: #9ca3af !important; }
.dark-mode .text-gray-400 { color: #6b7280 !important; }
.dark-mode .text-gray-300 { color: #d1d5db !important; }
.dark-mode .text-blue-600 { color: #60a5fa !important; }
.dark-mode .text-blue-400 { color: #60a5fa !important; }
.dark-mode .tag { background-color: #1e3a8a; color: #93c5fd; }

/* Boutons bleus conservés */
.dark-mode .bg-blue-600 { background-color: #2563eb !important; }
.dark-mode .border-blue-600 { border-color: #2563eb !important; }

/* ---------- 9. Responsive ---------- */
@media (max-width: 767px) {
  .site-nav { padding: 0.6rem 0.6rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-name { font-size: 1.05rem; }
  .nav-actions { gap: 0.15rem; }
  .icon-button, #menu-toggle { width: 38px; height: 38px; }
  .dropdown { width: min(92vw, 17rem); inset-inline-end: -2rem; }
}

@media (max-width: 420px) {
  .site-nav { padding: 0.5rem 0.4rem; }
  .brand-name { font-size: 0.98rem; }
  .icon-button, #menu-toggle { width: 35px; height: 35px; }
}

/* Éléments flexibles de la liste nouveautés sur mobile */
@media (max-width: 720px) {
  .latest-item { flex-wrap: wrap; row-gap: 0.25rem; padding: 0.85rem 1rem; }
  .latest-time { margin-inline-start: auto; }
}

/* ---------- 10. Accordéons hiérarchiques (taxonomies par pays) ---------- */
.acc-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
  text-align: start;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.acc-trigger:hover { background-color: #f3f4f6; color: #2563eb; }
.acc-flag { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.acc-label { flex: 1; min-width: 0; }
.acc-trigger::after {
  content: "▾";
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s ease;
}
.acc-trigger[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Sous-niveaux (cycles dans un pays) */
.acc-trigger--sub {
  padding-inline-start: 2rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.acc-panel { list-style: none; margin: 0.15rem 0 0.35rem; padding: 0; }
.acc-panel .acc-panel { margin-inline-start: 0.65rem; }

/* Feuilles de l'arborescence */
.sidebar-link--leaf {
  padding-inline-start: 3rem;
  font-size: 0.875rem;
}
.sidebar-link--leaf::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #93c5fd;
  flex-shrink: 0;
}

.dark-mode .acc-trigger { color: #ffffff; }
.dark-mode .acc-trigger:hover { background-color: #1a1a1a; color: #60a5fa; }
.dark-mode .acc-trigger::after { color: #6b7280; }

/* Cartes pays (accueil) */
.flag-badge {
  font-size: 2.5rem;
  line-height: 1;
  display: block;
  margin-bottom: 1rem;
}

/* ---------- 10b. Sélecteur de taxonomie (pays → niveaux, modèle AlloSchool) ---------- */
.taxo-countries-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.taxo-country {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.1rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.taxo-country:hover { border-color: #2563eb; background-color: #eff6ff; color: #2563eb; }
.taxo-country.taxo-active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
}
.taxo-flag { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.taxo-label { flex: 1; min-width: 0; text-align: start; }

/* Fil d'Ariane */
.taxo-crumb,
.taxo-home {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.taxo-crumb:hover, .taxo-home:hover { background-color: #e2e8f0; color: #2563eb; }
.taxo-crumb.taxo-current { background-color: #2563eb; color: #ffffff; }
.taxo-sep { color: #9ca3af; font-size: 0.9rem; }

/* Grille des niveaux */
.taxo-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.taxo-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.taxo-level.taxo-leaf {
  background: #ffffff;
  border: 1.5px solid #dbeafe;
  color: #1e40af;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.taxo-level.taxo-leaf:hover { background: #eff6ff; border-color: #2563eb; color: #2563eb; }
.taxo-level.taxo-drill {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  transition: filter 0.2s ease;
}
.taxo-level.taxo-drill:hover { filter: brightness(1.05); }
.taxo-carat { flex-shrink: 0; font-size: 1rem; color: inherit; opacity: 0.8; }
[dir="rtl"] .taxo-carat { transform: scaleX(-1); }

/* Bouton Recommencer */
.taxo-ghost {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  background: transparent;
  border: 1.5px solid #d1d5db;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.taxo-ghost:hover { background-color: #eef2ff; border-color: #2563eb; color: #2563eb; }

/* Mode sombre */
.dark-mode .taxo-countries-row { background: transparent; }
.dark-mode .taxo-country {
  background: #1a1f2e;
  border-color: #334155;
  color: #e2e8f0;
}
.dark-mode .taxo-country:hover { border-color: #60a5fa; background-color: #1e293b; color: #60a5fa; }
.dark-mode .taxo-country.taxo-active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
}
.dark-mode .taxo-crumb, .dark-mode .taxo-home {
  background: #1e293b;
  color: #cbd5e1;
}
.dark-mode .taxo-crumb:hover, .dark-mode .taxo-home:hover { background-color: #334155; color: #60a5fa; }
.dark-mode .taxo-crumb.taxo-current { background-color: #2563eb; color: #ffffff; }
.dark-mode .taxo-sep { color: #64748b; }
.dark-mode .taxo-level.taxo-leaf {
  background: #1a1f2e;
  border-color: #2b3a55;
  color: #93c5fd;
}
.dark-mode .taxo-level.taxo-leaf:hover { background-color: #1e293b; border-color: #60a5fa; color: #60a5fa; }
.dark-mode .taxo-level.taxo-drill {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
}
.dark-mode .taxo-ghost {
  background: transparent;
  border-color: #475569;
  color: #cbd5e1;
}
.dark-mode .taxo-ghost:hover { background-color: #1e293b; border-color: #60a5fa; color: #60a5fa; }

/* Sélecteur responsive : 2 pays par ligne sur mobile */
@media (max-width: 720px) {
  .taxo-countries-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .taxo-country { padding: 0.8rem 0.6rem; font-size: 0.95rem; }
  .taxo-levels-grid { grid-template-columns: 1fr; }
}

/* ---------- 11. Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- 12. Interaction polish ---------- */
html { background: #ffffff; }
html.dark-mode { background: #000000; }
body { min-height: 100vh; }

body.sidebar-open { overflow: hidden; }
body.sidebar-open #sidebar { transform: translateX(0); }
[dir="rtl"] body.sidebar-open #sidebar { transform: translateX(0); }

#backdrop.hidden { display: none !important; }
#backdrop:not(.hidden) { opacity: 1; pointer-events: auto; }

.language-item[aria-current="true"]::after {
  content: "✓";
  margin-inline-start: auto;
  color: #2563eb;
  font-weight: 800;
}
.dark-mode .language-item[aria-current="true"]::after { color: #60a5fa; }

.taxo-country {
  position: relative;
  min-height: 76px;
  overflow: hidden;
}
.taxo-country::after {
  content: "";
  position: absolute;
  inset: auto -25% -65% 35%;
  height: 90px;
  background: radial-gradient(circle, rgba(59,130,246,.16), transparent 68%);
  pointer-events: none;
}
.taxo-country:hover,
.taxo-country:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37,99,235,.12);
  outline: none;
}
.taxo-country.taxo-active {
  box-shadow: 0 14px 32px rgba(37,99,235,.24);
}

.taxo-level {
  min-height: 118px;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 10px 24px rgba(30,64,175,.12);
  animation: taxo-enter .35s ease both;
  animation-delay: var(--delay, 0ms);
}
.taxo-level > span:first-child {
  display: grid;
  gap: .3rem;
}
.taxo-step {
  font: 800 .68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: .68;
  letter-spacing: .08em;
}
.taxo-level strong { font-size: 1.05rem; }
.taxo-level em {
  font-style: normal;
  font-size: .76rem;
  opacity: .72;
}
.taxo-level:hover,
.taxo-level:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(30,64,175,.2);
  outline: none;
}
.taxo-empty {
  min-height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .35rem;
  padding: 1.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: rgba(255,255,255,.72);
  color: #475569;
  text-align: center;
}
.taxo-empty > span { font-size: 1.7rem; }
.taxo-empty strong { color: #1e293b; }
.taxo-empty p { margin: 0; font-size: .88rem; color: #64748b; }

.dark-mode .taxo-empty {
  background: #0f172a;
  border-color: #334155;
  color: #cbd5e1;
}
.dark-mode .taxo-empty strong { color: #f8fafc; }
.dark-mode .taxo-empty p { color: #94a3b8; }

@keyframes taxo-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .taxo-level { animation: none; }
  .taxo-country:hover, .taxo-level:hover { transform: none; }
}


/* ---------- 13. Light-mode consistency ---------- */
html:not(.dark-mode) body,
html:not(.dark-mode) main,
html:not(.dark-mode) #home-view,
html:not(.dark-mode) #home-view > section {
  background-color: #ffffff !important;
}
html:not(.dark-mode) .bg-gradient-to-br {
  background: #ffffff !important;
}
html:not(.dark-mode) .bg-gray-50,
html:not(.dark-mode) .bg-gray-50\/50 {
  background-color: #ffffff !important;
}
html:not(.dark-mode) .taxonomy-page,
html:not(.dark-mode) .country-page {
  background-color: #ffffff !important;
}


/* ==========================================================================
   LycéeBac Homepage v2
   ========================================================================== */
:root {
  --lb-blue:#0b5cff;
  --lb-blue-dark:#0847c7;
  --lb-ink:#0d1728;
  --lb-muted:#5f6b7b;
  --lb-line:#e6eaf0;
  --lb-soft:#f5f7fb;
  --lb-card:#ffffff;
  --lb-radius:22px;
}
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; color:var(--lb-ink); background:#fff; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
body:has(.lb-header) { overflow-x:hidden; }
.hidden { display:none !important; }
.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; }
.skip-link { position:fixed; left:16px; top:12px; z-index:100; transform:translateY(-160%); padding:10px 14px; background:#111827; color:#fff; border-radius:10px; }
.skip-link:focus { transform:none; }

.lb-container { width:min(1160px,calc(100% - 40px)); margin-inline:auto; }
.lb-header { position:sticky; top:0; z-index:60; background:rgba(255,255,255,.9); backdrop-filter:blur(18px); border-bottom:1px solid rgba(15,23,42,.08); }
.lb-header-inner { width:min(1240px,calc(100% - 40px)); min-height:72px; margin:auto; display:flex; align-items:center; gap:28px; }
.lb-brand { display:inline-flex; align-items:center; gap:9px; text-decoration:none; color:var(--lb-ink); font-size:1.2rem; font-weight:850; letter-spacing:-.035em; white-space:nowrap; }
.lb-brand > span:last-child > span { color:var(--lb-blue); }
.lb-brand-icon { width:34px; height:34px; display:grid; place-items:center; flex:0 0 34px; border-radius:11px; background:#eaf1ff; overflow:hidden; }\n.lb-brand-icon img { width:100%; height:100%; object-fit:contain; display:block; }
.lb-desktop-nav { display:flex; align-items:center; gap:26px; margin-left:auto; }
.lb-desktop-nav a { color:#596579; text-decoration:none; font-size:.9rem; font-weight:650; }
.lb-desktop-nav a:hover { color:var(--lb-blue); }
.lb-actions { display:flex; align-items:center; gap:6px; margin-left:10px; }
.lb-icon-btn { border:0; background:transparent; width:40px; height:40px; display:grid; place-items:center; border-radius:11px; color:#334155; cursor:pointer; font-size:18px; }
.lb-icon-btn:hover,.lb-icon-btn:focus-visible { background:#f0f4f9; outline:none; }
.lb-menu-btn { display:none; }
.lb-popover-wrap { position:relative; }
.lb-popover { position:absolute; right:0; top:calc(100% + 10px); width:min(360px,calc(100vw - 28px)); padding:14px; background:#fff; border:1px solid var(--lb-line); border-radius:16px; box-shadow:0 18px 50px rgba(15,23,42,.14); z-index:80; }\n#search-dropdown { max-width:calc(100vw - 24px); overflow:hidden; }\n#search-dropdown form { min-width:0; width:100%; }\n#search-dropdown input { display:block; min-width:0; max-width:100%; }
.lb-popover label { display:block; margin-bottom:7px; font-size:.78rem; font-weight:750; color:#475467; }
.lb-popover input { width:100%; padding:12px 13px; border:1px solid #d8dee8; border-radius:11px; outline:none; background:#f8fafc; color:#111827; }
.lb-popover input:focus { border-color:var(--lb-blue); box-shadow:0 0 0 3px rgba(11,92,255,.12); }
.lb-popover input::placeholder { color:#5f6b7b; opacity:1; }
.language-popover { width:180px; padding:7px; }
.language-item { width:100%; border:0; background:transparent; text-align:left; padding:10px; border-radius:9px; cursor:pointer; color:#334155; }
.language-item:hover,.language-item.active { background:#eef4ff; color:var(--lb-blue); }
.search-results { max-height:260px; overflow:auto; margin-top:9px; }
.search-result { display:block; padding:9px; border-radius:9px; text-decoration:none; color:#172033; }
.search-result:hover { background:#f3f6fa; }
.search-result strong,.search-result small { display:block; }
.search-result small { color:#667085; margin-top:2px; }

.lb-hero { position:relative; overflow:hidden; background:linear-gradient(135deg,#f7faff 0%,#fff 52%,#eef4ff 100%); border-bottom:1px solid var(--lb-line); }
.lb-hero:before { content:""; position:absolute; width:520px; height:520px; border-radius:50%; background:rgba(11,92,255,.08); filter:blur(2px); right:-180px; top:-240px; }
.lb-hero-grid { min-height:640px; display:grid; grid-template-columns:1.05fr .95fr; align-items:center; gap:60px; position:relative; }
.lb-hero-copy { padding:70px 0; }
.lb-eyebrow,.lb-kicker { margin:0; color:var(--lb-blue); font-size:.76rem; font-weight:850; text-transform:uppercase; letter-spacing:.13em; }
.lb-live-dot { display:inline-block; width:8px; height:8px; margin-right:7px; border-radius:50%; background:#20b26b; box-shadow:0 0 0 5px rgba(32,178,107,.1); }
.lb-hero h1 { margin:18px 0 20px; max-width:760px; font-size:clamp(3rem,6vw,5.4rem); line-height:.98; letter-spacing:-.065em; font-weight:900; color:#0b1220; }
.lb-hero h1 span { color:var(--lb-blue); }
.lb-hero-lead { max-width:650px; margin:0; color:#596579; font-size:1.08rem; line-height:1.75; }
.lb-hero-actions { display:flex; flex-wrap:wrap; gap:11px; margin-top:30px; }
.lb-btn { min-height:48px; padding:0 19px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center; gap:10px; text-decoration:none; font-weight:750; font-size:.92rem; transition:.2s ease; }
.lb-btn-primary { color:#fff; background:var(--lb-blue); box-shadow:0 10px 25px rgba(11,92,255,.2); }
.lb-btn-primary:hover { background:var(--lb-blue-dark); transform:translateY(-1px); }
.lb-btn-ghost { color:#1d2939; background:#fff; border:1px solid #d9e0e9; }
.lb-btn-ghost:hover { border-color:#aeb9c9; background:#f8fafc; }
.lb-trust-row { display:flex; flex-wrap:wrap; gap:16px; margin-top:28px; color:#5f6b7b; font-size:.82rem; font-weight:650; }

.lb-hero-map { min-height:470px; position:relative; display:grid; place-items:center; }
.lb-orbit { position:absolute; border:1px solid rgba(11,92,255,.12); border-radius:50%; }
.lb-orbit-one { width:390px; height:390px; }
.lb-orbit-two { width:280px; height:280px; border-style:dashed; }
.lb-center-card { width:180px; height:180px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; border:1px solid rgba(11,92,255,.13); border-radius:28px; background:rgba(255,255,255,.9); box-shadow:0 25px 70px rgba(34,73,140,.12); position:relative; z-index:2; }
.lb-center-icon { font-size:40px; }
.lb-center-card strong { margin-top:9px; font-size:.96rem; }
.lb-center-card small { margin-top:4px; color:#5f6b7b; font-size:.72rem; }
.lb-country-float { position:absolute; z-index:3; display:flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid #dfe6f0; border-radius:13px; background:#fff; box-shadow:0 12px 35px rgba(34,73,140,.1); color:#1d2939; text-decoration:none; font-size:.78rem; font-weight:750; transition:.2s ease; }
.lb-country-float:hover { transform:translateY(-3px); border-color:#b8cdfc; }
.float-ma { top:13%; left:8%; } .float-fr { top:17%; right:7%; } .float-dz { bottom:15%; left:8%; } .float-tn { bottom:13%; right:8%; }

.lb-section { padding:92px 0; }
.lb-section-white { background:#fff; }
.lb-section-tint { background:#f6f8fc; border-block:1px solid #e9edf3; }
.lb-section-head { display:flex; align-items:end; justify-content:space-between; gap:35px; margin-bottom:34px; }
.lb-section-head h2 { margin:8px 0 0; font-size:clamp(1.9rem,3.4vw,3rem); line-height:1.05; letter-spacing:-.045em; }
.lb-section-head > p { max-width:430px; margin:0; color:#5f6b7b; line-height:1.65; font-size:.93rem; }
.lb-country-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:13px; }
.lb-country-card { min-height:170px; padding:22px; display:flex; align-items:flex-start; gap:14px; border:1px solid var(--lb-line); border-radius:18px; color:var(--lb-ink); text-decoration:none; background:#fff; position:relative; transition:.2s ease; }
.lb-country-card:hover { transform:translateY(-4px); border-color:#b9cdfa; box-shadow:0 18px 45px rgba(34,73,140,.09); }
.lb-country-flag { font-size:30px; }
.lb-country-card span:nth-child(2) { display:flex; flex-direction:column; min-width:0; }
.lb-country-card small { color:#5f6b7b; font-size:.68rem; font-weight:800; letter-spacing:.1em; }
.lb-country-card strong { margin-top:4px; font-size:1.15rem; }
.lb-country-card em { margin-top:8px; color:#5f6b7b; font-size:.76rem; line-height:1.45; font-style:normal; }
.lb-country-card i { margin-left:auto; color:#5f6b7b; font-style:normal; font-size:1.1rem; }

.lb-explorer { padding:26px; border:1px solid #dfe5ee; border-radius:24px; background:#fff; box-shadow:0 20px 60px rgba(15,23,42,.06); }
.lb-explorer-top { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.lb-mini-label { color:#5f6b7b; font-size:.7rem; text-transform:uppercase; letter-spacing:.1em; font-weight:800; }
.lb-explorer h3 { margin:5px 0 0; font-size:1.35rem; }
.lb-reset { border:1px solid #d8e0ea; background:#fff; border-radius:9px; padding:8px 12px; color:#475467; cursor:pointer; font-weight:700; }
.lb-taxo-countries { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.lb-taxo-countries .taxo-country { width:100%; min-height:58px; border:1px solid #e0e6ee; background:#f9fafb; border-radius:13px; display:flex; align-items:center; gap:10px; padding:10px 13px; color:#344054; cursor:pointer; text-align:left; font-weight:750; }
.lb-taxo-countries .taxo-country:hover,.lb-taxo-countries .taxo-country.taxo-active { border-color:#9dbaf8; background:#eef4ff; color:#0b5cff; }
.lb-taxo-countries .taxo-flag { font-size:22px; }
.lb-taxo-countries .taxo-carat { margin-left:auto; }
.lb-taxo-crumbs { min-height:43px; margin:14px 0; display:flex; align-items:center; gap:8px; font-size:.8rem; color:#5f6b7b; }
.lb-taxo-levels { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.lb-taxo-levels .taxo-level { min-height:150px; padding:17px; display:flex; align-items:flex-end; justify-content:space-between; border:1px solid #e1e6ed; border-radius:15px; color:#172033; text-decoration:none; background:#fff; transition:.2s ease; animation:lb-rise .35s both; animation-delay:var(--delay,0ms); }
.lb-taxo-levels .taxo-level:hover { transform:translateY(-3px); border-color:#9dbaf8; box-shadow:0 12px 30px rgba(34,73,140,.08); }
.lb-taxo-levels .taxo-level > span:first-child { display:flex; flex-direction:column; gap:4px; }
.lb-taxo-levels .taxo-step { color:#5f6b7b; font-size:.68rem; font-weight:800; }
.lb-taxo-levels .taxo-level strong { font-size:1rem; }
.lb-taxo-levels .taxo-level em { color:#5f6b7b; font-size:.72rem; font-style:normal; }
.lb-taxo-levels .taxo-action { margin-top:10px; color:var(--lb-blue); font-weight:750; }
.lb-taxo-levels .taxo-carat { align-self:center; color:#5f6b7b; }
@keyframes lb-rise { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.lb-steps { display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid var(--lb-line); }
.lb-steps article { padding:28px 25px 12px 0; display:flex; gap:18px; border-right:1px solid var(--lb-line); }
.lb-steps article:not(:first-child) { padding-left:25px; }
.lb-steps article:last-child { border-right:0; }
.lb-steps article > span { color:#5f6b7b; font-size:.76rem; font-weight:850; }
.lb-steps h3 { margin:0 0 7px; font-size:1rem; }
.lb-steps p { margin:0; color:#5f6b7b; font-size:.84rem; line-height:1.65; }
.lb-resource-strip { padding:58px 0; background:#0d1728; color:#fff; }
.lb-resource-inner { display:flex; align-items:center; justify-content:space-between; gap:35px; }
.lb-resource-strip .lb-kicker { color:#8eb1ff; }
.lb-resource-strip h2 { margin:8px 0 0; font-size:clamp(1.5rem,3vw,2.2rem); letter-spacing:-.035em; }
.lb-resource-pills { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:9px; }
.lb-resource-pills span { padding:10px 13px; border:1px solid rgba(255,255,255,.13); border-radius:10px; background:rgba(255,255,255,.06); color:#d8e1ef; font-size:.78rem; font-weight:700; }

.lb-footer { background:#f8fafc; color:#596579; }
.lb-footer-grid { padding:55px 0; display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:40px; }
.lb-footer-grid > div { display:flex; flex-direction:column; align-items:flex-start; gap:9px; }
.lb-footer-grid .lb-brand { margin-bottom:6px; }
.lb-footer-grid p { margin:0; max-width:260px; font-size:.8rem; line-height:1.6; }
.lb-footer-grid strong { color:#1d2939; font-size:.8rem; margin-bottom:3px; }
.lb-footer-grid a:not(.lb-brand) { color:#5f6b7b; text-decoration:none; font-size:.8rem; }
.lb-footer-grid a:not(.lb-brand):hover { color:var(--lb-blue); }
.lb-footer-bottom { border-top:1px solid #e4e8ee; }
.lb-footer-bottom .lb-container { min-height:52px; display:flex; align-items:center; justify-content:space-between; gap:20px; color:#5f6b7b; font-size:.72rem; }

.lb-sidebar { position:fixed; z-index:90; inset:0 auto 0 0; width:min(330px,88vw); background:#fff; box-shadow:20px 0 60px rgba(15,23,42,.18); transform:translateX(-105%); transition:transform .25s ease; overflow:auto; padding:20px; }
.sidebar-open .lb-sidebar { transform:none; }
.lb-sidebar-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.lb-sidebar nav { display:flex; flex-direction:column; gap:4px; }
.lb-sidebar nav a { padding:12px 11px; border-radius:10px; text-decoration:none; color:#344054; font-weight:650; }
.lb-sidebar nav a:hover { background:#f1f5f9; color:var(--lb-blue); }
.lb-sidebar hr { width:100%; border:0; border-top:1px solid #e6eaf0; margin:10px 0; }
.site-backdrop { position:fixed; z-index:85; inset:0; background:rgba(15,23,42,.48); }
body.sidebar-open .site-backdrop { display:block; }

.dark-mode body { background:#0b1220; color:#e8edf5; }
.dark-mode .lb-header { background:rgba(11,18,32,.9); border-color:#202b3d; }
.dark-mode .lb-brand,.dark-mode .lb-desktop-nav a,.dark-mode .lb-icon-btn { color:#e8edf5; }
.dark-mode .lb-desktop-nav a:hover { color:#8eb1ff; }
.dark-mode .lb-icon-btn:hover { background:#172235; }
.dark-mode .lb-hero { background:linear-gradient(135deg,#0b1220,#101a2c 55%,#0c1932); border-color:#202b3d; }
.dark-mode .lb-hero h1 { color:#f8fafc; }
.dark-mode .lb-hero-lead,.dark-mode .lb-section-head > p { color:#aeb9c8; }
.dark-mode .lb-btn-ghost,.dark-mode .lb-center-card,.dark-mode .lb-country-float,.dark-mode .lb-country-card,.dark-mode .lb-explorer,.dark-mode .lb-taxo-levels .taxo-level,.dark-mode .lb-popover { background:#111b2d; border-color:#26344a; color:#e8edf5; }
.dark-mode .lb-country-card em,.dark-mode .lb-steps p { color:#9aa8ba; }
.dark-mode .lb-section-white { background:#0b1220; }
.dark-mode .lb-section-tint { background:#0e1727; border-color:#202b3d; }
.dark-mode .lb-taxo-countries .taxo-country { background:#101a2b; border-color:#26344a; color:#d7dfeb; }
.dark-mode .lb-taxo-countries .taxo-country:hover,.dark-mode .lb-taxo-countries .taxo-country.taxo-active { background:#12244b; border-color:#315aa6; color:#a9c3ff; }
.dark-mode .lb-taxo-crumbs { color:#8997ab; }
.dark-mode .lb-steps,.dark-mode .lb-steps article { border-color:#202b3d; }
.dark-mode .lb-footer { background:#080e18; }
.dark-mode .lb-footer-grid strong { color:#e8edf5; }
.dark-mode .lb-footer-grid a:not(.lb-brand),.dark-mode .lb-footer-grid p { color:#8997ab; }
.dark-mode .lb-footer-bottom { border-color:#202b3d; }
.dark-mode .lb-sidebar { background:#0d1728; }
.dark-mode .lb-sidebar nav a { color:#dce4ef; }
.dark-mode .lb-sidebar nav a:hover { background:#172235; }
.dark-mode .lb-sidebar hr { border-color:#26344a; }

@media (max-width:900px) {
  .lb-desktop-nav { display:none; }
  .lb-menu-btn { display:grid; }
  .lb-hero-grid { grid-template-columns:1fr; min-height:auto; gap:10px; }
  .lb-hero-copy { padding:70px 0 30px; }
  .lb-hero-map { min-height:400px; margin-bottom:45px; }
  .lb-country-grid { grid-template-columns:repeat(2,1fr); }
  .lb-taxo-levels { grid-template-columns:repeat(2,1fr); }
  .lb-steps { grid-template-columns:1fr; }
  .lb-steps article,.lb-steps article:not(:first-child) { padding:22px 0; border-right:0; border-bottom:1px solid var(--lb-line); }
  .lb-steps article:last-child { border-bottom:0; }
  .lb-resource-inner { flex-direction:column; align-items:flex-start; }
  .lb-resource-pills { justify-content:flex-start; }
  .lb-footer-grid { grid-template-columns:2fr 1fr 1fr; }
}
@media (max-width:620px) {\n  #search-dropdown { position:fixed; top:64px; left:12px; right:12px; width:auto; max-width:none; }
  .lb-container,.lb-header-inner { width:min(100% - 28px,1160px); }
  .lb-header-inner { min-height:64px; }
  .lb-brand { font-size:1.08rem; }
  .lb-brand-icon { width:30px; height:30px; font-size:16px; }
  .lb-actions { margin-left:auto; }
  .lb-icon-btn { width:36px; height:36px; }
  .lb-hero h1 { font-size:clamp(2.55rem,13vw,4rem); }
  .lb-hero-lead { font-size:.98rem; }
  .lb-trust-row { gap:9px 13px; font-size:.72rem; }
  .lb-orbit-one { width:290px; height:290px; } .lb-orbit-two { width:215px; height:215px; }
  .lb-center-card { width:145px; height:145px; }
  .lb-center-icon { font-size:30px; }
  .lb-country-float { padding:7px 9px; font-size:.7rem; }
  .float-ma { left:0; } .float-fr { right:0; } .float-dz { left:0; } .float-tn { right:0; }
  .lb-section { padding:64px 0; }
  .lb-section-head { display:block; margin-bottom:24px; }
  .lb-section-head > p { margin-top:14px; }
  .lb-country-grid,.lb-taxo-countries,.lb-taxo-levels { grid-template-columns:1fr; }
  .lb-country-card { min-height:135px; }
  .lb-explorer { padding:17px; }
  .lb-taxo-levels .taxo-level { min-height:120px; }
  .lb-footer-grid { grid-template-columns:1fr 1fr; gap:28px 20px; }
  .lb-footer-grid > div:first-child { grid-column:1 / -1; }
  .lb-footer-bottom .lb-container { min-height:65px; flex-direction:column; justify-content:center; align-items:flex-start; gap:4px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .lb-btn,.lb-country-card,.lb-country-float,.lb-taxo-levels .taxo-level { transition:none; animation:none; }
}


/* ---------- Homepage RTL hardening ---------- */
[dir="rtl"] .lb-desktop-nav {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .lb-actions {
  margin-left: 0;
  margin-right: 10px;
}
[dir="rtl"] .lb-popover {
  right: auto;
  left: 0;
}
[dir="rtl"] .language-item {
  text-align: right;
}
[dir="rtl"] .lb-country-card i {
  margin-left: 0;
  margin-right: auto;
  transform: scaleX(-1);
}
[dir="rtl"] .lb-taxo-countries .taxo-country {
  text-align: right;
}
[dir="rtl"] .lb-taxo-countries .taxo-carat {
  margin-left: 0;
  margin-right: auto;
  transform: scaleX(-1);
}
[dir="rtl"] .lb-taxo-levels .taxo-carat {
  transform: scaleX(-1);
}
[dir="rtl"] .lb-sidebar {
  inset: 0 0 0 auto;
  transform: translateX(105%);
  box-shadow: -20px 0 60px rgba(15,23,42,.18);
}
[dir="rtl"] .sidebar-open .lb-sidebar {
  transform: none;
}
[dir="rtl"] .lb-steps article {
  border-right: 0;
  border-left: 1px solid var(--lb-line);
}
[dir="rtl"] .lb-steps article:not(:first-child) {
  padding-left: 0;
  padding-right: 25px;
}
[dir="rtl"] .lb-steps article:last-child {
  border-left: 0;
}
@media (max-width:900px) {
  [dir="rtl"] .lb-steps article,
  [dir="rtl"] .lb-steps article:not(:first-child) {
    padding-left: 0;
    padding-right: 0;
    border-left: 0;
  }
}


/* ---------- Taxonomy header hardening ---------- */
.site-nav > nav { display:flex; align-items:center; justify-content:space-between; width:100%; }
.site-nav .nav-actions { display:flex; align-items:center; flex-direction:row; }
.site-nav .relative { position:relative; }
.site-nav .w-full { width:100%; }
.site-nav .icon-button { flex:0 0 42px; }
@media (max-width:620px) {
  .site-nav .nav-actions { gap:.15rem; }
  .site-nav .icon-button { flex-basis:38px; width:38px; height:38px; }
}


/* RTL taxonomy polish */
[dir="rtl"] .site-nav .nav-actions { flex-direction:row; }
[dir="rtl"] .dropdown { inset-inline-end:0; }
[dir="rtl"] .language-item { text-align:right; }
[dir="rtl"] .taxonomy-card-arrow, [dir="rtl"] .country-card-arrow { transform:scaleX(-1); }
[dir="rtl"] .taxonomy-card:hover .taxonomy-card-arrow { transform:scaleX(-1) translateX(4px); }
[dir="rtl"] .lb-brand, [dir="rtl"] .brand { direction:ltr; }


/* ---------- 14. Responsive header + viewport-safe search hardening ---------- */

/* Desktop header uses a three-zone grid so actions stay at the logical edge:
   LTR = right, RTL = left. No absolute/fixed positioning is used for the buttons. */
@media (min-width: 901px) {
  .lb-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .lb-brand {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
  }

  .lb-desktop-nav {
    grid-column: 2;
    justify-self: center;
    margin: 0;
  }

  .lb-actions {
    grid-column: 3;
    justify-self: end;
    margin: 0;
    min-width: 0;
  }

  [dir="rtl"] .lb-brand { grid-column: 1; justify-self: start; }
  [dir="rtl"] .lb-desktop-nav { grid-column: 2; justify-self: center; margin: 0; }
  [dir="rtl"] .lb-actions { grid-column: 3; justify-self: end; margin: 0; }
}

/* The logo is the asset itself. Remove the decorative tile/container behind it. */
.lb-brand-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: block;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.lb-brand-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

/* Search is positioned by JS against the real viewport. These rules prevent
   the old right:-/left:- drift from reappearing before JS runs. */
#search-dropdown {
  box-sizing: border-box;
  right: auto;
  left: auto;
  max-width: none;
  overflow: hidden;
}

#search-dropdown .search-results {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 620px) {
  .lb-brand-icon,
  .lb-brand-icon img {
    width: 32px;
    height: 32px;
  }

  .lb-brand-icon {
    flex-basis: 32px;
  }

  #search-dropdown {
    width: auto;
  }
}
