/* style.css — homepage Essence Parfumerie (cadrage 0042/CC-5).
   Classes prefixees .es-* (scopees a cette page, R157) ; reutilise les
   variables --* posees par layout.html.twig (palette derivee, PaletteDeriver). */

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--secondary-nacre);
  margin: 0;
}

a {
  color: inherit;
}

/* ---- Topbar ---- */
.es-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Sans ce wrap, brand + 3 liens nav depassent ~500px de large en une seule
   ligne (mesure DOM) - deborde sur tout ecran telephone (< ~500px). */
@media (max-width: 640px) {
  .es-topbar {
    justify-content: center;
    text-align: center;
  }
}

.es-topbar-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.es-topbar-link:hover {
  color: var(--accent-gold);
}

.es-hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.es-hero-logo {
  height: 52px;
  width: auto;
}

.es-hero-brand-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  /* Pas de nowrap : ~299px de large (mesure DOM), au ras de la largeur
     disponible sur un telephone etroit - laisse le texte passer sur 2
     lignes plutot que deborder/scroller horizontalement. */
}

.es-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.es-nav a {
  text-decoration: none;
  color: var(--text-secondary);
}

.es-nav a:hover {
  color: var(--accent-gold);
}

/* ---- Hero ----
   Layout vertical (texte puis bandeau photo), pas 2 colonnes cote a cote :
   une grille 2 colonnes grandit avec le nombre de photos et ecrase le texte
   (retour d'usage) - empile, chaque bloc garde sa hauteur naturelle. */
.es-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
}

.es-hero-copy {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.es-hero-visual {
  overflow: hidden;
  margin: 0 -1.5rem;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.es-hero-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  padding: 0 1.5rem;
  animation: es-hero-scroll 32s linear infinite;
}

.es-hero-visual:hover .es-hero-track {
  animation-play-state: paused;
}

@keyframes es-hero-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .es-hero-track {
    animation: none;
  }
}

.es-hero-photo {
  flex: 0 0 auto;
  width: 190px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* §15.58 (saasimple) : hero_badge peut porter plusieurs badges - wrapper
   flex-wrap plutot qu'un badge unique en dur. */
.es-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.es-badge {
  display: inline-block;
  background: var(--secondary-nacre-warm);
  color: var(--accent-brown);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.es-hero-copy h1 {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.es-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  line-height: 1.6;
}

.es-hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.es-btn-primary,
.es-btn-secondary {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.es-btn-primary {
  background: var(--accent-gold);
  color: var(--primary-rose-deep);
}

.es-btn-primary:hover {
  opacity: 0.9;
}

.es-btn-secondary {
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* ---- Nos maisons ---- */
.es-maisons {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}

.es-section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.es-section-subtitle {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.es-maisons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  text-align: left;
}

.es-maison-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent-gold);
  transition: opacity 0.6s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Retour d'usage (2e essai) : animation-timeline: view() en CSS pur ne s'est
   pas declenchee de facon fiable en usage reel. Repli sur IntersectionObserver
   (cf. script en bas de _maisons.html.twig) : l'etat "cache" n'existe QUE si
   la classe es-js est posee (JS actif), donc sans JS les cartes restent
   normalement visibles - jamais bloquees a opacity 0. */
.es-js .es-maison-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.2s ease;
}

.es-js .es-maison-card.es-in-view {
  opacity: 1;
  transform: translateY(0);
}

.es-js .es-maisons-grid .es-maison-card:nth-child(1).es-in-view { transition-delay: 0s; }
.es-js .es-maisons-grid .es-maison-card:nth-child(2).es-in-view { transition-delay: 0.1s; }
.es-js .es-maisons-grid .es-maison-card:nth-child(3).es-in-view { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .es-js .es-maison-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Specificite egale a ".es-js .es-maison-card.es-in-view" (3 classes) : sans
   ca, une fois revelee, la carte aurait une specificite plus forte au repos
   (.es-in-view) que celle du survol, qui ne se verrait jamais. */
.es-maisons-grid .es-maison-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Logos des maisons (crops issus des photos produit catalogue, pas de
   fichier logo "propre" fourni par les fournisseurs) : hauteur fixe +
   object-fit:contain plutot qu'un cadre carre force - les 3 logos ont des
   ratios differents (large/carre/large), un cover les aurait rognes
   (meme lecon que le fix objet-fit produit, cf. session 31/07). */
.es-maison-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.es-maison-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  color: var(--accent-brown);
}

.es-maison-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.es-maisons-cta {
  margin-top: 2.5rem;
}

/* ---- Accès ---- */
.es-access {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.es-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: start;
}

.es-access-info p {
  margin: 0 0 0.75rem;
}

.es-access-map iframe {
  border-radius: 14px;
}

/* ---- Footer ---- */
.es-footer {
  background: var(--primary-rose);
  color: var(--secondary-nacre);
}

.es-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.es-footer-brand {
  text-align: center;
}

.es-footer-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 auto 0.65rem;
  padding: 4px;
  border-radius: 8px;
  background: var(--secondary-nacre);
}

.es-footer-brand strong {
  letter-spacing: 0.05em;
}

.es-footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.es-footer-social a,
.es-footer-legal a {
  color: var(--secondary-nacre);
  text-decoration: none;
}

.es-footer-social a:hover,
.es-footer-legal a:hover {
  text-decoration: underline;
}

.es-footer-bottom {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.es-footer-bottom a {
  color: var(--accent-gold);
}

@media (max-width: 780px) {
  .es-hero-photo {
    width: 140px;
  }
  .es-access-grid {
    grid-template-columns: 1fr;
  }
}
