/* ============================================================
   STYLES COMMUNS — Menu principal, footer, langues
   Utilisé par toutes les pages du site Narjiss
   ============================================================ */

:root {
  --ocean: #00AEEF;
  --ocean-deep: #008CC8;
  --sun: #C15A00;
  --sun-light: #FFB020;
  --sand: #F3F6FA;
  --sand-dark: #D5DCE6;
  --white: #FFFFFF;
  --charcoal: #1F2430;
  --text: #2A2D38;
  --muted: #596273;
  --shadow: 0 4px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 50px rgba(0, 0, 0, .12);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html[dir=rtl] body { font-family: 'Noto Sans Arabic', 'Outfit', sans-serif; }

/* ===== MENU PRINCIPAL ===== */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(17, 24, 39, .12);
  box-shadow: 0 1px 8px rgba(17, 24, 39, .08);
}
/* Add padding to body to compensate for fixed menu */
body {
  padding-top: 68px;
}
@media (max-width: 768px) {
  body { padding-top: 64px; }
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: .7rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo + nom */
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 700;
}
.nav-brand .logo {
  width: 46px;
  height: 46px;
  min-width: 46px;
  max-width: 46px;
  border-radius: 8px;
  background: var(--ocean);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: white;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.nav-brand .logo.logo-image {
  background: white;
  padding: 3px;
}
.nav-brand .logo img {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 5px;
}
.nav-brand .brand-name {
  font-family: 'Outfit', 'Montserrat', 'Arial', sans-serif;
  font-size: 1.02rem;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1;
}
html[dir=rtl] .nav-brand .brand-name { font-family: 'Outfit', 'Noto Sans Arabic', sans-serif; }
.nav-brand .brand-tag {
  font-size: .65rem;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 1px;
}
.nav-project-label {
  min-width: 0;
  max-width: 320px;
  padding-left: 1rem;
  border-left: 1px solid rgba(17, 24, 39, .14);
  color: var(--sun);
  font-family: 'Playfair Display', serif;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[dir=rtl] .nav-project-label {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 1px solid rgba(17, 24, 39, .14);
  font-family: 'Noto Sans Arabic', 'Outfit', sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
}

/* Liens du menu */
.nav-links {
  display: flex;
  gap: .3rem;
  list-style: none;
  margin-left: auto;
}
html[dir=rtl] .nav-links { margin-left: 0; margin-right: auto; }
.nav-links a {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #303744;
  text-decoration: none;
  padding: .5rem .95rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 700;
  transition: all .2s;
}
.nav-links a:hover {
  background: rgba(0, 174, 239, .1);
  color: var(--ocean);
}
.nav-links a.active {
  background: var(--ocean);
  color: white;
}

/* Sélecteur de langue */
.nav-langs {
  display: flex;
  gap: .25rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(17, 24, 39, .12);
}
html[dir=rtl] .nav-langs {
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 1px solid rgba(17, 24, 39, .12);
}
.lang-btn {
  background: transparent;
  border: 1px solid rgba(17, 24, 39, .14);
  color: #596273;
  min-width: 42px;
  min-height: 38px;
  padding: .34rem .7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  transition: all .2s;
}
.lang-btn:hover {
  background: rgba(0, 174, 239, .1);
  color: var(--ocean);
}
.lang-btn.active {
  background: var(--ocean);
  color: white;
  border-color: var(--ocean);
}

/* Menu mobile */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--charcoal);
  font-size: 1.3rem;
  cursor: pointer;
  margin-left: auto;
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-project-label {
    max-width: min(38vw, 190px);
    padding-left: .75rem;
    font-size: 1.02rem;
  }
  html[dir=rtl] .nav-project-label { padding-right: .75rem; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: .8rem;
    gap: 0;
    margin: 0;
    display: none;
    border-bottom: 1px solid rgba(17, 24, 39, .12);
  }
  .nav-links.show { display: flex; }
  .nav-links a {
    width: 100%;
    padding: .7rem 1rem;
  }
  .nav-langs {
    padding: .5rem 0 0;
    margin-top: .5rem;
    border-left: none;
    border-top: 1px solid rgba(17, 24, 39, .12);
    justify-content: center;
  }
  html[dir=rtl] .nav-langs {
    padding: .5rem 0 0;
    border-right: none;
    border-top: 1px solid rgba(17, 24, 39, .12);
  }
}

/* ===== CONTENU PRINCIPAL ===== */
main { flex: 1; }

/* ===== FOOTER ===== */
.main-footer {
  background: #e7f8ff;
  color: var(--muted);
  padding: 2.5rem 1.5rem 1.2rem;
  margin-top: auto;
  border-top: 1px solid rgba(0, 174, 239, .18);
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
.footer-col h4 {
  color: var(--ocean-deep);
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  margin-bottom: .8rem;
  letter-spacing: .5px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  transition: color .2s;
}
.footer-col a:hover { color: var(--ocean-deep); }
.footer-col p {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer-col .footer-brand {
  font-family: 'Outfit', 'Montserrat', 'Arial', sans-serif;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: .08em;
  color: var(--charcoal);
  margin-bottom: .5rem;
}
.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(0, 174, 239, .18);
  text-align: center;
  font-size: .72rem;
  color: #7a8494;
}

/* ===== UTILITY CLASSES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all .25s;
}

/* ===== LEAFLET Z-INDEX FIX =====
   Make sure Leaflet controls and panels never overlap the main fixed menu */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom { z-index: 400 !important; }
.leaflet-control { z-index: 400 !important; }
.leaflet-popup-pane { z-index: 700 !important; }
.leaflet-tooltip-pane { z-index: 650 !important; }
.leaflet-container { z-index: 1; }
.btn-primary {
  background: var(--ocean);
  color: white;
}
.btn-primary:hover {
  background: var(--ocean-deep);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 174, 239, .26);
}
.btn-secondary {
  background: var(--sun);
  color: white;
}
.btn-secondary:hover {
  background: var(--sun-light);
  transform: translateY(-2px);
}
.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, .3);
  color: white;
}
.btn-outline:hover {
  background: white;
  color: var(--charcoal);
  border-color: white;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: .4rem;
}
html[dir=rtl] .section-title h2 { font-family: 'Noto Sans Arabic', serif; }
.section-title p {
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto;
}
.accent-line {
  width: 45px;
  height: 3px;
  background: var(--ocean);
  margin: 1rem auto 0;
  border-radius: 2px;
}
