
:root{
  --bg:#06172f;
  --bg2:#08224b;
  --panel:rgba(3,12,28,.68);
  --gold:#d9a63b;
  --gold-soft:#f1c765;
  --cream:#fff3d6;
  --line:rgba(233,180,72,.92);
  --shadow:0 0 28px rgba(255,190,80,.18);
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  font-family:"Cormorant Garamond", Georgia, serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(255,186,80,.08), transparent 20%),
    radial-gradient(circle at 78% 12%, rgba(255,186,80,.10), transparent 18%),
    linear-gradient(180deg, #0a2651 0%, #06172f 34%, #041020 100%);
  color:var(--cream);
  overflow-x:hidden;
}

.sky{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:0;
}

.star,.lantern{
  position:absolute;
  display:block;
}

.star{
  width:4px;
  height:4px;
  border-radius:50%;
  background:#ffd980;
  box-shadow:0 0 10px rgba(255,208,99,.9), 0 0 22px rgba(255,208,99,.45);
  animation:twinkle 3.6s ease-in-out infinite;
}
.s1{left:14%; top:10%}
.s2{left:28%; top:18%}
.s3{left:74%; top:11%}
.s4{left:86%; top:19%}
.s5{left:59%; top:15%}
.s6{left:9%; top:28%}

.lantern{
  width:24px;
  height:36px;
  display:grid;
  place-items:center;
  color:#fff6d9;
  font-size:13px;
  line-height:1;
  border-radius:48% 48% 42% 42% / 58% 58% 30% 30%;
  background:radial-gradient(circle at 50% 38%, #fff7d0 0 10%, #ffd46b 30%, #f3a837 58%, rgba(243,168,55,.22) 78%, transparent 79%);
  box-shadow:0 0 18px rgba(255,176,50,.6), 0 0 38px rgba(255,176,50,.25);
  opacity:.92;
  animation:floatLantern 6.5s ease-in-out infinite;
}
.l1{left:4%; top:12%; transform:scale(.95); animation-delay:0s}
.l2{right:5%; top:13%; transform:scale(.88); animation-delay:1.4s}
.l3{left:11%; top:26%; transform:scale(.72); animation-delay:.8s}
.l4{right:13%; top:27%; transform:scale(.68); animation-delay:2s}

@keyframes twinkle{
  0%,100%{opacity:.55; transform:scale(1)}
  50%{opacity:1; transform:scale(1.35)}
}

@keyframes floatLantern{
  0%,100%{transform:translateY(0) scale(var(--scale,1)); opacity:.88}
  50%{transform:translateY(-10px) scale(var(--scale,1)); opacity:1}
}

.page-shell{
  position:relative;
  z-index:1;
  max-width:1320px;
  margin:0 auto;
  padding:22px 18px 46px;
}

.hero{
  text-align:center;
  padding:22px 0 18px;
  position:relative;
}

.hero h1{
  margin:8px 0 0;
  font-family:"Bodoni Moda", serif;
  font-size:clamp(44px, 7vw, 88px);
  font-weight:600;
  line-height:1.02;
  color:var(--gold-soft);
  text-shadow:0 1px 0 rgba(0,0,0,.3);
}

.hero h2{
  margin:8px 0 0;
  font-size:clamp(27px, 4vw, 54px);
  font-weight:600;
  color:var(--gold-soft);
}

.ornament{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin:8px 0 4px;
}
.ornament i{
  width:120px;
  max-width:22vw;
  height:1px;
  background:linear-gradient(90deg, transparent 0%, rgba(233,180,72,.95) 25%, rgba(233,180,72,.95) 75%, transparent 100%);
  display:block;
}
.ornament b{
  color:var(--gold-soft);
  font-weight:600;
  font-size:24px;
}

.find-copy{
  margin:14px 0 18px;
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:clamp(21px, 2.6vw, 34px);
  line-height:1.08;
}

.search-wrap{
  position:relative;
  max-width:920px;
  margin:0 auto;
}

.search-icon{
  position:absolute;
  left:20px;
  top:50%;
  transform:translateY(-50%);
  width:28px;
  stroke:var(--gold-soft);
  fill:none;
  stroke-width:1.8;
  stroke-linecap:round;
}

.search-wrap input{
  width:100%;
  height:72px;
  border-radius:999px;
  border:2px solid var(--line);
  background:rgba(2,10,22,.78);
  color:var(--cream);
  font-family:"Cormorant Garamond", Georgia, serif;
  font-size:28px;
  padding:0 62px 0 62px;
  box-shadow:var(--shadow), inset 0 0 18px rgba(0,0,0,.25);
  outline:none;
}
.search-wrap input::placeholder{color:#e5d9bd}

#clearBtn{
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid var(--line);
  background:rgba(240,182,81,.16);
  color:var(--cream);
  font-size:26px;
  cursor:pointer;
  display:none;
}
#clearBtn.visible{display:block}

.status{
  min-height:28px;
  margin:12px 0 0;
  font-size:18px;
  color:#eadfca;
}

.show-all-btn{
  margin-top:8px;
  border:1px solid var(--line);
  background:rgba(240,182,81,.10);
  color:var(--cream);
  border-radius:999px;
  padding:10px 18px;
  font-family:"Cormorant Garamond", Georgia, serif;
  font-size:20px;
  cursor:pointer;
  display:none;
}
.show-all-btn.visible{display:inline-block}

.wall-layout{
  margin-top:22px;
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
  align-items:start;
}

.creation-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:18px;
}

.creation-card{
  border:1.5px solid var(--line);
  border-radius:18px;
  background:rgba(3,12,28,.58);
  padding:10px 10px 12px;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  color:var(--cream);
  box-shadow:0 0 0 rgba(0,0,0,0);
}
.creation-card:hover,
.creation-card:focus-visible,
.creation-card.selected{
  transform:translateY(-2px);
  outline:none;
  border-color:#ffd777;
  box-shadow:0 0 24px rgba(255,196,82,.25);
}

.thumb{
  display:block;
  width:100%;
  aspect-ratio:4/5;
  overflow:hidden;
  border-radius:13px;
  background:linear-gradient(180deg, rgba(20,48,96,.6) 0%, rgba(5,18,36,.88) 100%);
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.card-number{
  display:block;
  text-align:center;
  margin-top:6px;
  font-size:18px;
  line-height:1.1;
  font-weight:600;
  color:var(--gold-soft);
}

.card-label,
#featuredLabel,
#dialogLabel{
  display:none;
}

.featured{
  border:1.5px solid var(--line);
  border-radius:22px;
  background:var(--panel);
  padding:12px;
  box-shadow:var(--shadow);
  position:sticky;
  top:16px;
}

.featured-kicker{
  margin:2px 0 0;
  text-align:center;
  color:var(--gold-soft);
  font-size:22px;
  line-height:1.08;
}
.featured-kicker.en{
  margin-top:0;
  font-size:18px;
  color:#f6ebd5;
}

.featured-image-frame{
  margin-top:12px;
  border:1.4px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:#030d1d;
  min-height:320px;
  display:grid;
  place-items:center;
}
.featured-image-frame img{
  display:block;
  width:100%;
  height:auto;
  max-height:460px;
  object-fit:contain;
}

.featured-meta{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
}
#featuredNumber{
  font-size:34px;
  color:var(--gold-soft);
}

.wall-footer{
  text-align:center;
  margin-top:24px;
  color:#f2e6cd;
  font-size:18px;
  line-height:1.2;
}

.preview-dialog{
  border:1.5px solid var(--line);
  border-radius:20px;
  background:#06172f;
  color:var(--cream);
  padding:16px;
  max-width:min(92vw, 760px);
}
.preview-dialog::backdrop{
  background:rgba(0,0,0,.76);
}
.dialog-close{
  position:absolute;
  right:10px;
  top:8px;
  border:0;
  background:transparent;
  color:var(--gold-soft);
  font-size:34px;
  cursor:pointer;
}
.dialog-image-frame{
  display:grid;
  place-items:center;
}
.dialog-image-frame img{
  display:block;
  width:100%;
  max-height:75vh;
  object-fit:contain;
  border-radius:12px;
}
.dialog-meta{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
}
#dialogNumber{
  font-size:34px;
  color:var(--gold-soft);
}

@media (max-width: 900px) and (min-width: 641px){
  .wall-layout{
    grid-template-columns:1fr;
    gap:12px;
  }
  .creation-grid{grid-template-columns:repeat(3, minmax(0,1fr))}
  .featured{position:sticky; top:12px}
}

@media (max-width: 640px){
  .wall-layout{grid-template-columns:1fr;gap:14px}
  .featured{position:static}
}

@media (max-width: 760px){
  .card-number{font-size:16px}

  .hero h1{font-size:clamp(38px, 10vw, 62px)}
  .hero h2{font-size:clamp(25px, 6vw, 40px)}
  .find-copy{font-size:clamp(18px, 5.2vw, 26px)}
  .search-wrap input{height:62px;font-size:22px}
  .creation-grid{grid-template-columns:repeat(2, minmax(0,1fr));gap:14px}
  .featured-image-frame{min-height:280px}
}

/* v2-15: no permanent featured panel on the right */
.wall-layout{
  grid-template-columns:1fr !important;
}
.featured{
  display:none !important;
}
.creation-grid{
  width:100%;
}

/* v2-16 — recherche toujours accessible sur ordinateur/tablette.
   Le grand titre défile normalement; seule la zone de recherche reste visible. */
.search-sticky{
  position:sticky;
  top:0;
  z-index:20;
  text-align:center;
  margin:0 -18px;
  padding:12px 18px 14px;
  background:linear-gradient(180deg, rgba(6,23,47,.98) 0%, rgba(6,23,47,.94) 78%, rgba(6,23,47,.84) 100%);
  border-bottom:1px solid rgba(217,166,59,.30);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  backdrop-filter:blur(8px);
}

.search-sticky .find-copy{
  margin:0 0 10px;
  font-size:clamp(18px, 2.0vw, 27px);
}

.search-sticky .search-wrap input{
  height:62px;
  font-size:24px;
}

.search-sticky .status{
  margin-top:7px;
  min-height:20px;
  font-size:16px;
}

.search-sticky .show-all-btn{
  margin-top:5px;
  padding:7px 15px;
  font-size:18px;
}

@media (max-width: 640px){
  .search-sticky{
    position:static;
    margin:0;
    padding:6px 0 12px;
    background:transparent;
    border-bottom:0;
    box-shadow:none;
    backdrop-filter:none;
  }

  .search-sticky .find-copy{
    margin:8px 0 14px;
    font-size:clamp(18px, 5.2vw, 26px);
  }

  .search-sticky .search-wrap input{
    height:62px;
    font-size:22px;
  }
}

/* v2-17 — cacher l'ascenseur tout en conservant le défilement */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* v2-19 — modal mieux adapté à la hauteur de l'écran */
.modal-backdrop{
  align-items:center;
  padding:16px;
}

.modal-card{
  width:min(92vw, 760px);
  max-height:calc(100vh - 32px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.modal-card img,
.modal-card .modal-image{
  width:100%;
  height:auto;
  max-height:calc(100vh - 150px);
  object-fit:contain;
  display:block;
  margin:0 auto;
}

.modal-card .modal-number,
.modal-card .selected-number{
  flex:0 0 auto;
}

.modal-card .modal-close,
.modal-card .close-modal{
  position:absolute;
  top:10px;
  right:10px;
  z-index:5;
}

@media (max-width:640px){
  .modal-backdrop{
    padding:8px;
  }

  .modal-card{
    width:96vw;
    max-height:calc(100vh - 16px);
  }

  .modal-card img,
  .modal-card .modal-image{
    max-height:calc(100vh - 120px);
  }
}

/* V2-20 — Affichage complet de la création dans le Mur */
.dialog-image-frame{
  display:grid !important;
  place-items:center !important;
  overflow:hidden !important;
}

.dialog-image-frame img{
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:75vh !important;
  object-fit:contain !important;
  margin:0 auto !important;
}

.modal-card{
  width:min(92vw, 760px) !important;
  max-height:calc(100vh - 32px) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.modal-card img,
.modal-card .modal-image{
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:calc(100vh - 150px) !important;
  object-fit:contain !important;
  display:block !important;
  margin:0 auto !important;
}

@media (max-width:640px){
  .modal-card{
    width:96vw !important;
    max-height:calc(100vh - 16px) !important;
  }

  .modal-card img,
  .modal-card .modal-image{
    max-height:calc(100vh - 120px) !important;
  }
}

/* V2-21 — Affichage intégral renforcé de la création dans la fenêtre du Mur */
.modal,
.dialog,
.image-dialog{
  overflow:auto !important;
}

.modal-card,
.dialog-card{
  width:min(94vw, 760px) !important;
  max-height:92vh !important;
  overflow:auto !important;
}

.dialog-image-frame,
.modal-image-frame{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:visible !important;
  padding:8px !important;
  box-sizing:border-box !important;
}

.dialog-image-frame img,
.modal-image-frame img,
.modal-card > img,
.modal-card .modal-image,
.dialog-card > img{
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:calc(92vh - 90px) !important;
  object-fit:contain !important;
  object-position:center center !important;
  margin:0 auto !important;
}

@media (max-width:640px){
  .modal-card,
  .dialog-card{
    width:96vw !important;
    max-height:94vh !important;
  }

  .dialog-image-frame img,
  .modal-image-frame img,
  .modal-card > img,
  .modal-card .modal-image,
  .dialog-card > img{
    max-height:calc(94vh - 76px) !important;
  }
}

/* V2-22 — Ajustement pour intégration Squarespace :
   aucune barre blanche, image entière et numéro visible. */

.modal,
.dialog,
.image-dialog {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 8px !important;
}

.modal-card,
.dialog-card {
  width: min(92vw, 760px) !important;
  max-width: 92vw !important;
  height: auto !important;
  max-height: calc(100dvh - 16px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  scrollbar-width: none !important;
}

.modal-card::-webkit-scrollbar,
.dialog-card::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.dialog::-webkit-scrollbar,
.image-dialog::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.dialog-image-frame,
.modal-image-frame {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 6px !important;
  box-sizing: border-box !important;
}

.dialog-image-frame img,
.modal-image-frame img,
.modal-card > img,
.modal-card .modal-image,
.dialog-card > img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 100px) !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
}

html,
body {
  overflow: hidden !important;
  max-height: 100dvh !important;
}

@media (max-width: 640px) {
  .modal,
  .dialog,
  .image-dialog {
    padding: 5px !important;
  }

  .modal-card,
  .dialog-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: calc(100dvh - 10px) !important;
  }

  .dialog-image-frame img,
  .modal-image-frame img,
  .modal-card > img,
  .modal-card .modal-image,
  .dialog-card > img {
    max-height: calc(100dvh - 92px) !important;
  }
}

/* V2-23 — Correctif ciblé sur le vrai <dialog class="preview-dialog"> */
.preview-dialog{
  width:min(92vw, 760px) !important;
  max-width:92vw !important;
  max-height:calc(100dvh - 24px) !important;
  padding:12px !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  scrollbar-width:none !important;
}

.preview-dialog::-webkit-scrollbar{
  display:none !important;
  width:0 !important;
  height:0 !important;
}

.preview-dialog[open]{
  display:flex !important;
  flex-direction:column !important;
}

.preview-dialog .dialog-image-frame{
  flex:1 1 auto !important;
  min-height:0 !important;
  width:100% !important;
  overflow:hidden !important;
  padding:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.preview-dialog .dialog-image-frame img{
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:calc(100dvh - 120px) !important;
  object-fit:contain !important;
  margin:0 auto !important;
}

.preview-dialog .dialog-meta{
  flex:0 0 auto !important;
  margin-top:8px !important;
}

.preview-dialog .dialog-close{
  z-index:20 !important;
}

@media (max-width:640px){
  .preview-dialog{
    width:96vw !important;
    max-width:96vw !important;
    max-height:calc(100dvh - 12px) !important;
    padding:8px !important;
  }

  .preview-dialog .dialog-image-frame img{
    max-height:calc(100dvh - 105px) !important;
  }
}

/* V2-24 — Mur complet en affichage direct Vercel
   Corrige la page principale qui restait limitée en hauteur. */

html,
body {
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body {
  position: relative !important;
}

main,
.wall-page,
.wall-shell,
.page-shell,
.container,
.wall-container {
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.lantern-grid,
.wall-grid,
.grid,
.cards-grid {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

footer {
  position: static !important;
}

/* Le dialog garde son comportement validé en v2-23 */
.preview-dialog{
  max-height:calc(100dvh - 24px) !important;
  overflow:hidden !important;
}

/* V2-25 — Taille de la fenêtre de création stabilisée dans Squarespace
   Garde le Mur complet de v2-24, mais empêche la fenêtre d'image de devenir
   trop grande quand l'iframe Squarespace est haute. */

.preview-dialog{
  width:min(88vw, 700px) !important;
  max-width:88vw !important;
  max-height:min(calc(100dvh - 24px), 720px) !important;
  overflow:hidden !important;
  padding:10px !important;
  box-sizing:border-box !important;
}

.preview-dialog[open]{
  display:flex !important;
  flex-direction:column !important;
}

.preview-dialog .dialog-image-frame{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.preview-dialog .dialog-image-frame img{
  display:block !important;
  width:auto !important;
  height:auto !important;
  max-width:100% !important;
  max-height:min(calc(100dvh - 120px), 590px) !important;
  object-fit:contain !important;
  margin:0 auto !important;
}

.preview-dialog .dialog-meta{
  flex:0 0 auto !important;
  margin-top:8px !important;
}

@media (max-width:640px){
  .preview-dialog{
    width:94vw !important;
    max-width:94vw !important;
    max-height:min(calc(100dvh - 12px), 650px) !important;
    padding:8px !important;
  }

  .preview-dialog .dialog-image-frame img{
    max-height:min(calc(100dvh - 105px), 520px) !important;
  }
}

/* V2-26 — Squarespace auto-height integration */
html, body { height:auto !important; min-height:100% !important; max-height:none !important; overflow-x:hidden !important; overflow-y:visible !important; }
body { position:relative !important; }
main,.wall-page,.wall-shell,.page-shell,.container,.wall-container,.lantern-grid,.wall-grid,.grid,.cards-grid { height:auto !important; max-height:none !important; overflow:visible !important; }

/* V2-27 — Contact de retrait bien visible, sans changer les autres liens */
.wall-footer a,
.wall-footer a:visited {
  color: #ffda7e !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.wall-footer a:hover,
.wall-footer a:focus-visible { color: #fff3cf !important; }

/* V2-28 — Créations actives uniquement.
   Les trois pictogrammes originaux sont gérés par script.js.
   Aucun cœur ajouté par-dessus les photos. */

.creation-card {
  overflow: hidden;
}

.creation-card .thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 13px;
}

.creation-card .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1 !important;
}

.creation-card .thumb::before,
.creation-card .thumb::after {
  content: none !important;
  display: none !important;
}

.creation-card .card-number,
.creation-card .card-label {
  display: none !important;
}

/* Message bilingue lorsqu'aucune création n'est active */

.empty-wall-message {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 850px;
  padding: 36px 16px 46px;
  text-align: center;
  color: #f1c765;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(22px, 3vw, 32px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
}

.empty-wall-message span {
  display: block;
}

.empty-wall-message span + span {
  margin-top: 8px;
}
