/* --------------------
   THÈME GLOBAL NOCTYRA
--------------------- */

:root {
  --bg-main: #020617;           /* noir / bleu nuit */
  --bg-elevated: rgba(15, 23, 42, 0.9);
  --border-soft: rgba(148, 163, 184, 0.5);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent-blue: #38bdf8;
  --accent-violet: #8b5cf6;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.9);
  --radius-lg: 1.5rem;
  --radius-full: 999px;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 65%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.15), transparent 65%),
    var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* --------------------
   LAYOUT
--------------------- */

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

main {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

/* --------------------
   HEADER + LOGO CERF
--------------------- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;     /* ⬅ espace au-dessus du logo + menu */
  padding-bottom: 1.4rem;  /* un peu plus d’air en bas aussi */
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav.main-nav {
  margin-top: 0rem;   /* décale le menu vers le bas */
}

.brand-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 0%, rgba(56, 189, 248, 0.4), transparent 60%),
    radial-gradient(circle at 70% 120%, rgba(139, 92, 246, 0.5), transparent 60%),
    rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.35);
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



.brand-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------
   NAVIGATION (DESKTOP PAR DÉFAUT)
--------------------- */

nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 0.8rem;   /* 🔹 espace clair au-dessus du rang de boutons */
}

nav.main-nav ul::-webkit-scrollbar {
  display: none;
}

nav.main-nav a {
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.85);  /* Bouton sombre */
  transition: 0.2s ease;
  white-space: nowrap;

  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

nav.main-nav a:hover {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.9),    /* Bleu électrique */
    rgba(139, 92, 246, 0.9)     /* Violet électrique */
  );
  border-color: rgba(56, 189, 248, 0.5);
  color: #020617;
  box-shadow: none;             /* ⬅ plus aucun halo */
}

nav.main-nav a.active {
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.9),
    rgba(139, 92, 246, 0.9)
  );
  border-color: rgba(56, 189, 248, 0.5);
  color: #020617;
  box-shadow: none;             /* ⬅ pas de halo non plus sur l’onglet actif */
  font-weight: 600;
}

/* --------------------
   FIL D’ARIANE
--------------------- */

.breadcrumb {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  list-style: none;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.breadcrumb li::after {
  content: "›";
  margin-left: 0.35rem;
  color: #6b7280;
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: var(--text-main);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* --------------------
   CARTES / SECTIONS
--------------------- */

.section-card {
  background: linear-gradient(
      145deg,
      rgba(15, 23, 42, 0.95),
      rgba(15, 23, 42, 0.98)
    );
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 1.6rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.1), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
}

.section-inner {
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

/* --------------------
   GRILLES
--------------------- */

.grid {
  display: grid;
  gap: 1.2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------
   TAGS
--------------------- */

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.9);
  margin: 0.15rem 0.3rem 0.15rem 0;
}

/* --------------------
   GALERIE PHOTOS
--------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.1), transparent 55%);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.88);
}

/* --------------------
   FOOTER
--------------------- */

footer {
  margin-top: 2rem;
  padding: 1.2rem 0 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* --------------------
   RESPONSIVE MOBILE
--------------------- */

@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  .wrapper {
    padding: 1rem;
    max-width: 100%;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .brand-text h1 {
    font-size: 1.3rem;
  }

  /* NAVIGATION EN MODE "BOUTONS" SUR 2 LIGNES */
  nav.main-nav {
    width: 100%;
  }

  nav.main-nav ul {
    flex-wrap: wrap;           /* on permet 2 lignes */
    justify-content: flex-start;
    gap: 0.35rem;
  }

  nav.main-nav li {
    flex: 1 1 48%;             /* environ 2 onglets par ligne */
  }

  nav.main-nav a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    white-space: normal;       /* "Agents autonomes" peut passer sur 2 lignes proprement */
  }

  .section-card {
    padding: 1.2rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .gallery-item img {
    height: 180px;
  }
}
