/* =====================================================================
   XB Photography — styles communs (accueil + portfolio)
   ===================================================================== */

:root {
  --bg: #0b0a08;
  --bg-2: #14120e;
  --ink: #f2ede3;
  --muted: #a39c8e;
  --line: rgba(242, 237, 227, 0.14);
  --gold: #d9a441;
  --gold-2: #f0c46a;
  --gold-ink: #1d1405;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --header-h: 76px;
}

* { box-sizing: border-box; }
/* Un élément marqué hidden reste caché, même s'il a un display (grid, flex…) dans les styles */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
/* Les ancres (#contact, #materiel…) arrivent sous l'en-tête fixe, pas dessous */
[id] { scroll-margin-top: var(--header-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { width: min(1280px, 100% - 48px); margin-inline: auto; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   En-tête : transparent sur la photo, opaque/flouté au défilement
   --------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.scrolled,
.site-header.menu-open {
  background: rgba(11, 10, 8, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.nav-logo img { height: 42px; width: auto; }
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a { position: relative; padding: 6px 0; transition: color 0.25s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s;
}
.nav-links a:hover::after,
.nav-links a[aria-current]::after { transform: scaleX(1); }
.nav-links a[aria-current] { color: var(--gold); }

/* Bouton menu mobile */
.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  position: relative;
}
.menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.menu-btn span:nth-child(1) { top: 16px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 26px; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Menu plein écran (mobile) */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 49;
  background: rgba(11, 10, 8, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1.25;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.45s, color 0.25s;
}
.mobile-menu.open a { transform: none; opacity: 1; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.05s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.2s; }
.mobile-menu a[aria-current],
.mobile-menu a:hover { color: var(--gold); }
.mobile-menu .mobile-socials {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 20px;
}
.mobile-menu .mobile-socials a { font: inherit; transform: none; opacity: 1; }

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
}
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-2); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------------------------------------------------------------------
   Pied de page
   --------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-footer img { height: 64px; width: auto; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--gold); }

/* ---------------------------------------------------------------------
   Visionneuse plein écran (accueil + portfolio)
   --------------------------------------------------------------------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 4, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.lb.open { opacity: 1; visibility: visible; }
.lb figure { margin: 0; max-width: min(1200px, 92vw); text-align: center; }
.lb img {
  max-width: 100%;
  max-height: 78vh;
  margin: auto;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: opacity 0.25s, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lb.open img { transform: none; }
.lb img.swap { opacity: 0; transform: scale(0.98); }
.lb figcaption { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.lb figcaption b { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.lb figcaption span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; color: var(--muted); }
.lb figcaption em { font-style: normal; color: var(--gold); margin-right: 10px; }
.lb button {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 10, 8, 0.5);
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.lb button:hover { border-color: var(--gold); color: var(--gold); }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }

/* ---------------------------------------------------------------------
   Bouton cœur "j'aime" (grille du portfolio + visionneuse)
   --------------------------------------------------------------------- */
.like-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(242, 237, 227, 0.25);
  background: rgba(11, 10, 8, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.share-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.like-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill 0.25s; }
.like-btn:hover,
.share-btn:hover { border-color: var(--gold); color: var(--gold); }
.like-btn[aria-pressed="true"] { color: var(--gold); border-color: rgba(217, 164, 65, 0.7); }
.like-btn[aria-pressed="true"] svg { fill: var(--gold); }
.like-btn.pop svg { animation: like-pop 0.45s cubic-bezier(0.2, 0.7, 0.2, 1.4); }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.like-count:empty { display: none; }
/* Visionneuse : même cœur que sur les miniatures, en haut à droite de la photo */
.lb .lb-media { position: relative; display: inline-block; max-width: 100%; }
.lb .lb-actions { position: absolute; z-index: 2; top: 12px; right: 12px; }
.lb .lb-actions:empty { display: none; }
.lb .like-btn {
  position: static;
  width: auto;
  height: auto;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(242, 237, 227, 0.25);
  background: rgba(11, 10, 8, 0.55);
  font-size: 12px;
}
.lb .like-btn:hover { border-color: var(--gold); }
.lb .like-btn[aria-pressed="true"] { border-color: rgba(217, 164, 65, 0.7); }

/* Invitation à liker */
.like-hint { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.like-hint svg { width: 18px; height: 18px; flex: none; fill: var(--gold); animation: heartbeat 2.4s ease-in-out infinite; }
.like-hint b { color: var(--ink); font-weight: 600; }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 10%, 30% { transform: scale(1.2); } 20% { transform: scale(1); } }

/* Visionneuse : outils (diaporama, partage), histoire, progression du diaporama */
.lb .lb-tools { position: absolute; top: 22px; left: 22px; display: flex; gap: 8px; z-index: 3; }
.lb .lb-tools button {
  position: static;
  width: auto;
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lb .lb-tools button[hidden] { display: none; }
.lb .lb-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb .lb-play svg { fill: currentColor; stroke: none; }
.lb.playing .lb-play { border-color: var(--gold); color: var(--gold); }
.lb-story {
  max-width: 640px;
  margin: 6px auto 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.5;
  color: #d3ccbf;
}
.lb-story:empty { display: none; }
.lb-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; opacity: 0; }
.lb-progress.run { opacity: 1; animation: lb-progress linear forwards; }
@keyframes lb-progress { to { transform: scaleX(1); } }

/* Notification temporaire ("Lien copié") */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 300;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Intro du logo (accueil, une fois par session) */
.intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--bg);
  animation: intro-out 0.7s ease 1.6s forwards;
}
.intro-done .intro { display: none; }
.intro-logo { width: min(260px, 60vw); display: grid; justify-items: center; gap: 22px; }
.intro-logo img { width: 100%; height: auto; clip-path: inset(0 100% 0 0); animation: intro-reveal 1.1s cubic-bezier(0.7, 0, 0.2, 1) 0.15s forwards; }
.intro-logo span { width: 100%; height: 1px; background: var(--gold); transform: scaleX(0); animation: intro-line 1.2s cubic-bezier(0.7, 0, 0.2, 1) 0.1s forwards; }
@keyframes intro-reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes intro-line { 50% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

/* Transitions douces entre les pages (navigateurs compatibles, sinon changement normal) */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.45s; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s, transform 1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .lb-prev, .lb-next { top: auto; bottom: 22px; transform: none; }
  .lb .lb-tools span { display: none; }
  .lb .lb-tools button { width: 44px; padding: 0; justify-content: center; }
  .lb-story { font-size: 16px; padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro { display: none; }
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Sélecteur de langue FR | EN */
.lang-switch,
.mobile-lang { display: flex; align-items: center; gap: 2px; }
.lang-switch { margin-left: -8px; }
.lang-switch button,
.mobile-lang button {
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s;
}
.lang-switch button:hover,
.mobile-lang button:hover { color: var(--gold); }
.lang-switch button[aria-pressed="true"],
.mobile-lang button[aria-pressed="true"] { color: var(--gold); border-color: rgba(217, 164, 65, 0.6); }
.mobile-lang { margin-top: 24px; }
.mobile-lang button { font-size: 14px; padding: 6px 12px; }
