/* ============================================
   NĀGA Geophysics — Feuille de style commune
   Charte graphique officielle
   ============================================ */

:root {
  /* Charte NAGA */
  --naga-navy: #1B3A6B;
  --naga-navy-deep: #0F2547;
  --naga-navy-light: #2D5494;

  /* Couleurs sectorielles (issues des sous-logos) */
  --hydro-blue: #6BA4D9;
  --geohazards-orange: #D9532B;
  --geothermal-ochre: #B8884A;
  --software-orange: #E8893B;
  --petro-green: #7BAA4F;

  /* Neutres */
  --paper: #FAFBFC;
  --paper-warm: #F5F3EE;
  --ink: #0A1628;
  --ink-soft: #475569;
  --line: #E2E5EB;
  --line-soft: #EFF1F4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

/* Lignes topographiques en arrière-plan */
.topo-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800'%3E%3Cg fill='none' stroke='%231B3A6B' stroke-width='0.5' opacity='0.15'%3E%3Cpath d='M0,400 Q300,350 600,400 T1200,400'/%3E%3Cpath d='M0,420 Q300,370 600,420 T1200,420'/%3E%3Cpath d='M0,440 Q300,390 600,440 T1200,440'/%3E%3Cpath d='M0,460 Q300,410 600,460 T1200,460'/%3E%3Cpath d='M0,380 Q300,330 600,380 T1200,380'/%3E%3Cpath d='M0,360 Q300,310 600,360 T1200,360'/%3E%3Cpath d='M0,340 Q300,290 600,340 T1200,340'/%3E%3Cpath d='M0,500 Q300,450 600,500 T1200,500'/%3E%3Cpath d='M0,540 Q300,490 600,540 T1200,540'/%3E%3Cpath d='M0,580 Q300,530 600,580 T1200,580'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

/* ============ HEADER ============ */
header {
  position: sticky;
  top: 0;
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  padding: 16px 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 56px;
  width: auto;
  display: block;
}

nav ul {
  display: flex;
  gap: 38px;
  list-style: none;
  align-items: center;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

nav a:hover, nav a.active { color: var(--naga-navy); }

nav a:not(.cta-btn)::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--naga-navy);
  transition: width 0.3s ease;
}

nav a:not(.cta-btn):hover::after,
nav a.active::after { width: 100%; }

.cta-btn {
  background: var(--naga-navy);
  color: white !important;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 0.04em;
  font-weight: 700;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  background: var(--naga-navy-deep);
  transform: translateY(-1px);
}

/* ============ SÉLECTEUR DE LANGUE ============ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--paper-warm);
  border-radius: 30px;
  padding: 3px;
  border: 1px solid var(--line);
  margin-right: 10px;
}

.lang-switcher a {
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink-soft) !important;
  border-radius: 20px;
  transition: all 0.25s ease;
}

.lang-switcher a::after { display: none !important; }

.lang-switcher a:hover {
  color: var(--naga-navy) !important;
  background: rgba(255,255,255,0.5);
}

.lang-switcher a.lang-active {
  background: var(--naga-navy);
  color: white !important;
}

@media (max-width: 968px) {
  .lang-switcher { margin-right: 0; margin-left: auto; }
}

/* ============ HEADINGS ============ */
h1, h2, h3, h4 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--naga-navy-deep);
}

h1 { font-size: clamp(42px, 6vw, 80px); line-height: 1.05; }
h2 { font-size: clamp(34px, 4.5vw, 52px); line-height: 1.1; }
h3 { font-size: 24px; line-height: 1.25; }
h4 { font-size: 17px; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--naga-navy);
  font-weight: 800;
  margin-bottom: 24px;
}

.section-eyebrow::before {
  content: '';
  width: 36px;
  height: 2px;
  background: var(--naga-navy);
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary {
  padding: 16px 32px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
}

.btn-primary {
  background: var(--naga-navy);
  color: white;
}
.btn-primary:hover {
  background: var(--naga-navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(27,58,107,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--naga-navy);
  border: 2px solid var(--naga-navy);
}
.btn-secondary:hover {
  background: var(--naga-navy);
  color: white;
}

.arrow { transition: transform 0.3s; }
.btn-primary:hover .arrow,
.btn-secondary:hover .arrow { transform: translateX(4px); }

/* ============ PAGE HEADER (pages internes) ============ */
.page-header {
  padding: 100px 0 80px;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.page-header h1 {
  font-size: clamp(38px, 5vw, 64px);
  max-width: 900px;
}

.page-header .lead {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 700px;
  margin-top: 24px;
  line-height: 1.6;
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 30px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.breadcrumb a { color: var(--naga-navy); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 10px; color: var(--line); }

/* ============ FOOTER ============ */
footer {
  background: var(--naga-navy-deep);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 30px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand img {
  height: 64px;
  filter: brightness(0) invert(1);
  margin-bottom: 20px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 360px;
}

.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 22px;
  font-weight: 800;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s;
}
.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  margin-left: 20px;
}
.footer-bottom a:hover { color: white; }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
  .container { padding: 0 24px; }
  nav ul { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .page-header { padding: 60px 0 50px; }
}

/* ============================================================
   PAGES DE DÉTAIL — EXPERTISES & PROJETS
   ============================================================ */

/* Hero de page détail */
.detail-hero {
  padding: 80px 0 60px;
  background: var(--paper-warm);
  position: relative;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 80px;
  align-items: center;
}

.detail-hero-logo {
  height: 200px;
  width: auto;
  display: block;
  margin-bottom: 30px;
}

.detail-hero h1 {
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.05;
  margin-bottom: 20px;
}

.detail-hero h1 .accent {
  font-weight: 300;
  font-style: italic;
}

.detail-hero-lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 30px;
  max-width: 700px;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.meta-pill {
  padding: 8px 18px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  color: var(--naga-navy);
  letter-spacing: 0.03em;
}

/* Sections de détail */
.detail-section {
  padding: 90px 0;
}

.detail-section.alt {
  background: var(--paper-warm);
}

.detail-section.dark {
  background: var(--naga-navy-deep);
  color: white;
}

.detail-section.dark h2 { color: white; }
.detail-section.dark h2 .accent { color: var(--hydro-blue); }
.detail-section.dark .section-eyebrow { color: var(--hydro-blue); }
.detail-section.dark .section-eyebrow::before { background: var(--hydro-blue); }
.detail-section.dark p { color: rgba(255,255,255,0.85); }

/* Études de cas */
.case-study {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
  margin-bottom: 100px;
}

.case-study:last-child { margin-bottom: 0; }

.case-study.reverse {
  grid-template-columns: 1fr 1fr;
}

.case-study.reverse .case-visual { order: 2; }

.case-visual {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--naga-navy) 0%, var(--naga-navy-deep) 100%);
  box-shadow: 0 20px 60px -20px rgba(15,37,71,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.case-visual svg {
  width: 92%;
  height: 92%;
}

.case-content .case-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--paper);
  border: 1.5px solid var(--accent, var(--naga-navy));
  border-radius: 30px;
  color: var(--accent, var(--naga-navy));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.case-content h3 {
  font-size: 28px;
  margin-bottom: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.case-content p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.case-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-meta-item .lbl {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
  margin-bottom: 4px;
  display: block;
}

.case-meta-item .val {
  font-size: 14px;
  color: var(--naga-navy-deep);
  font-weight: 700;
}

/* Image gallery pour les projets */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 50px 0;
}

.gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--naga-navy) 0%, var(--naga-navy-deep) 100%);
  box-shadow: 0 12px 24px -12px rgba(15,37,71,0.2);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover { transform: translateY(-4px); }
.gallery-item svg { width: 88%; height: 88%; }
.gallery-item.tall { aspect-ratio: 1 / 1; }
.gallery-item.wide { grid-column: span 2; aspect-ratio: 16 / 9; }

/* Timeline projet */
.project-timeline {
  display: grid;
  gap: 30px;
  margin-top: 40px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 30px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--naga-navy);
  text-transform: uppercase;
  padding-top: 4px;
}

.timeline-content h4 {
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 800;
}

.timeline-content p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

/* Stats clés du projet */
.project-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin: 50px 0;
  padding: 40px;
  background: var(--paper);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.detail-section.dark .project-stats {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

.project-stat {
  text-align: center;
}

.project-stat .num {
  font-size: 42px;
  font-weight: 800;
  color: var(--naga-navy);
  line-height: 1;
  letter-spacing: -0.02em;
}

.detail-section.dark .project-stat .num { color: var(--hydro-blue); }

.project-stat .lbl {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 8px;
}

.detail-section.dark .project-stat .lbl { color: rgba(255,255,255,0.7); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--naga-navy);
  text-decoration: none;
  text-transform: uppercase;
  margin-bottom: 24px;
  transition: gap 0.3s ease;
}

.back-link:hover { gap: 14px; }
.back-link::before { content: '←'; }

/* Responsive */
@media (max-width: 968px) {
  .detail-hero-grid,
  .case-study,
  .case-study.reverse { grid-template-columns: 1fr; gap: 40px; }
  .case-study.reverse .case-visual { order: 0; }
  .detail-hero { padding: 50px 0 40px; }
  .detail-section { padding: 60px 0; }
  .project-gallery { grid-template-columns: 1fr; }
  .gallery-item.wide { grid-column: span 1; }
  .project-stats { grid-template-columns: repeat(2, 1fr); padding: 24px; gap: 20px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

/* ===================================================
   SUPPORT ARABE (RTL — Right to Left)
   Activé automatiquement avec <html dir="rtl">
   =================================================== */

[dir="rtl"] body {
  font-family: 'Cairo', 'Nunito', sans-serif;
  text-align: right;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  font-family: 'Cairo', 'Nunito', sans-serif;
}

/* Inverser certains layouts */
[dir="rtl"] .hero-grid,
[dir="rtl"] .footer-grid,
[dir="rtl"] .project-content-grid,
[dir="rtl"] .contact-grid,
[dir="rtl"] .figures-grid,
[dir="rtl"] .studies-grid,
[dir="rtl"] .gallery-grid,
[dir="rtl"] .related-grid {
  direction: rtl;
}

/* Garder le contenu numérique en LTR si nécessaire */
[dir="rtl"] .figure-num,
[dir="rtl"] .meta-val,
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href^="tel:"] {
  direction: ltr;
  text-align: right;
  unicode-bidi: embed;
}

/* Logo & nav */
[dir="rtl"] .logo-link { margin-right: 0; margin-left: auto; }
[dir="rtl"] nav ul { flex-direction: row-reverse; }
[dir="rtl"] .lang-switcher { margin-right: 0; margin-left: 10px; }

/* Flèches : retourner pour RTL */
[dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .breadcrumb .sep { transform: scaleX(-1); display: inline-block; }

/* Boutons */
[dir="rtl"] .btn-primary,
[dir="rtl"] .btn-secondary,
[dir="rtl"] .cta-btn { direction: rtl; }

/* Section eyebrow */
[dir="rtl"] .section-eyebrow::before {
  margin-right: 0;
  margin-left: 12px;
}

/* Study cards : ajustements */
[dir="rtl"] .study-image-badge {
  left: auto;
  right: 20px;
}

[dir="rtl"] .study-card:hover { transform: translateY(-6px); }
[dir="rtl"] .related-card:hover { transform: translateY(-4px); }

[dir="rtl"] .contact-block {
  border-left: none;
  border-right: 4px solid var(--naga-navy);
}

[dir="rtl"] .contact-block:hover { transform: translateX(-4px); }

/* Sidebar list - inverser le contenu */
[dir="rtl"] .sidebar-list li { padding-left: 0; padding-right: 0; }

/* Project body lists - inverser le tiret */
[dir="rtl"] .project-body ul li {
  padding-left: 0;
  padding-right: 28px;
}

[dir="rtl"] .project-body ul li::before {
  left: auto;
  right: 0;
}

/* FAQ summary */
[dir="rtl"] .faq-item summary {
  direction: rtl;
}

/* Form */
[dir="rtl"] .form-group input,
[dir="rtl"] .form-group select,
[dir="rtl"] .form-group textarea { text-align: right; direction: rtl; }

[dir="rtl"] .form-group select {
  background-position: left 16px center;
  padding-right: 16px;
  padding-left: 40px;
}

[dir="rtl"] .form-checkbox { direction: rtl; }
[dir="rtl"] .form-checkbox input { margin-top: 3px; }

/* Footer bottom : inverser légèrement */
[dir="rtl"] .footer-bottom { direction: rtl; }

/* Topo background : pas de changement nécessaire */

/* Nav mobile : ajuster */
@media (max-width: 968px) {
  [dir="rtl"] .lang-switcher { margin-left: 0; margin-right: auto; }
}

