/* ================================
   WORKS GALLERY PAGE
================================ */

.works-gallery-page {
  margin-top: 30px;
  margin-bottom: 60px;
}

.works-gallery-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.works-gallery-head__content {
  min-width: 0;
}

.works-gallery-head__label {
  margin: 0 0 10px;
  color: #b57a24;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.works-gallery-head__title {
  margin: 0;
  color: #1e1e1e;
  line-height: 1.12;
  font-weight: 400;
  text-transform: uppercase;
}

.works-gallery-head__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-width: 180px;
  padding: 16px 18px;
  background: #f8f4ee;
  border: 1px solid #e7e1d8;
}

.works-gallery-head__meta-number {
  color: #b57a24;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.works-gallery-head__meta-text {
  color: #555555;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
}

.works-gallery {
  margin-top: 0;
  margin-bottom: 34px;
}

.works-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 18px;
}

.works-gallery__item {
  position: relative;
  min-width: 0;
  margin: 0;
  background: #f3f0eb;
  border: 1px solid #e1e1e1;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.works-gallery__item:hover {
  transform: translateY(-3px);
  border-color: rgba(181, 122, 36, 0.48);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
}

.works-gallery__item.is-hidden {
  display: none;
}

.works-gallery__item--wide {
  grid-column: span 2;
}

.works-gallery__item--tall {
  grid-row: span 2;
}

.works-gallery__item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.works-gallery__link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.works-gallery__link img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  transform: scale(1.001);
  transition: transform 0.35s ease;
}

.works-gallery__item:hover .works-gallery__link img {
  transform: scale(1.055);
}

.works-gallery__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 30, 30, 0.38);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
}

.works-gallery__item:hover .works-gallery__overlay {
  opacity: 1;
  visibility: visible;
}

.works-gallery__zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  color: #b57a24;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: scale(0.92);
  transition: transform 0.22s ease;
}

.works-gallery__item:hover .works-gallery__zoom {
  transform: scale(1);
}

.works-gallery__more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.works-gallery__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 46px;
  padding: 0 28px;
  border: 1px solid #a86c1b;
  border-radius: 3px;
  background: linear-gradient(180deg, #c8953e 0%, #a86c1b 100%);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.works-gallery__more:hover {
  color: #000000;
  opacity: 0.9;
}

.works-gallery__more.is-hidden {
  display: none;
}

.works-gallery-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-top: 34px;
  padding: 34px 38px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
}

.works-gallery-cta__content {
  min-width: 0;
}

.works-gallery-cta__title {
  margin: 0 0 9px;
  color: #1e1e1e;
  font-size: 22px;
  line-height: 1.12;
  font-weight: 400;
  text-transform: uppercase;
}

.works-gallery-cta__text {
  max-width: 700px;
  margin: 0;
  color: #555555;
  font-size: 14px;
  line-height: 1.45;
}

.works-gallery-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 230px;
  min-height: 46px;
  padding: 0 26px;
  border: 1px solid #a86c1b;
  border-radius: 3px;
  background: linear-gradient(180deg, #c8953e 0%, #a86c1b 100%);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.works-gallery-cta__btn:hover {
  color: #000000;
  text-decoration: none;
  opacity: 0.9;
}

/* ================================
   MAGNIFIC POPUP CUSTOMIZATION
================================ */

.works-gallery-popup.mfp-wrap {
  z-index: 9999;
}

.works-gallery-popup .mfp-container {
  padding-left: 18px;
  padding-right: 18px;
}

.works-gallery-popup .mfp-figure:after {
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}

.works-gallery-popup .mfp-image-holder .mfp-close,
.works-gallery-popup .mfp-iframe-holder .mfp-close {
  right: 0;
  width: 44px;
  height: 44px;
  padding-right: 0;
  color: #ffffff;
  font-size: 38px;
  line-height: 44px;
  opacity: 1;
}

.works-gallery-popup .mfp-counter {
  right: 0;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.2;
}

.works-gallery-popup .mfp-arrow {
  opacity: 1;
}

.works-gallery-popup .mfp-arrow:before {
  border: 0;
}

.works-gallery-popup .mfp-arrow:after {
  border-top-width: 14px;
  border-bottom-width: 14px;
}

.mfp-fade.mfp-bg {
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
  opacity: 0.88;
}

.mfp-fade.mfp-bg.mfp-removing {
  opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
  opacity: 1;
  transform: translateY(0);
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
  opacity: 0;
  transform: translateY(8px);
}

/* ================================
   ADAPTIVE
================================ */

@media (max-width: 1199px) {
  .works-gallery__grid {
    grid-auto-rows: 165px;
    gap: 16px;
  }
}

@media (max-width: 991px) {
  .works-gallery-head {
    align-items: start;
  }

  .works-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 155px;
  }

  .works-gallery-cta {
    grid-template-columns: 1fr;
    padding: 28px 30px;
  }

  .works-gallery-cta__btn {
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 767px) {
  .works-gallery-page {
    margin-top: 18px;
    margin-bottom: 45px;
  }

  .works-gallery-head {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
  }

  .works-gallery-head__label {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .works-gallery-head__title {
    font-size: 24px;
  }

  .works-gallery-head__meta {
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
  }

  .works-gallery-head__meta-number {
    font-size: 28px;
  }

  .works-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 140px;
    gap: 12px;
  }

  .works-gallery__item:hover {
    transform: none;
    box-shadow: none;
  }

  .works-gallery__overlay {
    display: none;
  }

  .works-gallery__more-wrap {
    margin-top: 22px;
  }

  .works-gallery__more {
    width: 100%;
    min-height: 43px;
  }

  .works-gallery-cta {
    margin-top: 28px;
    padding: 22px 20px;
  }

  .works-gallery-cta__title {
    font-size: 18px;
  }

  .works-gallery-cta__text {
    font-size: 13px;
  }

  .works-gallery-cta__btn {
    max-width: none;
    min-height: 43px;
  }
}

@media (max-width: 480px) {
  .works-gallery__grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
  }

  .works-gallery__item--wide,
  .works-gallery__item--tall,
  .works-gallery__item--large {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 374px) {
  .works-gallery__grid {
    grid-auto-rows: 205px;
  }

  .works-gallery-head__title {
    font-size: 22px;
  }
}
