/* =========================================================
   layout.css
   Structure de page : en-tête fixe, menu mobile, coquille de
   section, pied de page.
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   1. EN-TÊTE
   ───────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(13, 31, 60, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(184, 146, 46, 0.25);
  transition: box-shadow var(--duration-fast) var(--ease);
}

/* Ajoutée par navigation.js dès que la page défile. */
.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(8, 14, 26, 0.35);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}

/* Le nom doit rester UN seul élément flex : sinon le `gap` de `.nav-logo`
   s'insère aussi de part et d'autre du trait d'union. */
.nav-logo-text {
  white-space: nowrap;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

/* ── Liens (bureau) ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: var(--fs-small);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--duration-fast) var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--gold-light);
}

.nav-cta {
  background: var(--gold);
  color: var(--navy);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background var(--duration-fast) var(--ease);
}

.nav-links .nav-cta:hover,
.nav-links .nav-cta.is-active {
  background: var(--gold-light);
  color: var(--navy);
}

/* ── Bouton hamburger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white);
  transition: transform var(--duration-fast) var(--ease),
    opacity var(--duration-fast) var(--ease);
}

/* Les trois barres se transforment en croix quand le menu est ouvert. */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Menu mobile ──
   L'attribut `hidden` fait foi : fermé, le menu sort du parcours de
   tabulation et de l'arbre d'accessibilité. */
.mobile-menu {
  display: none;
}

.mobile-menu:not([hidden]) {
  display: flex;
  position: fixed;
  inset: var(--nav-height) 0 0;
  z-index: var(--z-menu);
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-xl);
  background: var(--navy);
  overflow-y: auto;
}

.mobile-menu a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.875rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-menu a.cta {
  margin-top: var(--space-md);
  padding: 0.9rem 1.5rem;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-xs);
  font-weight: 600;
  text-align: center;
}

/* Posée sur <body> par navigation.js : bloque le défilement de la page
   derrière le menu ouvert. */
.has-menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-logo {
    font-size: 1.1rem;
  }
}

/* ─────────────────────────────────────────────────────────
   2. SECTIONS
   Une coquille `.section` et ses variantes de surface, au lieu
   d'un style par identifiant.
   ───────────────────────────────────────────────────────── */

.section {
  padding: var(--section-pad);
  background: var(--white);
}

.section--muted {
  background: var(--off-white);
}

.section--dark {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

/* Trame « plan technique » en fond des sections sombres. */
.section--grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(184, 146, 46, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 146, 46, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.section-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

.section-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-intro {
  max-width: 580px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Inversion des couleurs dans les sections sombres. */
.section--dark h2 {
  color: var(--white);
}

.section--dark .section-intro {
  color: var(--on-dark-muted);
}

/* ─────────────────────────────────────────────────────────
   3. PIED DE PAGE
   ───────────────────────────────────────────────────────── */

.site-footer {
  background: var(--navy-deep);
  padding: var(--space-xl) 0;
  border-top: 1px solid rgba(184, 146, 46, 0.15);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-inner p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--gold);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
}

.footer-logo-text {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}
