/* ============================================================
   BASE.CSS — Atryvia
   Variables, reset, composants partagés (header, footer, boutons)
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
  --navy:        #1a2a3a;
  --navy-dark:   #0f1c2b;
  --navy-light:  #2a3f54;
  --cream:       #f5f0e8;
  --cream-light: #faf8f4;
  --cream-warm:  #f0ebe3;
  --green:       #2d5a3d;
  --green-dark:  #1e4030;
  --green-light: #3d7a52;
  --gold:        #c4a24e;
  --gold-light:  #d4b86a;
  --gold-dark:   #a88a3a;
  --purple:      #6b4a8a;
  --text:        #2a2a2a;
  --text-light:  #5a5a5a;
  --text-muted:  #8a8a7a;
  --white:       #ffffff;
  --border:      rgba(26, 42, 58, 0.12);
  --shadow:      0 8px 32px rgba(26, 42, 58, 0.08);
  --shadow-lg:   0 16px 48px rgba(26, 42, 58, 0.12);
  --radius:      12px;
  --radius-lg:   20px;
  --max-width:   1280px;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--cream-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.15;
  color: var(--navy);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--green-dark);
}

button {
  cursor: pointer;
  font-family: inherit;
}

ul {
  list-style: none;
  padding: 0;
}

/* ===== SKIP LINK (accessibilité) ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  background: var(--navy);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  overflow: visible;
}

/* ===== FOCUS VISIBLE (accessibilité clavier) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== UTILITAIRES ===== */
.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;
}

/* ===== CONTENEUR ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--navy);
  border-bottom-color: var(--green);
}

/* ===== BOUTONS COMMUNS ===== */
.btn-primary,
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: var(--navy);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
}

.btn-primary:hover,
.nav-cta:hover {
  background: var(--navy-light);
  color: white;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold-dark);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(196, 162, 78, 0.08);
  color: var(--gold-dark);
}

.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: var(--green);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
}

.btn-green:hover {
  background: var(--green-dark);
  color: white;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
  cursor: pointer;
}

.btn-gold:hover {
  background: var(--gold-light);
  color: white;
}

/* ===== HAMBURGER MOBILE ===== */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  position: relative;
  transition: background 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--navy);
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before { top: -7px; }
.hamburger::after  { top:  7px; }

.mobile-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.mobile-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== MENU MOBILE ACTIF ===== */
.nav.mobile-active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: white;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  z-index: 99;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
}

.nav.mobile-active a {
  padding: 10px 0;
  border-bottom: 1px solid var(--cream);
  font-size: 1rem;
}

.nav.mobile-active a:last-child {
  border-bottom: none;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 0 32px;
  font-size: 0.9rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer h5 {
  color: white;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}

.footer-links {
  display: grid;
  gap: 10px;
  padding: 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
}

.footer-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.04em;
}

.footer-brand-desc {
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  font-size: 0.88rem;
  margin-top: 8px;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ===== SECTION LABELS COMMUNS ===== */
.section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

/* ===== RESPONSIVE GLOBAL ===== */
@media (max-width: 900px) {
  .nav { display: none; }
  .mobile-toggle { display: block; }

  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .footer-top {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 16px;
  }
}

/* ===== REVEAL AU SCROLL ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* Section fond alterné */
.section-alt {
  background: var(--cream);
}

/* ===== PREFERS-REDUCED-MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
