/* ─────────────────────────────────────────
   gallery.css — Styles de La Galerie à Juju
   ───────────────────────────────────────── */

:root {
  --cream:   #f7f2ec;
  --ink:     #1c1812;
  --blush:   #d4a58a;
  --sage:    #8aad9f;
  --slate:   #9aa3b2;
  --paper:   #ede8e0;
  --shadow:  rgba(28, 24, 18, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Grain texture overlay ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
}

/* ─── Watercolor blob background ─── */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-blobs span {
  position: absolute;
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  filter: blur(60px);
  opacity: 0.18;
  animation: blobDrift 18s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { width: 520px; height: 420px; background: var(--blush); top: -80px; left: -120px; animation-duration: 22s; }
.bg-blobs span:nth-child(2) { width: 400px; height: 380px; background: var(--sage);  top: 40%;  right: -80px; animation-duration: 17s; animation-delay: -5s; }
.bg-blobs span:nth-child(3) { width: 300px; height: 280px; background: var(--slate); bottom: 0; left: 30%; animation-duration: 25s; animation-delay: -10s; }
@keyframes blobDrift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { transform: translate(30px, 20px) rotate(8deg) scale(1.05); }
}

/* ─── Header ─── */
header {
  position: relative;
  z-index: 10;
  padding: 80px 60px 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  animation: fadeDown 1.2s ease both;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.header-eyebrow {
  font-family: 'Raleway', sans-serif;
  font-weight: 200;
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--blush);
}
header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
header h1 em { font-style: italic; color: var(--blush); }
.header-subjuju {
  font-size: 0.45em;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  color: var(--blush);
  letter-spacing: 0.04em;
  display: block;
  margin-top: 0.1em;
}

/* ─── Gallery intro ─── */
.gallery-intro {
  position: relative;
  z-index: 10;
  padding: 0 60px 28px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 300;
  font-style: normal;
  color: #5a5248;
  line-height: 1.75;
  max-width: 620px;
  animation: fadeIn 1.4s ease 0.3s both;
}
.gallery-intro em { font-style: italic; color: var(--blush); }

/* ─── Divider ─── */
.divider {
  position: relative;
  z-index: 10;
  margin: 0 60px 50px;
  height: 1px;
  background: linear-gradient(to right, var(--blush), transparent);
  animation: fadeIn 1.5s ease 0.4s both;
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

/* ─── View toggle ─── */
.view-toggle {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 40px 32px;
}
.view-btn {
  padding: 7px 18px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid rgba(212,165,138,0.4);
  background: transparent;
  color: var(--slate);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.view-btn:first-child { border-radius: 2px 0 0 2px; }
.view-btn:last-child  { border-radius: 0 2px 2px 0; border-left: none; }
.view-btn.active {
  background: var(--blush);
  border-color: var(--blush);
  color: #fff;
}
.view-btn:not(.active):hover {
  border-color: var(--blush);
  color: var(--blush);
}

/* ─── Mode liste (petite galerie) ─── */
.gallery.list-view {
  columns: unset;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 40px 100px;
}
.gallery.list-view .card {
  margin-bottom: 0;
  animation: none;
}
.gallery.list-view .tape { display: none; }
.gallery.list-view .card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(28,24,18,0.06);
  padding: 10px 4px;
  background: transparent;
}
.gallery.list-view .card:hover .card-inner {
  transform: none;
  box-shadow: none;
  background: rgba(212,165,138,0.06);
}
.gallery.list-view .card-img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
}
.gallery.list-view .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery.list-view .card:hover .card-img img { transform: none; }
.gallery.list-view .card-caption {
  flex: 1;
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.gallery.list-view .card-title { font-size: 0.95rem; }
.gallery.list-view .card-meta  { font-size: 0.62rem; }

@media (max-width: 560px) {
  .view-toggle { padding: 0 20px 24px; }
  .gallery.list-view { padding: 0 20px 60px; }
}

/* ─── Gallery grid ─── */
.gallery {
  position: relative;
  z-index: 10;
  padding: 0 40px 100px;
  columns: 3;
  column-gap: 20px;
}

/* ─── Gallery card ─── */
.card {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  cursor: pointer;
  animation: riseUp 0.8s ease both;
}
.card:nth-child(1)  { animation-delay: 0.1s; }
.card:nth-child(2)  { animation-delay: 0.2s; }
.card:nth-child(3)  { animation-delay: 0.3s; }
.card:nth-child(4)  { animation-delay: 0.35s; }
.card:nth-child(5)  { animation-delay: 0.4s; }
.card:nth-child(6)  { animation-delay: 0.45s; }
.card:nth-child(7)  { animation-delay: 0.5s; }
.card:nth-child(8)  { animation-delay: 0.55s; }
.card:nth-child(9)  { animation-delay: 0.6s; }
@keyframes riseUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-inner {
  background: var(--paper);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: transform 0.4s cubic-bezier(.2,.8,.3,1), box-shadow 0.4s ease;
}
.card:hover .card-inner {
  transform: translateY(-6px) rotate(0.4deg);
  box-shadow: 0 16px 48px rgba(28,24,18,0.18);
}
.card-img {
  width: 100%;
  aspect-ratio: auto;
  display: block;
  position: relative;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.card:hover .card-img img { transform: scale(1.03); }
.card-placeholder { width: 100%; display: block; }
.card-caption {
  padding: 14px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
}
.card-meta {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate);
}
.tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 60px;
  height: 22px;
  background: rgba(212, 165, 138, 0.35);
  border-radius: 1px;
  z-index: 2;
  pointer-events: none;
}
.card:nth-child(even) .tape { transform: translateX(-50%) rotate(1.8deg); left: 40%; }

/* ─── Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20vh;
  background: rgba(28, 24, 18, 0.75);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox-content {
  position: relative;
  max-width: min(90vw, 780px);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(.2,.8,.3,1);
  -webkit-overflow-scrolling: touch;
}
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-content img,
.lightbox-content svg { max-width: 100%; display: block; }
.lightbox-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.4rem;
  color: var(--ink);
  cursor: pointer;
  opacity: 0.5;
  line-height: 1;
  transition: opacity 0.2s;
  z-index: 2;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-details {
  padding: 20px 28px 24px;
  border-top: 1px solid rgba(28,24,18,0.08);
}
.lb-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.45rem;
  margin-bottom: 14px;
  color: var(--ink);
}
.lb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.lb-field { display: flex; flex-direction: column; gap: 3px; }
.lb-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
}
.lb-value { font-size: 0.84rem; color: var(--ink); font-weight: 300; }
.lb-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.lb-badge.vendu  { background: rgba(192,57,43,0.1);   color: #c0392b; }
.lb-badge.vendre { background: rgba(138,173,159,0.2);  color: #3a7a68; }
.lb-badge.perso  { background: rgba(154,163,178,0.15); color: #5a6a7d; }
.lb-prix {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--blush);
  font-weight: 400;
}
.lb-share { margin-top: 14px; display: flex; justify-content: center; min-height: 28px; }
.lb-memo {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(28,24,18,0.07);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: center;
}

/* ─── Cart button (top bar) ─── */
.cart-btn {
  position: fixed;
  top: 28px;
  right: 90px;
  z-index: 500;
  background: var(--paper);
  border: 1px solid rgba(28,24,18,0.1);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px var(--shadow);
  color: var(--ink);
  transition: box-shadow 0.25s, background 0.25s;
  animation: popIn 0.35s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.cart-btn:hover { background: var(--cream); box-shadow: 0 4px 20px rgba(28,24,18,0.16); }
.cart-count {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--blush);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 600;
  width: 15px; height: 15px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.btn-cart-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--blush);
  border-radius: 2px;
  font-family: 'Raleway', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.lb-cart-action { margin-top: 16px; display: flex; justify-content: center; }
.btn-cart-add:hover  { background: var(--blush); color: #fff; }
.btn-cart-add.in-cart { background: var(--blush); color: #fff; }

/* ─── Cart modal items ─── */
.cart-empty {
  text-align: center;
  padding: 20px 0 10px;
  color: var(--slate);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(28,24,18,0.06);
}
.cart-item-thumb {
  width: 52px; height: 52px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--paper);
}
.cart-item-thumb img,
.cart-item-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-price { font-size: 0.75rem; color: var(--blush); margin-top: 2px; }
.cart-item-remove {
  background: none; border: none;
  font-size: 1rem; color: var(--slate);
  cursor: pointer; padding: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.cart-item-remove:hover { color: #c0392b; }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 4px;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--slate);
}
.cart-total strong {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink);
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
}
.btn-checkout {
  margin-top: 14px;
  width: 100%;
  padding: 12px;
  background: var(--blush);
  border: none;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.2s;
}
.btn-checkout:hover { opacity: 0.85; }

/* ─── Footer ─── */
footer {
  position: relative;
  z-index: 10;
  padding: 40px 60px;
  border-top: 1px solid rgba(28,24,18,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate);
}
footer a { color: var(--blush); text-decoration: none; }

/* ─── Hamburger button ─── */
.hamburger {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 500;
  background: var(--paper);
  border: 1px solid rgba(28,24,18,0.1);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 2px 12px var(--shadow);
  transition: box-shadow 0.25s, background 0.25s;
}
.hamburger:hover { background: var(--cream); box-shadow: 0 4px 20px rgba(28,24,18,0.16); }
.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── Slide-out nav menu ─── */
.nav-menu {
  position: fixed;
  top: 0; right: 0;
  z-index: 400;
  width: 220px;
  height: 100vh;
  background: var(--paper);
  border-left: 1px solid rgba(28,24,18,0.07);
  box-shadow: -8px 0 40px rgba(28,24,18,0.1);
  display: flex;
  flex-direction: column;
  padding: 100px 36px 48px;
  gap: 0;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(.4,0,.2,1);
}
.nav-menu.open { transform: translateX(0); }
.nav-menu a {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 0;
  letter-spacing: 0.02em;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 8px; left: 0;
  width: 0; height: 1px;
  background: var(--blush);
  transition: width 0.3s ease;
}
.nav-menu a:hover { color: var(--blush); }
.nav-menu a:hover::after { width: 100%; }
.nav-sep { margin: 14px 0; height: 1px; background: linear-gradient(to right, rgba(28,24,18,0.12), transparent); }
.nav-menu .nav-admin {
  font-size: 0.68rem;
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
}
.nav-menu .nav-admin:hover { color: var(--blush); }
.nav-menu .nav-admin::after { bottom: 6px; }
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 390;
  background: rgba(28,24,18,0.25);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.nav-backdrop.open { opacity: 1; pointer-events: all; }

/* ─── Modal popup ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28,24,18,0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--cream);
  border-radius: 4px;
  width: min(92vw, 500px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(28,24,18,0.25);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(.2,.8,.3,1);
  position: relative;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 32px 36px 20px;
  border-bottom: 1px solid rgba(28,24,18,0.07);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.modal-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.9rem;
}
.modal-close {
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  color: var(--slate); line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  padding: 28px 36px 36px;
  font-size: 0.88rem;
  line-height: 1.8;
  color: #4a4238;
}
.modal-body p + p { margin-top: 12px; }
.modal-body a { color: var(--blush); text-decoration: none; border-bottom: 1px solid var(--blush); }

/* ─── Contact form ─── */
.contact-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid rgba(28,24,18,0.12);
  border-radius: 2px;
  padding: 12px 14px;
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--blush); }
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form .btn-send {
  align-self: flex-start;
  padding: 10px 28px;
  background: transparent;
  border: 1px solid var(--blush);
  color: var(--ink);
  font-family: 'Raleway', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.25s, color 0.25s;
}
.contact-form .btn-send:hover { background: var(--blush); color: #fff; }
.form-success {
  display: none;
  font-size: 0.8rem;
  color: var(--sage);
  letter-spacing: 0.1em;
  margin-top: 6px;
}

/* ─── Responsive ─── */
@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 560px) {
  .gallery { columns: 1; padding: 0 20px 60px; }
  header { padding: 50px 24px 40px; }
  .divider { margin: 0 24px 36px; }
  .gallery-intro { padding: 0 24px 22px; font-size: 0.96rem; }
}
