/* ============================================================
   ATELIER ORIEL — style.css
   Variables, reset, typographie, layout, navigation, footer
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bleu:        #3e7080;
  --bleu-fonce:  #2d5562;
  --bleu-clair:  #d6e8ec;
  --rouge:       #993300;
  --blanc:       #ffffff;
  --gris-clair:  #f7f6f3;
  --gris-bord:   #e8e8e4;
  --gris-moyen:  #999999;
  --texte:       #2a2a2a;
  --texte-leger: #666666;

  --f-titre: 'Century Gothic','AppleGothic','Gill Sans','Trebuchet MS',sans-serif;
  --f-corps: 'EB Garamond',Georgia,'Times New Roman',serif;

  --nav-h:    120px;   /* hauteur bandeau */
  --max-w:    1200px;
  --ease:     0.22s ease;

  /* Échelle d'espacement (utilisée par les pages intérieures) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6.5rem;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-corps);
  color: var(--texte);
  background: var(--blanc);
  font-size: 1rem;
  line-height: 1.8;
}
/* Verrou anti-compression réservé au desktop : au-dessus de 900px on
   protège la largeur de la carte Cassini ; en dessous, on relâche le
   min-width pour autoriser la mise en page mobile (cf. METHODO-mobile.md). */
@media (min-width: 901px) {
  body { min-width: 900px; }
}
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
p    { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ── Typographie ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--f-titre);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--texte);
}

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Filet décoratif ────────────────────────────────────────── */
.rule-rouge {
  width: 120px;
  height: 1px;
  background: var(--rouge);
  margin: 0 auto;
}

/* ── Bouton standard ────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--f-titre);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 20px;
  border: 1px solid var(--bleu);
  color: var(--bleu);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.btn:hover { background: var(--bleu); color: var(--blanc); }
.btn--rouge { border-color: var(--rouge); color: var(--rouge); }
.btn--rouge:hover { background: var(--rouge); color: var(--blanc); }

/* ════════════════════════════════════════════════════
   NAVIGATION — mode normal
════════════════════════════════════════════════════ */
.site-nav {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 32px;
  background: var(--blanc);
  border-bottom: 1px solid rgba(62,112,128,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 12px;
}

/* ── Bouton hamburger — structure (masqué sur desktop, affiché ≤ 768px) ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--bleu);
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Groupe logo + texte */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 16px;
}
.nav-brand img {
  height: 121px;
  width: auto;
  display: block;
  /* Active la couleur bleu atelier pour les SVG via currentColor */
  color: var(--bleu);
}
.nav-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}
.nav-brand-text .brand-name {
  font-family: var(--f-titre);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--bleu);
}
.nav-brand-text .brand-sub {
  font-family: var(--f-titre);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rouge);
  margin-top: 3px;
}

/* Liens navigation */
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px 16px;
  list-style: none;
  min-width: 0;
}
.nav-links li { min-width: 0; flex-shrink: 1; }
.nav-links li a {
  font-family: var(--f-titre);
  font-size: clamp(9px, 1.1vw, 17px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bleu);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  display: block;
  position: relative;
  padding: 4px 0;
  transition: color var(--ease);
}

/* Trait supérieur et inférieur qui se déroulent de gauche à droite au survol */
.nav-links li a::before,
.nav-links li a::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-links li a::before { top: 0; }
.nav-links li a::after  { bottom: 0; }

.nav-links li a:hover {
  color: var(--rouge);
}
.nav-links li a:hover::before,
.nav-links li a:hover::after {
  transform: scaleX(1);
}

/* ── Menu déroulant « Projets » (desktop) ─────────────────────
   Le <li> parent porte .nav-has-dropdown. Au survol — ou au focus
   clavier via :focus-within — le panneau .nav-dropdown se déroule
   de haut en bas (effet volet, via clip-path) : aucune flèche, rien
   de visible au repos. En mobile (≤768px) le panneau est masqué
   (voir la media query plus bas) : « Projets » redevient un simple
   lien vers l'accueil ancré sur #realisations. */
.nav-has-dropdown { position: relative; }

/* Pont invisible (porté par le parent, donc non rogné par le clip du
   panneau) : conserve le survol continu entre le libellé et le panneau. */
.nav-has-dropdown::after {
  content: '';
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 10px;
}

.nav-dropdown {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: top center;
  min-width: 240px;
  background: var(--blanc);
  border: 1px solid var(--gris-bord);
  border-top: 2px solid var(--bleu);
  box-shadow: 0 12px 30px rgba(0,0,0,0.10);
  padding: 6px 0;
  margin: 0;
  /* Repos : invisible et « replié » (le clip masque toute la hauteur
     depuis le bas ; les marges latérales/inférieures négatives laissent
     respirer l'ombre portée une fois déroulé). */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  clip-path: inset(0 -40px 100% -40px);
  transition:
    clip-path 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.22s ease,
    visibility 0.22s ease;
  z-index: 1001;
}
.nav-has-dropdown:hover > .nav-dropdown,
.nav-has-dropdown:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* Déroulé complet ; le bas/les côtés restent hors clip pour l'ombre. */
  clip-path: inset(0 -40px -40px -40px);
}

.nav-dropdown li {
  min-width: 0;
  flex-shrink: 0;
  border: 0;
}
.nav-dropdown li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  font-family: var(--f-titre);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bleu);
  white-space: nowrap;
  line-height: 1.3;
  transition: background var(--ease), color var(--ease);
}
/* Pastille de couleur reprenant la teinte de la catégorie (cf. tuiles d'accueil).
   On neutralise au passage les pseudo-éléments de soulignement hérités de
   « .nav-links li a » (::before redéfini en pastille, ::after désactivé). */
.nav-dropdown li a::before {
  content: '';
  position: static;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cat, var(--bleu));
  transform: none;
}
.nav-dropdown li a::after { display: none; }
.nav-dropdown li a:hover {
  background: var(--gris-clair);
  color: var(--rouge);
}

/* ════════════════════════════════════════════════════
   NAVIGATION — mode ultralight (≤ 600px physiques)
   Géré par JS dans index.html (window.outerWidth)
   Ces règles servent de fallback si JS désactivé
════════════════════════════════════════════════════ */
/* Pas de media query ici — le JS applique les styles
   directement sur les éléments pour éviter les conflits */

/* ════════════════════════════════════════════════════
   TITRES DE SECTION
════════════════════════════════════════════════════ */
.section-titre {
  text-align: center;
  padding: 60px 24px 44px;
}
.section-titre h2 {
  font-family: var(--f-titre);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--bleu);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════ */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 22px;
  font-family: var(--f-titre);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}


/* ════════════════════════════════════════════════════════════
   NAVIGATION — MODE MOBILE (≤ 768 px)
   Cible les classes communes à la nav écrite en dur (index.html)
   et à celle générée par js/navigation.js : fonctionne sur toutes
   les pages. Le bouton hamburger est câblé dans navigation.js
   (et par un script inline sur index.html, qui n'inclut pas le JS).

   Mise en forme : logo à gauche + bloc texte « Atelier Oriel /
   Architectes du patrimoine » à droite, sur une seule rangée ;
   le menu est masqué et s'ouvre via le hamburger (.nav-links.open).
════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  .site-nav {
    height: auto !important;
    min-height: 0 !important;
    padding: 12px 12px 2px 12px !important; /* léger décalage haut + gauche */
    flex-wrap: wrap;
    position: relative;            /* ancre pour le burger en absolu */
    flex-direction: row !important;
    justify-content: flex-start;   /* marque alignée à gauche comme en desktop */
    align-items: flex-start !important;
  }

  /* La marque reprend la mise en forme desktop : logo à gauche, bloc
     texte à droite (row). Logo agrandi, texte réduit.
     Le logo SVG contient une marge interne blanche : on l'absorbe par
     des marges négatives pour coller le motif à gauche, rapprocher le
     texte et supprimer le blanc vertical. */
  .nav-brand {
    margin: 0 !important;          /* annule un éventuel margin auto hérité */
    flex-direction: row !important; /* logo + texte côte à côte (desktop) */
    align-items: center !important; /* texte centré sur la hauteur du logo */
    text-align: left;
    gap: 0 !important;
    padding: 0;
    padding-right: 52px;           /* réserve l'espace du hamburger en absolu */
    overflow: visible;

    /* ───── RÉGLAGE HAUTEUR DU TEXTE DE MARQUE (mobile) ─────
       Décalage vertical fin du bloc « Atelier Oriel / Architectes… »
       pour l'aligner sur le CENTRE VISUEL du logo.
       Les marges négatives asymétriques du logo décalent son centre
       de boîte ; cette variable rattrape l'écart.
         • valeur NÉGATIVE  → remonte le texte
         • valeur POSITIVE  → descend le texte
       Réglage par pas de 1 à 2 px. Valeur courante : -8px. */
    --brand-text-shift: -8px;
  }
  .nav-brand img {
    height: 170px !important;      /* logo agrandi */
    width: auto !important;
    /* haut | droite | bas | gauche — rogne le blanc interne du SVG ;
       la 3e valeur (bas) remonte le filet de la nav vers le texte */
    margin: -55px -30px -40px -25px !important;
  }
  .nav-brand-text {
    align-items: flex-start;
    text-align: left;
    line-height: 1.4;
    transform: translateY(var(--brand-text-shift, 0)); /* réglage hauteur, voir --brand-text-shift */
  }
  .nav-brand-text .brand-name {
    font-size: 13px !important;     /* ratio desktop conservé (≈ logo × 15/121) */
    font-weight: 400 !important;
    letter-spacing: 0.12em !important;
    text-transform: none !important;
    color: var(--bleu) !important;
  }
  .nav-brand-text .brand-sub  {
    font-size: 9px !important;      /* ratio desktop conservé (≈ logo × 10/121) */
    font-weight: 300 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: var(--rouge) !important;
    margin-top: 2px !important;
  }

  /* Hamburger affiché et ancré en haut à droite */
  .nav-toggle {
    display: flex;
    position: absolute;            /* sort du flux : ne décale plus le logo */
    right: 16px;
    top: 16px;                     /* ancré sur la rangée de la marque, fixe menu ouvert */
    margin-left: 0 !important;     /* annule le margin-left:auto desktop */
  }

  /* Menu masqué par défaut ; déplié par .open (toggle JS) */
  .nav-links {
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    border-top: 1px solid rgba(62,112,128,0.12);
  }
  .nav-links.open { display: flex !important; }

  /* « Projets » en mobile : pas de déroulant (on simplifie le menu-burger).
     Le panneau et le chevron sont masqués ; le libellé « Projets » reste un
     simple lien vers l'accueil ancré sur la section « Nos réalisations ». */
  .nav-dropdown { display: none !important; }
  .nav-links li { border-bottom: 1px solid rgba(62,112,128,0.08); }
  .nav-links li a {
    padding: 14px 16px !important;
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
    text-align: left !important;
    white-space: normal !important;
    display: block !important;
  }
  .nav-links li a::before,
  .nav-links li a::after { display: none; }

  /* Garde-fou : aucun débordement horizontal résiduel */
  html, body { overflow-x: hidden; }
}
