/* Galerie MS Création Visuel — styles strictement limités à #realisations. */
#realisations.ms-gallery-section {
  --msg-forest: #263f36;
  --msg-forest-deep: #172c25;
  --msg-gold: #c9bd72;
  --msg-cream: #f7f4ea;
  --msg-ink: #18221e;
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1rem, 4vw, 4rem);
  background:
    radial-gradient(circle at 8% 12%, rgba(201, 189, 114, .2), transparent 28rem),
    linear-gradient(145deg, var(--msg-forest-deep), var(--msg-forest));
  color: var(--msg-cream);
}

#realisations.ms-gallery-section::before {
  content: "CRÉER";
  position: absolute;
  top: -0.08em;
  right: -0.04em;
  color: rgba(255, 255, 255, .035);
  font: 800 clamp(7rem, 21vw, 22rem)/.8 sans-serif;
  letter-spacing: -.08em;
  pointer-events: none;
}

#realisations .ms-gallery-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
}

#realisations .ms-gallery-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, .65fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

#realisations .ms-gallery-eyebrow {
  margin: 0 0 1rem;
  color: var(--msg-gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

#realisations .ms-gallery-title {
  max-width: 13ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 5.8rem);
  line-height: .97;
  letter-spacing: -.055em;
}

#realisations .ms-gallery-intro {
  max-width: 34rem;
  margin: 0;
  color: rgba(247, 244, 234, .76);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.75;
}

#realisations .ms-gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 clamp(2rem, 4vw, 3rem);
}

#realisations .ms-gallery-filter {
  min-height: 2.8rem;
  padding: .68rem 1rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--msg-cream);
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

#realisations .ms-gallery-filter:hover,
#realisations .ms-gallery-filter:focus-visible {
  border-color: var(--msg-gold);
  transform: translateY(-1px);
  outline: none;
}

#realisations .ms-gallery-filter[aria-pressed="true"] {
  border-color: var(--msg-gold);
  background: var(--msg-gold);
  color: var(--msg-forest-deep);
}

#realisations .ms-gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(.85rem, 1.6vw, 1.35rem);
}

#realisations .ms-gallery-item {
  grid-column: span 4;
  min-width: 0;
}

#realisations .ms-gallery-item:first-child,
#realisations .ms-gallery-item:nth-child(8) {
  grid-column: span 8;
}

#realisations .ms-gallery-item[hidden] {
  display: none;
}

#realisations .ms-gallery-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 27rem;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1.25rem;
  background: #0d1713;
  color: #fff;
  text-align: left;
  cursor: zoom-in;
  isolation: isolate;
  box-shadow: 0 1.3rem 3rem rgba(0, 0, 0, .22);
}

#realisations .ms-gallery-item:first-child .ms-gallery-card,
#realisations .ms-gallery-item:nth-child(8) .ms-gallery-card {
  min-height: 34rem;
}

#realisations .ms-gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 40%, rgba(7, 16, 12, .88) 100%);
}

#realisations .ms-gallery-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .3s ease;
}

#realisations .ms-gallery-card:hover img,
#realisations .ms-gallery-card:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

#realisations .ms-gallery-card:focus-visible {
  outline: 3px solid var(--msg-gold);
  outline-offset: 4px;
}

#realisations .ms-gallery-expand {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  background: rgba(16, 35, 28, .7);
  font-size: 1.15rem;
  backdrop-filter: blur(8px);
}

#realisations .ms-gallery-card-copy {
  position: absolute;
  right: 1.35rem;
  bottom: 1.35rem;
  left: 1.35rem;
  z-index: 2;
}

#realisations .ms-gallery-category {
  display: block;
  margin-bottom: .55rem;
  color: var(--msg-gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#realisations .ms-gallery-card-title {
  display: block;
  margin-bottom: .35rem;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  line-height: 1.08;
}

#realisations .ms-gallery-description {
  display: block;
  max-width: 42rem;
  color: rgba(255, 255, 255, .76);
  font-size: .88rem;
  line-height: 1.45;
}

#realisations .ms-gallery-status {
  margin: 1rem 0 0;
  color: rgba(247, 244, 234, .65);
  font-size: .82rem;
}

.ms-gallery-modal[hidden] {
  display: none;
}

.ms-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 3vw, 2rem);
  background: rgba(7, 14, 11, .92);
  backdrop-filter: blur(12px);
}

.ms-gallery-modal-dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, .38fr);
  width: min(1180px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border: 1px solid rgba(201, 189, 114, .34);
  border-radius: 1.25rem;
  background: #12251e;
  color: #f7f4ea;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .55);
}

.ms-gallery-modal-media {
  min-height: min(78vh, 780px);
  background: #09120f;
}

.ms-gallery-modal-image {
  width: 100%;
  height: 100%;
  max-height: min(82vh, 820px);
  object-fit: contain;
}

.ms-gallery-modal-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: clamp(1.5rem, 3vw, 3rem);
}

.ms-gallery-modal-title {
  margin: .55rem 0 .8rem;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.ms-gallery-modal-description {
  margin: 0;
  color: rgba(247, 244, 234, .72);
  line-height: 1.65;
}

.ms-gallery-modal-close {
  position: absolute;
  top: .8rem;
  right: .8rem;
  z-index: 3;
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(10, 24, 18, .86);
  color: #fff;
  font: 700 1.4rem/1 sans-serif;
  cursor: pointer;
}

.ms-gallery-modal-close:hover,
.ms-gallery-modal-close:focus-visible {
  border-color: #c9bd72;
  color: #c9bd72;
  outline: none;
}

body.ms-gallery-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  #realisations .ms-gallery-heading {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  #realisations .ms-gallery-item,
  #realisations .ms-gallery-item:first-child,
  #realisations .ms-gallery-item:nth-child(8) {
    grid-column: span 6;
  }

  #realisations .ms-gallery-card,
  #realisations .ms-gallery-item:first-child .ms-gallery-card,
  #realisations .ms-gallery-item:nth-child(8) .ms-gallery-card {
    min-height: 29rem;
  }

  .ms-gallery-modal-dialog {
    grid-template-columns: 1fr;
    width: min(100%, 42rem);
    overflow-y: auto;
  }

  .ms-gallery-modal-media {
    min-height: 0;
    height: min(52vh, 30rem);
  }

  .ms-gallery-modal-image {
    display: block;
    height: 100%;
  }
}

@media (max-width: 620px) {
  #realisations.ms-gallery-section {
    padding-inline: .85rem;
  }

  #realisations .ms-gallery-filters {
    flex-wrap: nowrap;
    margin-inline: -.85rem;
    padding: 0 .85rem .45rem;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  #realisations .ms-gallery-filter {
    flex: 0 0 auto;
  }

  #realisations .ms-gallery-item,
  #realisations .ms-gallery-item:first-child,
  #realisations .ms-gallery-item:nth-child(8) {
    grid-column: 1 / -1;
  }

  #realisations .ms-gallery-card,
  #realisations .ms-gallery-item:first-child .ms-gallery-card,
  #realisations .ms-gallery-item:nth-child(8) .ms-gallery-card {
    min-height: 28rem;
  }

  #realisations .ms-gallery-description {
    font-size: .84rem;
  }

  .ms-gallery-modal {
    padding: .45rem;
  }

  .ms-gallery-modal-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100vh - .9rem);
    border-radius: 1rem;
  }

  .ms-gallery-modal-media {
    flex: 0 0 auto;
    width: 100%;
    height: min(52vh, 25rem);
  }

  .ms-gallery-modal-copy {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 1.25rem;
  }

  .ms-gallery-modal-title {
    max-width: 100%;
    font-size: clamp(1.55rem, 8vw, 2.15rem);
    line-height: 1.05;
  }

  .ms-gallery-modal-description {
    font-size: .92rem;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  #realisations .ms-gallery-card img,
  #realisations .ms-gallery-filter {
    transition: none;
  }
}
