/* =========================================================
   Karim Akh el Arab — Feuille de style
   Ambiance : galerie d'art contemporaine, chaleureuse et
   sophistiquée. Le caractère vient du contraste (sombre/crème),
   de la typographie et du relief — pas d'une surcharge de couleurs.
   Palette volontairement neutre + un seul accent bronze, pour
   servir aussi bien le figuratif que l'abstrait.

   Pour modifier les couleurs/polices : voir :root ci-dessous.
   ========================================================= */

:root {
  --paper:     #f4f0e8;   /* fond principal, crème chaud */
  --paper-2:   #ebe5d8;   /* fond alterné, sable doux */
  --dark:      #20201c;   /* fond sombre (hero, pied de page) */
  --dark-2:    #2c2b25;   /* surface sombre secondaire */
  --ink:       #211f1a;   /* texte principal sur clair */
  --ink-soft:  #6c665b;   /* texte secondaire */
  --cream:     #f4f0e8;   /* texte sur fond sombre */
  --cream-soft:#c9c2b3;   /* texte secondaire sur sombre */
  --line:      #ddd5c5;   /* filets sur clair */
  --line-dark: #44423a;   /* filets sur sombre */
  --accent:    #b07a3a;   /* bronze — l'unique touche de couleur */
  --accent-dk: #8c5f29;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans:  "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1220px;
  --gap:  clamp(1.1rem, 3vw, 2.4rem);
  --shadow:   0 18px 45px -20px rgba(33,31,26,.45);
  --shadow-sm:0 10px 28px -16px rgba(33,31,26,.35);
}

/* ----- Réinitialisation douce ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Empêche tout débordement horizontal (menu hors-écran, liserés décoratifs)
   qui rendait la page plus large que l'écran sur mobile. 'clip' ne casse pas
   le position: sticky de l'en-tête (contrairement à overflow:hidden). */
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.2rem, 5vw, 3.2rem); }

/* ----- Titres ----- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.08; margin: 0; }
em { font-style: italic; }

/* ----- Intitulé éditorial (eyebrow) ----- */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--font-sans); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .2em; color: var(--accent);
  margin-bottom: 1rem;
}
.section-eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--accent); opacity: .7; }

/* =========================================================
   En-tête / navigation
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,240,232,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; }
.logo {
  font-family: var(--font-serif);
  font-size: 1.45rem; letter-spacing: .015em; font-weight: 600;
}
.nav-list { list-style: none; display: flex; gap: 2.1rem; margin: 0; padding: 0; }
.nav-list a {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-soft); position: relative; padding-bottom: 4px;
  transition: color .2s;
}
.nav-list a:hover, .nav-list a.active { color: var(--ink); }
.nav-list a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--accent); transition: width .25s ease;
}
.nav-list a:hover::after, .nav-list a.active::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; width: 30px; height: 22px; position: relative; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .25s ease, opacity .2s ease; transform-origin: center; }
/* Hamburger -> croix quand le menu est ouvert */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero — sombre, en deux colonnes, avec œuvre encadrée
   ========================================================= */
.hero { background: var(--dark); color: var(--cream); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.hero-eyebrow {
  text-transform: uppercase; letter-spacing: .26em; font-size: .72rem;
  color: var(--accent); margin: 0 0 1.6rem;
}
.hero-title { font-size: clamp(3rem, 7vw, 5.6rem); letter-spacing: -.01em; }
.hero-title em { color: var(--accent); font-weight: 400; }
.hero-text { font-size: 1.16rem; color: var(--cream-soft); max-width: 46ch; margin: 1.8rem 0 2.6rem; font-weight: 300; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-figure { margin: 0; position: relative; }
.hero-figure img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
  border: 1px solid var(--line-dark);
}
.hero-figure::before {
  content: ""; position: absolute; inset: -14px;
  border: 1px solid var(--accent); opacity: .35; pointer-events: none;
}
.hero-figure figcaption {
  font-family: var(--font-serif); font-style: italic;
  color: var(--cream-soft); font-size: 1rem; margin-top: 1.1rem; text-align: right;
}

/* ----- Boutons ----- */
.btn {
  display: inline-block; padding: .9rem 1.9rem; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .14em; transition: all .22s;
  border: 1px solid currentColor;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--cream); }
.btn-ghost:hover { background: var(--cream); color: var(--dark); }

/* Boutons clairs (sur fond crème, ex. hors hero si besoin) */
.section .btn-ghost { color: var(--ink); }
.section .btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-alt { background: var(--paper-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 3rem; flex-wrap: wrap; gap: 1rem; }
.section-head .section-eyebrow { margin-bottom: .6rem; }
.section-title { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
.section-link {
  color: var(--ink); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--accent); padding-bottom: 3px; transition: color .2s, gap .2s;
}
.section-link:hover { color: var(--accent); }

/* =========================================================
   Grille de galerie
   ========================================================= */
.grid-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--gap);
}
.card { display: block; cursor: pointer; }
.card-media {
  position: relative; overflow: hidden; background: var(--paper-2);
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-sm); transition: box-shadow .35s, transform .35s;
}
.card:hover .card-media { box-shadow: var(--shadow); transform: translateY(-4px); }
.card-media img {
  width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 0;
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.card:hover .card-media img { transform: scale(1.05); }
/* Voile + invitation au survol */
.card-media::after {
  content: "Voir l'œuvre";
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 1.4rem;
  background: linear-gradient(to top, rgba(20,18,14,.6), rgba(20,18,14,.05) 45%, transparent 70%);
  color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .2em;
  opacity: 0; transition: opacity .35s;
}
.card:hover .card-media::after { opacity: 1; }
.card-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--accent); color: #fff;
  font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .35rem .7rem;
}
.card-badge.badge-muted { background: var(--ink-soft); }
.card-views {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(20,18,14,.65); color: #fff;
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .32rem .6rem; backdrop-filter: blur(4px);
}
.card-body { padding: 1.1rem .2rem 0; }
.card-title { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.15; }
.card-meta { color: var(--ink-soft); font-size: .9rem; margin-top: .3rem; }
.card-price { font-size: .95rem; margin-top: .45rem; letter-spacing: .02em; color: var(--accent-dk); font-weight: 400; }
.card-price.sold { color: var(--ink-soft); }

/* =========================================================
   Filtres (galerie)
   ========================================================= */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 3rem; }
.filter-btn {
  background: transparent; border: 1px solid var(--line);
  padding: .55rem 1.2rem; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); transition: all .2s; border-radius: 999px;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* =========================================================
   À propos
   ========================================================= */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4rem); align-items: start; }
.about-media { display: flex; flex-direction: column; gap: 1.2rem; }
.about-media img { width: 100%; height: auto; display: block; box-shadow: var(--shadow); }
.about-expo { margin: 0; }
.about-expo figcaption { font-family: var(--font-serif); font-style: italic; color: var(--ink-soft); font-size: .95rem; margin-top: .5rem; }
.about-text p { color: var(--ink-soft); margin: 1.1rem 0 0; font-size: 1.05rem; }
.about-text .section-title { margin-bottom: .3rem; }
.about-note { font-size: .85rem; }

/* =========================================================
   "Comment ça se passe" (étapes)
   ========================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-top: 2.5rem; }
.step { border-top: 2px solid var(--accent); padding-top: 1.4rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 1.1rem; color: var(--accent-dk);
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%;
  margin-bottom: .9rem;
}
.step h3 { font-size: 1.5rem; margin-bottom: .5rem; }
.step p { color: var(--ink-soft); margin: 0; }

/* =========================================================
   Newsletter
   ========================================================= */
.newsletter { margin-top: 3rem; padding-top: 2.2rem; border-top: 1px solid var(--line); }
.newsletter h3 { font-size: 1.6rem; }
.newsletter p { color: var(--ink-soft); margin: .4rem 0 1.2rem; }
.newsletter-form { display: flex; gap: .7rem; flex-wrap: wrap; max-width: 480px; }
.newsletter-form input {
  flex: 1 1 220px; font-family: inherit; font-size: 1rem; padding: .8rem .95rem;
  border: 1px solid var(--line); background: #fffdf8; color: var(--ink);
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176,122,58,.15); }
.newsletter-form .btn { border: 0; }

/* Message de remerciement après envoi d'un formulaire */
.form-success {
  padding: 1.1rem 1.35rem; border-left: 3px solid var(--accent);
  background: #fffdf8; color: var(--ink); font-size: 1.08rem; line-height: 1.5;
  box-shadow: var(--shadow-sm);
}
.form-success strong { color: var(--accent-dk); }

/* =========================================================
   Contact
   ========================================================= */
.contact { max-width: 760px; }
.contact-lead { color: var(--ink-soft); font-size: 1.18rem; margin: 1rem 0 2.6rem; max-width: 52ch; }
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.contact-form label { display: flex; flex-direction: column; gap: .45rem; }
.contact-form span { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); }
.contact-form input, .contact-form textarea {
  font-family: inherit; font-size: 1rem; padding: .8rem .95rem;
  border: 1px solid var(--line); background: #fffdf8; color: var(--ink);
  border-radius: 0; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176,122,58,.15);
}
.contact-form .btn { align-self: flex-start; }
.contact-alt { margin-top: 1.9rem; color: var(--ink-soft); }
.contact-alt a { color: var(--accent-dk); border-bottom: 1px solid var(--line); }
.contact-location { margin-top: .8rem; color: var(--ink-soft); font-size: .95rem; }

.socials { margin-top: 2rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.social-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.4rem; border-radius: 999px; color: #fff;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.social-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.2); opacity: .96; }
.social-whatsapp { background: #25d366; }
.social-instagram { background: linear-gradient(45deg, #f09433, #e6683c 30%, #dc2743 55%, #bc1888 90%); }

/* =========================================================
   En-tête de page interne (galerie)
   ========================================================= */
.page-head { background: var(--dark); color: var(--cream); padding-block: clamp(3.5rem, 8vw, 5.5rem); }
.page-title { font-size: clamp(2.6rem, 6vw, 4.2rem); }
.page-title em { color: var(--accent); }
.page-subtitle { color: var(--cream-soft); margin-top: .7rem; font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; }

/* =========================================================
   Pied de page — sombre
   ========================================================= */
.site-footer { background: var(--dark); color: var(--cream-soft); padding-block: 2.4rem; margin-top: 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; font-size: .85rem; }
.footer-inner a { color: var(--cream); }
.footer-inner a:hover { color: var(--accent); }

/* =========================================================
   Lightbox (visionneuse plein écran)
   ========================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18,16,12,.96);
  display: none; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox.open { display: flex; }
.lightbox-figure {
  margin: 0; width: 92vw; max-width: 1100px; height: 88vh; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
/* La "scène" prend la hauteur restante (hauteur DÉFINIE héritée de la figure) ;
   l'image s'y adapte sans déborder ni pousser la légende. */
.lightbox-stage { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lightbox-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 70px -20px rgba(0,0,0,.8); }
.lightbox-thumbs, .lightbox-figure figcaption, .lightbox-actions { flex: 0 0 auto; }
.lightbox-figure figcaption { color: #efe9df; font-family: var(--font-serif); font-size: 1.3rem; }
.lightbox-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.lb-btn {
  display: inline-block; padding: .65rem 1.4rem; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .12em; border: 1px solid transparent;
  border-radius: 999px; transition: all .2s; cursor: pointer;
}
.lb-btn-primary { background: var(--accent); color: #fff; }
.lb-btn-primary:hover { background: var(--accent-dk); }
.lb-btn-share { background: transparent; color: #efe9df; border-color: rgba(239,233,223,.45); }
.lb-btn-share:hover { border-color: #efe9df; }
.lightbox-figure figcaption small { display: block; font-family: var(--font-sans); font-size: .82rem; color: #b3ada4; margin-top: .3rem; letter-spacing: .03em; }
.lightbox-thumbs { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.lb-thumb { width: 62px; height: 62px; padding: 0; border: 1px solid var(--line-dark); background: none; opacity: .5; overflow: hidden; cursor: pointer; transition: opacity .2s, border-color .2s; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: .85; }
.lb-thumb.active { opacity: 1; border-color: var(--accent); }
.lightbox-close, .lightbox-nav {
  position: absolute; background: none; border: 0; color: #fff;
  font-size: 2.4rem; line-height: 1; opacity: .75; transition: opacity .2s, color .2s; padding: .4rem .8rem;
}
.lightbox-close:hover, .lightbox-nav:hover { opacity: 1; color: var(--accent); }
.lightbox-close { top: 1rem; right: 1.4rem; font-size: 2.8rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 3rem; }
.lightbox-prev { left: .6rem; }
.lightbox-next { right: .6rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 420px; }
  .hero-figure figcaption { text-align: left; }
  .about { grid-template-columns: 1fr; }
  .about-media::before { display: none; }
}
@media (max-width: 760px) {
  /* IMPORTANT : pas de backdrop-filter ici. Un filtre sur l'en-tête ferait de
     lui le "cadre de référence" du menu fixe (qui se collerait alors en haut de
     la PAGE au lieu de l'ÉCRAN). On met un fond crème opaque à la place. */
  .site-header { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* Bouton au-dessus du menu plein écran (les deux sont dans le <header>) */
  .nav-toggle { display: block; position: relative; z-index: 30; }
  /* Menu plein écran opaque : couvre tout le contenu derrière */
  .nav-list {
    position: fixed; inset: 0; z-index: 20;
    width: 100%; height: 100vh; height: 100dvh;
    margin: 0; padding: 0; border: 0; box-shadow: none;
    background: var(--paper);
    flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem;
    transform: translateX(100%); transition: transform .32s ease;
  }
  .nav-list.open { transform: translateX(0); }
  .nav-list a {
    font-family: var(--font-serif); font-size: 1.9rem; letter-spacing: .02em;
    text-transform: none; color: var(--ink);
  }
  .nav-list a::after { height: 2px; }
  .form-row { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
  .steps { grid-template-columns: 1fr; gap: 1.8rem; }
  /* Sections plus compactes sur mobile (moins de scroll) */
  .section { padding-block: clamp(2.2rem, 7vw, 3.4rem); }
  .hero-grid { padding-block: clamp(2.4rem, 9vw, 3.8rem); }
}

/* ----- Téléphones : galerie en 2 colonnes (vue d'ensemble) ----- */
@media (max-width: 600px) {
  .grid-gallery { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .card-body { padding: .6rem .1rem 0; }
  .card-title { font-size: 1.15rem; }
  .card-meta { font-size: .76rem; }
  .card-price { font-size: .82rem; }
  .filters { gap: .4rem; margin-bottom: 1.8rem; }
  .filter-btn { padding: .42rem .8rem; font-size: .68rem; }
}

/* Apparition douce des cartes */
@media (prefers-reduced-motion: no-preference) {
  .card { opacity: 0; transform: translateY(16px); animation: fade-up .65s forwards; }
  @keyframes fade-up { to { opacity: 1; transform: none; } }
}
