/* =============================================================================
   style.css — Styles custom (au-delà de Tailwind)
   Palette « artisanat d'art & luxe » : charbon profond, laiton/or, crème.
   Gère : variables, typographies, animations au scroll, RTL, galeries.
   ============================================================================= */

:root {
  --c-ink:      #1a1714;   /* charbon profond (fond) */
  --c-ink-soft: #211d19;
  --c-cream:    #f4efe7;   /* crème (texte clair) */
  --c-brass:    #c9a35b;   /* laiton / or (accent) */
  --c-brass-lo: #a8823f;
  --c-muted:    #a99f92;   /* texte secondaire */
  --c-line:     rgba(201,163,91,.18);
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans:  "Inter", system-ui, sans-serif;
  --font-ar:    "Cairo", "Tajawal", system-ui, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  background: var(--c-ink);
  color: var(--c-cream);
  font-family: var(--font-sans);
  overflow-x: hidden;
}
.font-serif { font-family: var(--font-serif); }

/* Bascule automatique de la police en arabe */
html[lang="ar"] body,
html[lang="ar"] .font-serif {
  font-family: var(--font-ar);
}
html[lang="ar"] { letter-spacing: 0; }

/* Fondu doux lors du changement de langue */
body.lang-switching #main-content { opacity: .35; transition: opacity .2s ease; }
#main-content { transition: opacity .3s ease; }

/* ---------- RTL : miroir des éléments directionnels ---------- */
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
html[dir="rtl"] .hero-eyebrow-line { margin-left: 0; margin-right: 0; }

/* ---------- Accent & titres ---------- */
.text-brass { color: var(--c-brass); }
.eyebrow {
  color: var(--c-brass);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  font-weight: 600;
}
html[lang="ar"] .eyebrow { letter-spacing: .1em; }

.section-title {
  font-family: var(--font-serif);
  line-height: 1.1;
  font-weight: 600;
}

/* Filet décoratif sous les titres */
.rule {
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--c-brass), transparent);
}
html[dir="rtl"] .rule { background: linear-gradient(270deg, var(--c-brass), transparent); }

/* ---------- Navbar ---------- */
.nav-blur {
  background: rgba(20,17,14,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-line);
}
.nav-link { position: relative; transition: color .25s ease; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 0; height: 1px; background: var(--c-brass); transition: width .3s ease;
}
.nav-link:hover { color: var(--c-brass); }
.nav-link:hover::after { width: 100%; }

/* Sélecteur de langue */
.lang-btn {
  font-size: .72rem; font-weight: 600; letter-spacing: .05em;
  padding: .2rem .5rem; border-radius: 4px; color: var(--c-muted);
  transition: all .2s ease;
}
.lang-btn:hover { color: var(--c-cream); }
.lang-btn.active { color: var(--c-ink); background: var(--c-brass); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 2px;
  font-weight: 600; font-size: .9rem; letter-spacing: .02em;
  transition: all .3s cubic-bezier(.2,.7,.3,1); cursor: pointer;
}
.btn-primary {
  background: var(--c-brass); color: var(--c-ink);
  box-shadow: 0 8px 30px -8px rgba(201,163,91,.5);
}
.btn-primary:hover { background: var(--c-cream); transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--c-line); color: var(--c-cream);
}
.btn-ghost:hover { border-color: var(--c-brass); color: var(--c-brass); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img, .hero-media video {
  width: 100%; height: 100%; object-fit: cover;
}
/* Placeholder élégant si aucune image n'est déposée */
.hero-fallback {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 70% 20%, rgba(201,163,91,.20), transparent 55%),
    radial-gradient(100% 100% at 20% 90%, rgba(120,80,40,.30), transparent 50%),
    linear-gradient(160deg, #211d19, #12100d);
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(15,13,11,.88) 0%, rgba(15,13,11,.55) 45%, rgba(15,13,11,.25) 100%);
}
html[dir="rtl"] .hero-overlay {
  background: linear-gradient(270deg, rgba(15,13,11,.88) 0%, rgba(15,13,11,.55) 45%, rgba(15,13,11,.25) 100%);
}
.hero-content { position: relative; z-index: 2; }

/* Sous-titre du hero : plus clair + ombre portée pour bien ressortir sur la photo */
.hero-subtitle {
  color: #efe7d8;
  font-weight: 500;
  text-shadow: 0 2px 16px rgba(0,0,0,.7), 0 1px 3px rgba(0,0,0,.55);
}
/* Le titre gagne aussi une légère ombre pour la lisibilité */
.hero-content .section-title { text-shadow: 0 2px 22px rgba(0,0,0,.55); }
.hero-content .eyebrow { text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* Indicateur de défilement */
.scroll-cue { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity:.6 } 50% { transform: translateY(8px); opacity:1 } }

/* ---------- Cartes produits / prestations ---------- */
.card {
  position: relative; overflow: hidden; border-radius: 4px;
  border: 1px solid var(--c-line); background: var(--c-ink-soft);
  transition: transform .4s ease, border-color .4s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--c-brass); }
.card-media { position: relative; overflow: hidden; aspect-ratio: 4/5; }
.card-media img, .card-media video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card-media img { transform: scale(1.06); }
/* Le fallback est SOUS l'image (rendu avant dans le DOM) : visible uniquement
   si l'image est absente/cassée. Opaque pour bien masquer le fond. */
.card-media-fallback {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(150deg, #2a251f, #16130f);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-brass);
}
.card-media img, .card-media video { position: relative; z-index: 1; }

/* ---------- Galerie / grille médias ---------- */
.gallery-item {
  position: relative; overflow: hidden; border-radius: 4px;
  aspect-ratio: 1/1; cursor: pointer;
  border: 1px solid var(--c-line);
}
.gallery-item img, .gallery-item video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-caption {
  position: absolute; inset: auto 0 0 0; padding: .9rem 1rem;
  background: linear-gradient(0deg, rgba(15,13,11,.9), transparent);
  font-size: .82rem; opacity: 0; transform: translateY(8px);
  transition: all .3s ease;
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }
.gallery-fallback {
  position:absolute; inset:0; z-index:0; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(150deg, #2a251f, #16130f); color: var(--c-brass);
  font-size: .8rem;
}
.gallery-item img, .gallery-item video { position: relative; z-index: 1; }
.gallery-item .gallery-caption { z-index: 2; }

/* Badge Instagram au survol */
.insta-item::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(201,163,91,0); transition: background .3s ease;
}
.insta-item:hover::after { background: rgba(201,163,91,.12); }

/* ---------- Formulaire ---------- */
.field {
  width: 100%; padding: .85rem 1rem; background: var(--c-ink-soft);
  border: 1px solid var(--c-line); border-radius: 3px; color: var(--c-cream);
  font-size: .95rem; transition: border-color .25s ease;
}
.field:focus { outline: none; border-color: var(--c-brass); }
.field::placeholder { color: var(--c-muted); }
.field-label { font-size: .78rem; color: var(--c-muted); margin-bottom: .4rem; display:block; letter-spacing:.04em; }

/* ---------- Bouton WhatsApp flottant ---------- */
.wa-float {
  position: fixed; bottom: 22px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -6px rgba(37,211,102,.55);
  transition: transform .25s ease;
}
.wa-float:hover { transform: scale(1.08); }
html[dir="ltr"] .wa-float { right: 22px; }
html[dir="rtl"] .wa-float { left: 22px; }

/* ---------- Animations au scroll (révélation) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Divers ---------- */
.section-pad { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.max-shell { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.text-muted { color: var(--c-muted); }
.divider { height:1px; background: var(--c-line); }

/* Menu mobile */
.mobile-menu { transition: transform .35s cubic-bezier(.2,.7,.3,1), opacity .3s ease; }
.mobile-menu.hidden-menu { transform: translateY(-12px); opacity: 0; pointer-events: none; }

/* =============================================================================
   RÉSEAUX SOCIAUX — boutons (section) + icônes (footer)
   ============================================================================= */
.social-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.3rem; border-radius: 40px;
  border: 1px solid var(--c-line); color: var(--c-cream);
  font-size: .9rem; font-weight: 600; letter-spacing: .01em;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), background .3s ease, border-color .3s ease, color .3s ease;
}
.social-btn svg { flex: 0 0 auto; transition: transform .3s ease; }
.social-btn:hover { transform: translateY(-3px); color: #fff; border-color: transparent; }
.social-btn:hover svg { transform: scale(1.1); }
/* Couleurs officielles au survol */
.social-instagram:hover { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.social-tiktok:hover    { background: #000; box-shadow: 0 0 0 1px #25F4EE inset, 3px 3px 0 -1px #FE2C55; }
.social-facebook:hover  { background: #1877F2; }
.social-label { line-height: 1; }

/* Icônes compactes du footer */
.social-ico {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); color: var(--c-muted);
  transition: transform .25s ease, color .25s ease, border-color .25s ease, background .25s ease;
}
.social-ico:hover { transform: translateY(-2px); color: var(--c-brass); border-color: var(--c-brass); }

/* =============================================================================
   STORIES — bulles circulaires (style Instagram) + visionneuse plein écran
   ============================================================================= */

/* ---- Rangée de bulles ---- */
.stories-row {
  display: flex; gap: 1.15rem; overflow-x: auto; padding: .5rem .25rem 1rem;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
/* En RTL, le défilement démarre à droite */
html[dir="rtl"] .stories-row { direction: rtl; }

.story-bubble {
  flex: 0 0 auto; scroll-snap-align: start; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  width: 88px; background: none; border: 0; padding: 0;
}
.story-ring {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  padding: 3px; /* épaisseur de la bordure gradient */
  background: conic-gradient(from var(--a,0deg), #c9a35b, #f4e0b0, #a8823f, #e9c877, #c9a35b);
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
}
/* Bordure gradient animée (rotation) */
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.story-ring { animation: ring-rotate 6s linear infinite; }
@keyframes ring-rotate { to { --a: 360deg; } }
/* Fallback navigateurs sans @property : dégradé statique doré (déjà lisible) */

.story-bubble:hover .story-ring,
.story-bubble:focus-visible .story-ring { transform: scale(1.06); }
.story-bubble:focus-visible { outline: none; }
.story-bubble:focus-visible .story-ring { box-shadow: 0 0 0 3px rgba(201,163,91,.35); }

.story-ring::after { /* anneau intérieur sombre (séparation) */
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 2px solid var(--c-ink); z-index: 1;
}
.story-thumb {
  position: relative; z-index: 0; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; display: block;
}
/* Bulle « déjà vue » : bordure grisée */
.story-bubble.seen .story-ring {
  background: #4a453d; animation: none;
}
.story-label {
  font-size: .72rem; color: var(--c-muted); text-align: center;
  max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.story-live {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: var(--c-brass); color: var(--c-ink); font-size: .58rem; font-weight: 700;
  letter-spacing: .06em; padding: 1px 7px; border-radius: 20px; text-transform: uppercase;
}

/* ---- Visionneuse plein écran ---- */
.story-viewer {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8,7,6,.94); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.story-viewer.open { display: flex; }
.sv-frame {
  position: relative; width: min(440px, 100vw); height: min(92vh, 860px);
  background: #000; border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
}
@media (max-width: 500px){ .sv-frame { width: 100vw; height: 100dvh; border-radius: 0; } }

.sv-stage { position: absolute; inset: 0; background: #000; }
/* La vidéo remplit tout le cadre (style Instagram) — AUCUN fond flouté.
   object-fit: cover = pas de bandes noires, image nette sur toute la surface. */
.sv-stage video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover; background: #000;
}

/* Barres de progression (segments) */
.sv-progress {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 6;
  display: flex; gap: 4px;
}
.sv-seg { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.sv-seg > i { display: block; height: 100%; width: 0%; background: #fff; border-radius: 3px; }
.sv-seg.done > i { width: 100%; }

/* En-tête (avatar + nom + fermer) */
.sv-head {
  position: absolute; top: 24px; left: 12px; right: 12px; z-index: 6;
  display: flex; align-items: center; gap: 10px; color: #fff;
}
.sv-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border:1.5px solid var(--c-brass); }
.sv-head .sv-name { font-size: .85rem; font-weight: 600; }
.sv-head .sv-cap { font-size: .72rem; opacity: .7; }
.sv-close {
  margin-inline-start: auto; width: 40px; height: 40px; display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.35); border-radius: 50%; color:#fff; border:0; cursor:pointer;
}
.sv-close:hover { background: rgba(0,0,0,.6); }

/* Zones de tap gauche/droite (navigation) */
.sv-tap { position: absolute; top: 0; bottom: 0; width: 35%; z-index: 4; cursor: pointer; }
.sv-tap-left { left: 0; }
.sv-tap-right { right: 0; }

/* Flèches (desktop) */
.sv-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border:0; cursor:pointer;
  background: rgba(0,0,0,.4); color:#fff; display:none; align-items:center; justify-content:center;
}
@media (min-width: 640px){ .story-viewer.open .sv-arrow { display:flex; } }
.sv-arrow:hover { background: rgba(0,0,0,.65); }
.sv-arrow-prev { left: -54px; }
.sv-arrow-next { right: -54px; }
@media (max-width: 760px){ .sv-arrow-prev{left:6px;} .sv-arrow-next{right:6px;} }

.sv-frame { animation: sv-in .28s cubic-bezier(.2,.7,.3,1); }
@keyframes sv-in { from { transform: scale(.92); opacity:0 } to { transform: scale(1); opacity:1 } }

@media (prefers-reduced-motion: reduce) {
  .story-ring { animation: none; }
  .sv-frame { animation: none; }
}
