/* F.X.G — Galerie éditoriale : mosaïque à hauteurs naturelles, sans recadrage */
.fxg-gallery-module{
  --fxg-parchment:#FAF6F0;
  --fxg-chocolate:#23120B;
  --fxg-gold:#D4AF37;
  --fxg-secondary:#5C4332;
  --fxg-secondary-bg:#F4EDE2;
  color:var(--fxg-chocolate);
  font-family:"Times New Roman",Times,serif;
}

/* CSS columns crée une vraie mosaïque fluide : chaque photo garde sa hauteur */
.fxg-gallery-grid{
  display:block !important;
  column-count:var(--fxg-gallery-columns,4) !important;
  column-gap:clamp(12px,1.5vw,22px) !important;
  column-fill:balance;
  width:100%;
}
.fxg-gallery-card{
  display:inline-block !important;
  width:100% !important;
  margin:0 0 clamp(12px,1.5vw,22px);
  break-inside:avoid;
  page-break-inside:avoid;
  vertical-align:top;
}
/* Le bouton ne doit imposer aucun masque, aucune hauteur ni centrage interne.
   Les dimensions naturelles de la photo pilotent intégralement la carte. */
.fxg-gallery-open{
  all:unset !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  box-sizing:border-box !important;
  position:relative !important;
  display:block !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  min-width:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  aspect-ratio:auto !important;
  overflow:visible !important;
  line-height:0 !important;
  text-align:left !important;
  vertical-align:top !important;
  cursor:zoom-in !important;
  flex:none !important;
  align-self:start !important;
}
.fxg-gallery-open img{
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  max-width:100% !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  object-fit:initial !important;
  aspect-ratio:auto !important;
  transition:transform .45s ease;
}
.fxg-gallery-open:focus-visible{outline:2px solid var(--fxg-gold) !important;outline-offset:3px !important}
.fxg-gallery-open:hover img{transform:scale(1.012)}
.fxg-gallery-zoom{
  position:absolute;
  right:12px;
  bottom:12px;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  background:rgba(35,18,11,.82);
  color:var(--fxg-gold);
  font:26px/1 Arial,sans-serif;
  border:1px solid var(--fxg-gold);
  border-radius:50%;
  opacity:0;
  transition:opacity .2s ease;
}
.fxg-gallery-open:hover .fxg-gallery-zoom,
.fxg-gallery-open:focus-visible .fxg-gallery-zoom{opacity:1}
.fxg-gallery-caption{
  padding-top:8px;
  font-size:1rem;
  line-height:1.35;
  color:var(--fxg-secondary);
}
.fxg-gallery-recipe{
  display:inline-block;
  margin-top:6px;
  color:var(--fxg-secondary);
  text-decoration:none;
  border-bottom:1px solid var(--fxg-gold);
  font-size:.92rem;
  line-height:1.4;
}
.fxg-gallery-recipe:hover{color:var(--fxg-chocolate)}
.fxg-gallery-lightbox[hidden]{display:none}
.fxg-gallery-lightbox{
  position:fixed;
  z-index:2147483647 !important;
  inset:0;
  background:rgba(15,9,6,.96);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5vh 7vw;
}
.fxg-gallery-lightbox figure{
  margin:0;
  max-width:100%;
  max-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.fxg-gallery-full{
  display:block;
  max-width:100%;
  max-height:78vh;
  width:auto;
  height:auto;
  object-fit:contain;
  box-shadow:0 8px 45px rgba(0,0,0,.45);
}
.fxg-gallery-lightbox figcaption{
  display:flex;
  gap:22px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  color:var(--fxg-parchment);
  font-size:1.15rem;
  text-align:center;
  line-height:1.4;
}
.fxg-gallery-full-recipe{color:var(--fxg-gold);text-decoration:none;border-bottom:1px solid var(--fxg-gold)}
.fxg-gallery-close,.fxg-gallery-prev,.fxg-gallery-next{
  position:absolute;
  border:1px solid var(--fxg-gold);
  background:rgba(35,18,11,.85);
  color:var(--fxg-gold);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.fxg-gallery-close{top:20px;right:24px;width:48px;height:48px;border-radius:50%;font:36px/1 Arial,sans-serif}
.fxg-gallery-prev,.fxg-gallery-next{top:50%;transform:translateY(-50%);width:48px;height:64px;font:48px/1 "Times New Roman",serif}
.fxg-gallery-prev{left:18px}.fxg-gallery-next{right:18px}
.fxg-gallery-empty{padding:2rem;background:var(--fxg-secondary-bg);color:var(--fxg-secondary);text-align:center}
body.fxg-gallery-modal-open{overflow:hidden}

@media(max-width:1100px){.fxg-gallery-grid{column-count:3 !important}}
@media(max-width:700px){
  .fxg-gallery-grid{column-count:2 !important;column-gap:10px !important}
  .fxg-gallery-card{margin-bottom:10px}
  .fxg-gallery-caption{font-size:.94rem;padding-top:6px}
  .fxg-gallery-lightbox{padding:60px 12px 76px}
  .fxg-gallery-full{max-height:72vh}
  .fxg-gallery-prev,.fxg-gallery-next{top:auto;bottom:12px;transform:none;width:44px;height:44px;border-radius:50%;font-size:34px}
  .fxg-gallery-prev{left:calc(50% - 54px)}
  .fxg-gallery-next{right:calc(50% - 54px)}
  .fxg-gallery-close{top:calc(env(safe-area-inset-top, 0px) + 104px);right:14px;z-index:2147483647 !important}
}
@media(max-width:360px){.fxg-gallery-grid{column-count:2 !important;column-gap:8px !important}.fxg-gallery-card{margin-bottom:8px}}
@media(hover:none){.fxg-gallery-zoom{opacity:1;width:30px;height:30px;font-size:22px}}
@media(prefers-reduced-motion:reduce){.fxg-gallery-open img,.fxg-gallery-zoom{transition:none}}
