
/* =====================================================
   BASE RESET
===================================================== */

.dis-fm-gallery-fix,
.dis-fm-gallery-fix *,
.dis-fm-gallery-fix *::before,
.dis-fm-gallery-fix *::after,
.dis-fm-gallery-fix__modal,
.dis-fm-gallery-fix__modal * {
  box-sizing: border-box;
}

.dis-fm-gallery-fix {
  display: block;
  width: 100%;

  margin: 0;
  padding: 0;

  background: #e9ecea;
  color: #242b2f;

  font-family: "Montserrat", Arial, sans-serif;
}

.dis-fm-gallery-fix__shell {
  width: calc(100% - 64px);
  max-width: 1400px;

  margin: 0 auto;
  padding: 105px 0 115px;
}


/* =====================================================
   SECTION HEADING
===================================================== */

.dis-fm-gallery-fix__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 30px;

  margin: 0 0 40px;
  padding: 0 0 28px;

  border-bottom: 1px solid rgba(36,43,47,.17);
}

.dis-fm-gallery-fix__eyebrow {
  display: flex;
  align-items: center;

  gap: 12px;
  margin: 0 0 20px;

  color: #a67837;

  font-size: 13px;
  font-weight: 700;

  line-height: 1.5;
  letter-spacing: 1.2px;
}

.dis-fm-gallery-fix__eyebrow span {
  display: block;

  flex: 0 0 50px;
  width: 50px;
  height: 2px;

  background: #c89644;
}

.dis-fm-gallery-fix h2 {
  margin: 0;
  padding: 0;

  color: #242b2f;

  font-family: "Oswald", Impact, sans-serif;
  font-size: clamp(45px, 4.2vw, 64px);
  font-weight: 600;

  line-height: 1.12;
  letter-spacing: -.4px;

  text-transform: none;
}

.dis-fm-gallery-fix__count {
  display: flex;
  align-items: center;

  flex: 0 0 auto;
  gap: 12px;

  color: #a77b39;

  font-family: "Oswald", sans-serif;
  font-size: 18px;
  font-weight: 500;
}

.dis-fm-gallery-fix__count i {
  width: 40px;
  height: 1px;

  background: rgba(36,43,47,.3);
}


/* =====================================================
   IMAGE GRID
===================================================== */

.dis-fm-gallery-fix__grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0,1fr));

  /*
    IMPORTANT:
    Do not stretch cards to equal heights.
    Each card uses its image's natural height.
  */
  align-items: start;

  gap: 20px;
  width: 100%;
}


/* =====================================================
   IMAGE CARD — AUTO HEIGHT
===================================================== */

.dis-fm-gallery-fix__item {
  position: relative;

  display: block;

  width: 100%;
  min-width: 0;

  /*
    IMPORTANT FIX:
    NO FIXED HEIGHT OR RATIO.
    The photograph determines its height.
  */
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;

  margin: 0;
  padding: 0;

  overflow: hidden;

  background: #d9ddda;

  border: 0;
  border-radius: 0;

  cursor: zoom-in;

  box-shadow: 0 15px 35px rgba(35,43,46,.08);

  line-height: 0;

  transition: box-shadow .25s ease;
}

.dis-fm-gallery-fix__item:hover {
  box-shadow: 0 24px 48px rgba(35,43,46,.15);
}


/* =====================================================
   IMAGE — KEEP COVER, USE NATURAL HEIGHT

   BEFORE:
   width:100%
   height:400px
   object-fit:cover

   AFTER:
   width:100%
   height:auto
   object-fit:cover

   RESULT:
   No forced crop. The full original image
   appears at its natural aspect ratio.
===================================================== */

.dis-fm-gallery-fix .dis-fm-gallery-fix__item > img {
  position: relative;

  display: block;

  width: 100%;
  height: auto;

  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: none;

  aspect-ratio: auto;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 0;

  object-fit: cover;
  object-position: center center;

  transform: none;
  filter: none;
}


/* =====================================================
   IMAGE NUMBER
===================================================== */

.dis-fm-gallery-fix__photo-number {
  position: absolute;
  z-index: 2;

  left: 20px;
  bottom: 20px;

  padding: 10px 13px;

  background: rgba(22,29,33,.83);
  color: #ffffff;

  font-family: "Oswald", Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;

  line-height: 1.2;
  letter-spacing: 1px;

  pointer-events: none;
}


/* =====================================================
   EXPAND ICON
===================================================== */

.dis-fm-gallery-fix__expand {
  position: absolute;
  z-index: 2;

  top: 20px;
  right: 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 52px;
  height: 52px;

  background: #d1a04a;
  color: #242b2f;

  pointer-events: none;
}

.dis-fm-gallery-fix__expand svg {
  width: 22px;
  height: 22px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.dis-fm-gallery-fix__item:hover .dis-fm-gallery-fix__expand {
  background: #e7bd73;
}

.dis-fm-gallery-fix__item:focus-visible {
  outline: 3px solid #b7863e;
  outline-offset: 4px;
}


/* =====================================================
   LIGHTBOX
===================================================== */

.dis-fm-gallery-fix__modal {
  position: fixed;

  width: calc(100% - 32px);
  max-width: 1280px;
  max-height: calc(100dvh - 32px);

  margin: auto;
  padding: 20px;

  background: #171f23;
  color: #ffffff;

  border: 1px solid rgba(209,160,74,.5);
  border-radius: 0;

  overflow: auto;
  font-family: "Montserrat", Arial, sans-serif;
}

.dis-fm-gallery-fix__modal:not([open]) {
  display: none;
}

.dis-fm-gallery-fix__modal[open] {
  display: block;
}

.dis-fm-gallery-fix__modal::backdrop {
  background: rgba(6,10,12,.95);
  backdrop-filter: blur(7px);
}

.dis-fm-gallery-fix__modal-panel {
  width: 100%;
}

.dis-fm-gallery-fix__modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
  margin: 0 0 15px;
}

.dis-fm-gallery-fix__modal-counter {
  color: #e0b66d;

  font-family: "Oswald", Arial, sans-serif;
  font-size: 20px;
  font-weight: 500;
}

.dis-fm-gallery-fix__close,
.dis-fm-gallery-fix__nav {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 50px;
  height: 50px;

  margin: 0;
  padding: 0;

  border-radius: 0;
  cursor: pointer;
}

.dis-fm-gallery-fix__close {
  width: 44px;
  height: 44px;

  background: #d1a04a;
  color: #20282c;

  border: 0;
}

.dis-fm-gallery-fix__nav {
  background: transparent;
  color: #e3b975;

  border: 1px solid rgba(224,181,101,.6);
}

.dis-fm-gallery-fix__close svg,
.dis-fm-gallery-fix__nav svg {
  width: 22px;
  height: 22px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.dis-fm-gallery-fix__modal-main {
  display: grid;

  grid-template-columns: 50px minmax(0,1fr) 50px;

  align-items: center;
  justify-items: center;

  gap: 15px;
  min-width: 0;
}

.dis-fm-gallery-fix__modal-image {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: calc(90dvh - 130px);

  margin: 0 auto;

  object-fit: contain;
  border: 0;
}

.dis-fm-gallery-fix__nav:hover {
  background: rgba(209,160,74,.17);
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1000px) {

  .dis-fm-gallery-fix__shell {
    width: calc(100% - 44px);
    padding: 85px 0 95px;
  }

  .dis-fm-gallery-fix__grid {
    gap: 16px;
  }

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 767px) {

  .dis-fm-gallery-fix__shell {
    width: calc(100% - 36px);
    padding: 70px 0 80px;
  }

  .dis-fm-gallery-fix__header {
    margin-bottom: 30px;
    padding-bottom: 22px;
  }

  .dis-fm-gallery-fix__eyebrow {
    font-size: 13px;
    letter-spacing: .5px;
  }

  .dis-fm-gallery-fix h2 {
    font-size: 40px;
  }

  .dis-fm-gallery-fix__count {
    display: none;
  }

  .dis-fm-gallery-fix__grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  /*
    No fixed mobile image height.
    Images continue using natural dimensions.
  */
  .dis-fm-gallery-fix__item {
    height: auto;
    aspect-ratio: auto;
  }

  .dis-fm-gallery-fix .dis-fm-gallery-fix__item > img {
    height: auto;
    object-fit: cover;
  }

  .dis-fm-gallery-fix__expand {
    top: 13px;
    right: 13px;

    width: 46px;
    height: 46px;
  }

  .dis-fm-gallery-fix__photo-number {
    left: 14px;
    bottom: 14px;

    font-size: 16px;
  }

  .dis-fm-gallery-fix__modal {
    width: calc(100% - 20px);
    padding: 14px;
  }

  .dis-fm-gallery-fix__modal-main {
    grid-template-columns: 1fr 1fr;
    gap: 13px;
  }

  .dis-fm-gallery-fix__modal-image {
    grid-column: 1 / -1;
    grid-row: 1;

    max-width: 100%;
    max-height: 65dvh;
  }

  .dis-fm-gallery-fix__prev {
    grid-column: 1;
    grid-row: 2;

    justify-self: end;
  }

  .dis-fm-gallery-fix__next {
    grid-column: 2;
    grid-row: 2;

    justify-self: start;
  }

}


/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 420px) {

  .dis-fm-gallery-fix__shell {
    width: calc(100% - 30px);
  }

  .dis-fm-gallery-fix h2 {
    font-size: 36px;
  }

}


/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  .dis-fm-gallery-fix__item {
    transition: none;
  }
}
