/* ==========================================================================
   Liste de cadeaux Les Bernadins — page publique
   Présentation en cartes inspirée de Listy, aux couleurs de l'invitation
   (ivoire, bordeaux, or ; Parisienne, Cinzel, Nunito Sans).
   ========================================================================== */
@font-face { font-family: "Parisienne"; font-weight: 400; font-display: swap; src: url("../fonts/parisienne-400.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-weight: 600; font-display: swap; src: url("../fonts/cinzel-600.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 600; font-display: swap; src: url("../fonts/nunito-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans-700.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --wine: #6d0a1b;
  --wine-2: #82192b;
  --wine-dark: #3d0812;
  --paper: #fffdf9;
  --ivory: #f6efe3;
  --sand: #efe5d4;
  --line: #e8dcc6;
  --gold: #c9a46b;
  --gold-light: #e9d1a0;
  --ink: #2f1f1b;
  --ink-soft: #7a665e;
  --ok: #2c6a3d;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(61, 8, 18, .05), 0 12px 30px -18px rgba(61, 8, 18, .35);
  --shadow-hover: 0 2px 4px rgba(61, 8, 18, .06), 0 22px 44px -22px rgba(61, 8, 18, .45);
  --script: "Parisienne", "Snell Roundhand", cursive;
  --display: "Cinzel", Georgia, serif;
  --body: "Nunito Sans", "Avenir Next", "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--ivory); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, p, ol, ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.heart { display: inline-block; width: .95em; height: .95em; vertical-align: -.12em; fill: currentColor; }

/* ---------- En-tête ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 14px 16px 0; text-align: center; }
.cover {
  position: relative; height: 210px; overflow: hidden; border-radius: 28px;
  background:
    radial-gradient(70% 120% at 50% 120%, rgba(233, 209, 160, .35) 0%, rgba(233, 209, 160, 0) 60%),
    radial-gradient(90% 140% at 50% -30%, #9a2335 0%, rgba(154, 35, 53, 0) 70%),
    linear-gradient(160deg, #5a0d1a 0%, #3d0812 100%);
}
.cover::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(246, 231, 204, .6) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(80% 80% at 50% 30%, #000 20%, transparent 80%);
  mask-image: radial-gradient(80% 80% at 50% 30%, #000 20%, transparent 80%);
}
/* Bandeau de photos : trois images collées côte à côte */
.cover--photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 380px; background: var(--wine-dark); }
.cover--photos::before { display: none; }
.cover--photos::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(30, 4, 10, 0) 55%, rgba(30, 4, 10, .38) 100%); }
.cover--photos img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; }
.cover--photos .p1, .cover--photos .p2 { object-position: 50% 20%; }
.cover--photos .p3 { object-position: 50% 65%; }
@media (max-width: 819px) { .cover--photos { height: 300px; } }
.cover-glow { position: absolute; left: 50%; top: 50%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; border: 1px solid rgba(233, 209, 160, .25); box-shadow: 0 0 0 40px rgba(233, 209, 160, .04), 0 0 0 90px rgba(233, 209, 160, .03); }
.seal {
  position: relative; z-index: 1; width: 88px; height: 88px; margin: -46px auto 0;
  border-radius: 50%; border: 5px solid var(--ivory);
  background: radial-gradient(circle at 35% 30%, #9b2235 0%, #6d0a1b 55%, #4a0812 100%);
  box-shadow: 0 12px 26px -12px rgba(61, 8, 18, .8), inset 0 0 0 6px rgba(233, 209, 160, .18);
  color: var(--gold-light); font: 600 34px/78px var(--display);
}
.eyebrow { margin-top: 14px; font-family: var(--display); font-size: 11.5px; letter-spacing: .26em; text-transform: uppercase; color: #94703e; }
.eyebrow .heart { color: var(--wine); }
.title { margin-top: 4px; font-family: var(--script); font-weight: 400; font-size: clamp(44px, 8vw, 66px); line-height: 1.1; color: var(--wine); }
.intro { max-width: 640px; margin: 10px auto 0; color: #5d4b45; white-space: pre-line; text-wrap: pretty; }

.steps { display: flex; justify-content: center; gap: 10px; margin: 22px auto 0; list-style: none; flex-wrap: wrap; }
.steps li {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: 14px; color: #5d4b45; text-align: left;
}
.steps strong { color: var(--ink); }
.step-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ivory); color: var(--wine); }
.step-icon svg { width: 18px; height: 18px; }

/* ---------- Barre : compteur et filtres ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 34px 16px 40px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.count { font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 38px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.chip span { margin-left: 2px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { border-color: var(--wine); background: var(--wine); color: #fff; }
.chip[aria-pressed="true"] span { color: var(--gold-light); }
.chip:focus-visible, .btn:focus-visible, .more:focus-visible { outline: 2px solid var(--wine-2); outline-offset: 2px; }

/* ---------- Cartes ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; list-style: none; }
@media (max-width: 1099px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 819px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 519px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.card {
  display: flex; flex-direction: column; min-width: 0; padding: 10px;
  border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  animation: cardIn .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
  .card:hover .media img { transform: scale(1.035); }
}
.media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 16px; background: var(--sand); }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s, opacity .4s; }
.placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--gold); background: radial-gradient(circle at 50% 40%, #fbf4e8 0%, var(--sand) 70%); }
.placeholder svg { width: 34%; height: 34%; }
.badge {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 20px); padding: 6px 12px; border-radius: 999px;
  background: rgba(61, 8, 18, .88); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.2;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge svg { flex: none; width: 15px; height: 15px; }
.is-mine .badge { background: linear-gradient(135deg, #f3dfb3 0%, #d6b27b 50%, #e6c98f 100%); color: var(--wine-dark); }
.is-taken:not(.is-mine) .media img { filter: grayscale(.8); opacity: .55; }
.is-taken:not(.is-mine) .placeholder { opacity: .55; }

.body { display: flex; flex: 1; flex-direction: column; padding: 14px 8px 6px; }
.name { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.shop { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 13px; color: var(--ink-soft); }
.shop svg { width: 13px; height: 13px; }
.desc {
  margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: #5d4b45; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.desc.is-open { display: block; -webkit-line-clamp: unset; }
.more { align-self: flex-start; margin-top: 2px; padding: 2px 0; border: 0; background: none; font-size: 13.5px; font-weight: 700; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.actions { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 10px 16px;
  border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { flex: none; width: 17px; height: 17px; }
.btn--primary { background: var(--wine); color: #fff; }
.btn--primary:hover { background: var(--wine-2); }
.btn--ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--wine); color: var(--wine); }
.btn--gold { background: linear-gradient(135deg, #f3dfb3 0%, #d6b27b 46%, #c59c60 54%, #ead1a0 100%); color: var(--wine-dark); }
.btn[disabled] { background: var(--sand); color: #9a8a80; cursor: not-allowed; transform: none; }
.btn--link { min-height: 36px; border: 0; background: none; color: var(--ink-soft); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn--link:hover { color: var(--wine); }

.card.is-flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 3px var(--gold), var(--shadow-hover); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.empty { padding: 50px 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); text-align: center; color: var(--ink-soft); }
.loading { display: flex; justify-content: center; gap: 8px; padding: 50px 0; }
.loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); animation: dot 1s ease-in-out infinite; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-6px); } }

/* ---------- Pied de page ---------- */
.foot { padding: 10px 16px calc(40px + env(safe-area-inset-bottom)); text-align: center; font-size: 13.5px; color: var(--ink-soft); }
.foot-sign { margin-bottom: 6px; font-family: var(--script); font-size: 30px; color: var(--wine); }

/* ---------- Fenêtre de confirmation ---------- */
.modal {
  width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: 26px;
  background: var(--paper); color: var(--ink); box-shadow: 0 40px 80px -30px rgba(30, 4, 10, .6);
}
.modal::backdrop { background: rgba(35, 6, 12, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-in { padding: 22px 22px 20px; text-align: center; }
.modal-media { width: 120px; height: 120px; margin: 0 auto 14px; overflow: hidden; border-radius: 20px; background: var(--sand); }
.modal-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.modal-media.is-icon { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: var(--wine-dark); background: linear-gradient(135deg, #f3dfb3 0%, #d6b27b 50%, #e6c98f 100%); }
.modal-media.is-icon svg { width: 34px; height: 34px; }
.modal-media.is-sorry { background: var(--sand); color: var(--wine); }
.modal-eyebrow { font-family: var(--display); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: #94703e; }
.modal-title { margin-top: 4px; font-size: 21px; line-height: 1.3; overflow-wrap: anywhere; }
.modal-text { margin-top: 8px; color: #5d4b45; }
.modal-actions { display: grid; gap: 8px; margin-top: 18px; }
.modal-note { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.modal-note:empty { display: none; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100% - 32px); padding: 11px 20px; border-radius: 999px; background: var(--wine-dark); color: #fff; font-weight: 600; font-size: 14.5px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 519px) {
  .cover { height: 150px; border-radius: 22px; }
  .cover--photos { height: 220px; }
  .seal { width: 76px; height: 76px; margin-top: -40px; font-size: 30px; line-height: 66px; }
  .steps { flex-direction: column; align-items: stretch; max-width: 360px; }
  .bar { flex-direction: column; align-items: stretch; }
  .chips { justify-content: space-between; }
  .chip { flex: 1 1 auto; padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
