/* =============================================================
   RESTODÉLICE — FEUILLE DE STYLE
   Organisation :
   1. Variables & reset
   2. Éléments généraux (titres, boutons, conteneurs)
   3. Header & navigation
   4. Hero
   5. Sections communes (philosophie, carte, à propos, galerie...)
   6. Formulaire de réservation
   7. Footer
   8. Animations & responsive
   ============================================================= */

/* -------------------------------------------------------------
   1. VARIABLES & RESET
------------------------------------------------------------- */
:root {
  /* Palette "healthy food" : vert sauge profond, crème chaud, terracotta */
  --color-green-deep: #3f4f3a;   /* vert profond - couleur principale */
  --color-green-sage: #8aa57f;   /* vert sauge - accents doux */
  --color-cream: #f7f2e9;        /* fond crème chaud */
  --color-cream-dark: #efe6d6;   /* fond crème légèrement plus soutenu */
  --color-terracotta: #c96f4a;   /* accent orange/terracotta - CTA */
  --color-terracotta-dark: #b25a37;
  --color-text: #2b2b26;         /* texte principal, presque noir chaud */
  --color-text-light: #6b6a5e;   /* texte secondaire */
  --color-white: #ffffff;

  /* Typographie */
  --font-title: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", Arial, sans-serif;

  /* Espacements & rayons */
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-soft: 0 10px 30px rgba(63, 79, 58, 0.12);
  --section-padding: clamp(64px, 9vw, 120px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Respecte les préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Visible focus au clavier, pour l'accessibilité */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 3px;
}

/* -------------------------------------------------------------
   2. ÉLÉMENTS GÉNÉRAUX
------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
}

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--color-green-deep);
  line-height: 1.15;
  font-weight: 500;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  max-width: 640px;
  margin-bottom: 48px;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--color-cream);
  margin-bottom: 18px;
  display: inline-block;
}

.eyebrow-dark {
  color: var(--color-terracotta-dark);
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 32px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-accent {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  box-shadow: 0 10px 24px rgba(201, 111, 74, 0.35);
}

.btn-accent:hover {
  background-color: var(--color-terracotta-dark);
}

.btn-outline-light {
  background-color: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

/* --- Grille de cartes générique (réutilisée par plusieurs sections) --- */
.card-grid {
  display: grid;
  gap: 28px;
}

.card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(63, 79, 58, 0.18);
}

/* -------------------------------------------------------------
   3. HEADER & NAVIGATION
------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(247, 242, 233, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(63, 79, 58, 0.08);
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  padding: 18px 0;
}

/* Classe ajoutée en JS quand on scrolle : header plus compact, fond plus opaque + ombre marquée */
.site-header.scrolled {
  background-color: rgba(247, 242, 233, 0.98);
  box-shadow: 0 8px 28px rgba(43, 43, 38, 0.12);
  padding: 10px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-green-deep);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-leaf {
  display: inline-flex;
  align-items: center;
  color: var(--color-terracotta);
}

/* La navigation principale prend l'espace central disponible et centre ses liens */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  gap: 34px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-terracotta);
  transition: width 0.25s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 11px 26px;
  font-size: 0.88rem;
  flex-shrink: 0;
}

/* --- Menu hamburger (mobile) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--color-green-deep);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.hamburger span:nth-child(2) {
  width: 70%;
}

.hamburger:hover span {
  width: 100%;
}

/* Animation du hamburger en croix quand le menu est ouvert */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 100%;
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 100%;
}

/* -------------------------------------------------------------
   4. HERO
------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media,
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(30, 39, 27, 0.55) 0%,
    rgba(30, 39, 27, 0.35) 45%,
    rgba(30, 39, 27, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
  max-width: 720px;
  padding-top: 90px;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 560px;
  margin-bottom: 36px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Petit indicateur animé invitant à scroller */
.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  background-color: var(--color-white);
  border-radius: 50%;
  animation: scrollCue 1.8s infinite;
}

@keyframes scrollCue {
  0%   { opacity: 1; transform: translateY(0); }
  70%  { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* -------------------------------------------------------------
   5. SECTIONS COMMUNES
------------------------------------------------------------- */

/* --- Philosophie --- */
.philosophy {
  background-color: var(--color-cream);
}

.philosophy-grid {
  grid-template-columns: repeat(4, 1fr);
}

.philosophy-card {
  padding: 36px 28px;
  text-align: left;
}

.card-icon {
  color: var(--color-terracotta);
  margin-bottom: 18px;
}

.philosophy-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.philosophy-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* --- Notre carte / menu --- */
.menu-section {
  background-color: var(--color-cream-dark);
}

.menu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  background-color: transparent;
  border: 2px solid var(--color-green-sage);
  color: var(--color-green-deep);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.filter-btn:hover {
  background-color: rgba(138, 165, 127, 0.18);
}

.filter-btn.active {
  background-color: var(--color-green-deep);
  border-color: var(--color-green-deep);
  color: var(--color-white);
}

.menu-grid {
  grid-template-columns: repeat(3, 1fr);
}

.menu-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.menu-card-body {
  padding: 22px;
}

.menu-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.menu-card-head h3 {
  font-size: 1.15rem;
}

.price {
  font-family: var(--font-title);
  color: var(--color-terracotta);
  font-weight: 600;
  white-space: nowrap;
}

.menu-card p {
  color: var(--color-text-light);
  font-size: 0.92rem;
}

/* Carte cachée par le filtre JS */
.menu-card.is-hidden {
  display: none;
}

/* --- À propos --- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}

.about-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.about-text p {
  color: var(--color-text-light);
  margin-bottom: 16px;
  max-width: 560px;
}

/* --- Galerie --- */
.gallery {
  background-color: var(--color-cream-dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.gallery-grid img:nth-child(2),
.gallery-grid img:nth-child(4),
.gallery-grid img:nth-child(6) {
  height: 100%;
  aspect-ratio: 3 / 4;
}

.gallery-grid img:nth-child(1),
.gallery-grid img:nth-child(3),
.gallery-grid img:nth-child(5) {
  aspect-ratio: 1 / 1;
}

/* --- Témoignages --- */
.testimonials-grid {
  grid-template-columns: repeat(3, 1fr);
}

.testimonial-card {
  padding: 32px 28px;
}

.stars {
  color: var(--color-terracotta);
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.quote {
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 16px;
}

.author {
  font-weight: 600;
  color: var(--color-green-deep);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------
   6. FORMULAIRE DE RÉSERVATION
------------------------------------------------------------- */
.reservation {
  background-color: var(--color-green-deep);
  color: var(--color-cream);
}

.reservation .section-title,
.reservation-intro h2 {
  color: var(--color-white);
}

.reservation-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
}

.reservation-intro p {
  color: rgba(247, 242, 233, 0.85);
  max-width: 380px;
}

.reservation-form {
  background-color: var(--color-cream);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--color-green-deep);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid #d8cfba;
  background-color: var(--color-white);
  color: var(--color-text);
}

.form-group textarea {
  resize: vertical;
}

/* Champ en erreur : bordure rouge discrète */
.form-group.has-error input,
.form-group.has-error textarea {
  border-color: #c65b4a;
}

.error-msg {
  color: #c65b4a;
  font-size: 0.8rem;
  min-height: 18px;
  margin-top: 4px;
}

.form-success {
  margin-top: 18px;
  font-weight: 600;
  color: var(--color-green-deep);
  display: none;
}

.form-success.visible {
  display: block;
}

/* -------------------------------------------------------------
   Contact & localisation
------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: start;
}

.contact-list li {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-list strong {
  color: var(--color-green-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.contact-list a:hover {
  color: var(--color-terracotta);
}

.map-placeholder {
  background-color: var(--color-cream-dark);
  border: 2px dashed var(--color-green-sage);
  border-radius: var(--radius-lg);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-weight: 600;
}

/* -------------------------------------------------------------
   7. FOOTER
------------------------------------------------------------- */
.site-footer {
  background-color: #2b3527;
  color: rgba(247, 242, 233, 0.85);
  padding-top: 60px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(247, 242, 233, 0.15);
}

.footer-logo {
  font-size: 1.4rem;
  color: var(--color-cream);
  display: block;
  margin-bottom: 12px;
}

.footer-brand p {
  color: rgba(247, 242, 233, 0.65);
  max-width: 280px;
}

.footer-links h3,
.footer-social h3 {
  font-family: var(--font-body);
  color: var(--color-cream);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a:hover,
.social-icons a:hover {
  color: var(--color-terracotta);
}

.social-icons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-bottom {
  text-align: center;
  padding: 22px 0;
  font-size: 0.82rem;
  color: rgba(247, 242, 233, 0.55);
}

/* -------------------------------------------------------------
   8. ANIMATIONS AU SCROLL
------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------- */
@media (max-width: 1024px) {
  .philosophy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .menu-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid,
  .contact-grid,
  .reservation-inner {
    grid-template-columns: 1fr;
  }
  .about-media {
    order: -1;
  }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 80vw);
    background-color: var(--color-cream);
    box-shadow: -12px 0 30px rgba(0,0,0,0.12);
    padding: 110px 32px 32px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 1050;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 26px;
  }

  .main-nav .nav-link {
    color: var(--color-green-deep) !important;
    font-size: 1.1rem;
  }

  .hamburger {
    display: flex;
  }

  .nav-cta {
    display: none;
  }
}

@media (max-width: 640px) {
  .philosophy-grid,
  .menu-grid,
  .testimonials-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid img,
  .gallery-grid img:nth-child(2n) {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
