/* Reset très léger */
* { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }

/* Déclaration font Avenir depuis ton dossier /assets/fonts/ */
@font-face {
  font-family: 'Avenir';
  src: url('../fonts/Avenir.ttc') format('truetype-collection');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Variables couleurs de la charte */
:root {
  --color-bg: #ffffff;     /* fond du site (clair) */
  --color-accent: #a1a8a3; /* accent (vert-gris doux) */
  --color-alt: #b5bab3;    /* nuance secondaire */
  --color-text: #5c625e;   /* texte principal (vert sombre) */
  --color-muted: #9aa09a;  /* texte atténué (ajusté pour contraste) */

  /* Overlay dédié au menu plein écran (fond sombre translucide) */
  --overlay-bg: rgba(92,98,94,.97);

  /* === Aliases pour compat rétro du CSS (évite de tout renommer) === */
  --bg: var(--color-bg);
  --fg: var(--color-text);
  --accent: var(--color-accent);
}

/* Typo et couleurs par défaut */
body {
  margin: 0;
  font-family: 'Avenir', system-ui, -apple-system, sans-serif!important;
  background: var(--color-bg);
  color: var(--color-text);
}

h1, h2, h3, h4, h5 {
  font-family: 'Avenir', sans-serif;
  text-transform: uppercase; /* cohérent avec TABLE et TOILE */
  letter-spacing: .05em;
}

h2 {
  font-size: 2.5rem;
  ;
  margin: 0 0 1.25rem;
  color: var(--color-text);
}

h3 {
  font-size: 1.8rem;
  margin: 1.5rem 0 .5rem;
  color: var(--color-text);
}

a {
  text-decoration: none;
  transition: color .25s, text-decoration .25s;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 0;
  border: 2px solid var(--color-accent);
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: .06em;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
  will-change: transform;
}
.btn:hover { background: var(--color-alt); border-color: var(--color-alt); transform: translateY(-2px); }

/* Accessibilité : texte pour lecteurs d’écran */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ================= Header ================= */
.site-header {
  position: sticky; top: 0; z-index: 1000; 
  /*background color with opacity for overlay effect*/
  background: rgba(161,168,163,.95);
  color: var(--fg);
  /* Sur fond blanc, bordure gris très clair */
}

.header-inner {
  margin: 0 auto; padding: 14px 20px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}

.header-slot { /* vide à gauche pour équilibrer */ }

.site-brand { display: grid; place-items: center; }
.custom-logo-link, .site-fallback-logo { display: inline-grid; place-items: center; color: var(--fg); text-decoration: none; }
.custom-logo { width: 80px; height: auto; }

.header-actions { display: grid; place-items: end; }

/* ⚠️ Fix: display -> inline-grid + position: relative */
.burger {
  position: relative;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border: 0;
  background: transparent; color: var(--fg); border-radius: 12px; cursor: pointer;
}
.burger .icon-close { display: none; }
.burger[aria-expanded="true"] .icon-burger { display: none; }
.burger[aria-expanded="true"] .icon-close { display: block; }

/* ================= Overlay plein écran ================= */
.menu-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: grid; place-items: center; background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  transition: opacity .5s ease, visibility 0s linear .5s;
  opacity: 0; visibility: hidden;
  pointer-events: none; /* empêche les interactions quand fermé */
  color: #fff; /* liens/texte lisibles sur fond sombre */
}
.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s; /* visible tout de suite à l'ouverture */
  pointer-events: auto;
}

.overlay-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #fff;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  cursor: pointer;
}

.overlay-panel { width: min(92vw, 720px); }

.overlay-menu {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px; text-align: center;
}
.overlay-menu a {
  display: inline-block; text-decoration: none; color: #fff;
  font-size: clamp(22px, 4vw, 38px); letter-spacing: .02em;
  padding: 8px 14px; border-radius: 12px;
}
.overlay-menu a:hover,
.overlay-menu a:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.overlay-menu .cta {
  border: 1px solid var(--accent);
}
.overlay-menu .cta:hover { background: var(--accent); color: #000; }

/* Préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  .menu-overlay { transition: none; }
}

/* ================= Footer ================= */
.site-footer { background: var(--color-text); color: #ffffff; padding: 6rem 4rem 0rem 4rem; }
.site-footer .container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }

.site-footer {
  color: #ffffff;
}

.ft-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .ft-top { grid-template-columns: 1fr; } }

.ft-col .ft-title { font-size: 1rem; margin: 0 0 .75rem 0; color: #fff; text-transform: uppercase; letter-spacing: .06em; }
.ft-brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: #fff; }
.ft-brand .custom-logo { width: 36px; height: auto; }
.ft-site-name { font-weight: 600; letter-spacing: .02em; }
.ft-baseline { margin: .5rem 0 1rem; color: #fff; }

.ft-social { display: flex; gap: 12px; padding: 0; margin: 0; list-style: none; }
.ft-social a { display:inline-grid; place-items:center; width:36px; height:36px; border:1px solid rgba(255,255,255,.14); border-radius:10px; color: #fff; }
.ft-social a:hover { background: rgba(255,255,255,.08); }

.ft-menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ft-menu a { text-decoration: none; color: #fff; }
.ft-menu a:hover { text-decoration: underline; }

.ft-contact { font-style: normal; color: #fff; }
.ft-tel { color: #fff; text-decoration: none; }
.ft-tel:hover { text-decoration: underline; }
.ft-hours { list-style: none; padding: 0; margin: .5rem 0 0 0; color: #fff; display: grid; gap: 4px; }

.ft-cta .btn { display:inline-block; padding:10px 14px; border:1px solid var(--accent); border-radius:12px; color:#fff; text-decoration:none; margin-top: 12px; }
.ft-cta .btn:hover { background: var(--accent); color: #fff; }

.ft-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 24px; padding-top: 18px;
}
.ft-bottom a { color: #fff; text-decoration: none; }
.ft-bottom a:hover { text-decoration: underline; }
.ft-legal { color: #fff; }

.to-top {
  position: fixed; right: 18px; bottom: 18px;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,10,13,.75);
  color: #fff; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 1400;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

.desktop-only{ display: block; }
.mobile-only{ display: none; }

/* =====================================================
   Responsive – tablette (≤900px) & mobile (≤560px)
   ===================================================== */

/* -------------------------
   Tablette <= 900px
   ------------------------- */
@media (max-width: 900px) {

  p, li{
    font-size: 1rem!important;
    line-height: 1.5;
  }

  h2 { 
    font-size: 1.6rem!important;
  }

  h3 { 
    font-size: 1.15rem!important; 
  }

  /* Container / header */
  .header-inner {
    padding: 12px 16px;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }
  .custom-logo { width: 64px; }
  .header-actions { justify-self: end; }

  /* Burger becomes visible & tappable */
  .burger { width:44px; height:44px; border-radius:10px; }
  .burger .icon-burger, .burger .icon-close { width:20px; height:20px; }

  /* Overlay menu: larger tappable items, centered panel */
  .menu-overlay {
    padding: 18px;
    backdrop-filter: blur(14px);
  }
  .overlay-panel { width: min(94vw, 680px); padding: 12px; }

  .overlay-menu {
    gap: 12px;
  }
  .overlay-menu a {
    font-size: clamp(20px, 5vw, 34px);
    padding: 10px 14px;
    display: block;
  }
  .overlay-menu .cta { border-width: 1px; padding: 12px 16px; }

  /* Brand in header: keep visible & centered */
  .site-brand { justify-self: center; }

  /* Buttons baseline */
  .btn { padding: 10px 18px; font-size: 15px; }

  /* Body: slightly larger base font for readability on tablets */
  body { font-size: 16px; line-height: 1.55; }

  /* Footer: stack columns, increase gaps */
  .site-footer { padding: 48px 28px 24px; }
  .ft-top { grid-template-columns: 1fr; gap: 22px; }
  .ft-col { text-align: center; padding-bottom: 10px; }
  .ft-brand { justify-content: center; }
  .ft-social { margin-top: 8px; }
  .ft-cta .btn { width: 100%; padding:12px 14px; }

  /* to-top tweak */
  .to-top { right: 14px; bottom: 14px; width:44px; height:44px; }

  /* Focus visible improvements for keyboard/touch users */
  .overlay-menu a:focus-visible,
  .btn:focus-visible,
  .burger:focus-visible {
    outline: 3px solid rgba(161,168,163,0.18);
    outline-offset: 3px;
  }
}

/* -------------------------
   Mobile <= 560px
   ------------------------- */
@media (max-width: 560px) {

  p, li{
    font-size: 15px!important;
    line-height: 1.5;
  }

  h2 { 
    font-size: 1.25rem!important; 
  }

  h3 { 
    font-size: 1rem!important; 
  }

  /* Header / brand */
  .header-inner { padding: 10px 12px; grid-template-columns: 1fr auto 1fr; }
  .site-brand { justify-self: center; }
  .custom-logo { width: 56px; }

  /* Burger bigger touch target */
  .burger { width:48px; height:48px; border-radius:12px; }

  /* Reduce hero padding elsewhere via other CSS; base font smaller */
  body { font-size: 15px; line-height: 1.5; }

  /* Overlay menu tuned for mobile: full bleed, comfortable spacing */
  .menu-overlay {
    padding: 12px;
    background: var(--overlay-bg);
    backdrop-filter: blur(12px);
  }
  .overlay-panel { width: 100%; max-width: 96vw; padding: 10px; }
  .overlay-menu { gap: 10px; }
  .overlay-menu a {
    font-size: clamp(18px, 6.5vw, 30px);
    padding: 12px 12px;
    border-radius: 10px;
  }
  .overlay-menu .cta { display: block; width: 100%; }

  /* Close button: large, high contrast */
  .overlay-close {
    top: 12px; right: 12px; width:44px; height:44px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
  }

  /* Buttons & CTAs: full width where appropriate */
  .btn { padding: 11px 16px; font-size: 15px; display:inline-block; }
  .ft-cta .btn { width: 100%; text-align: center; padding: 12px; }

  /* Footer: very compact layout, center brand and social */
  .site-footer { padding: 28px 18px 18px; }
  .site-footer .container { padding: 0; }
  .ft-top { gap: 12px; grid-template-columns: 1fr; }
  .ft-brand { justify-content: center; }
  .ft-social { justify-content: center; gap: 10px; }
  .ft-menu { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 12px; }
  .ft-menu a { font-size: 14px; }
  .ft-contact { font-size: 14px; text-align:center; }
  .ft-hours { justify-content: center; }

  /* Bottom: center & reduce size */
  .ft-bottom { flex-direction: column; gap: 8px; align-items: center; padding-top: 12px; }
  .ft-legal { font-size: 13px; text-align:center; }

  /* To-top less intrusive */
  .to-top { right: 12px; bottom: 12px; width:40px; height:40px; border-radius:10px; }

  .desktop-only{ display: none; }
  .mobile-only{ display: block; }
}

/* -------------------------
   Small helpers and accessibility
   ------------------------- */

/* Larger tap-targets for touch devices */
@media (pointer: coarse) {
  .overlay-menu a, .btn, .burger, .ft-social a { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  .menu-overlay, .menu-overlay.is-open, .overlay-menu a, .btn, .to-top { transition: none !important; animation: none !important; }
}
