.gr-work-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gr-project {
  min-height: 430px;
  padding: 0 24px 24px;
  justify-content: flex-end;
  cursor: default;
}

.gr-project::before,
.gr-project::after {
  display: none;
}

.gr-project .project-image-button {
  display: block;
  position: relative;
  z-index: 2;
  width: calc(100% + 48px);
  height: 270px;
  margin: 0 -24px;
  padding: 10px 12px 0;
  overflow: hidden;
  border: 0;
  background: #f6f9fc;
  cursor: zoom-in;
}

.gr-project .project-image-button::after {
  content: 'Ver imagen completa';
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(9, 35, 63, .88);
  color: #fff;
  font: 700 11px/1 'Space Grotesk', sans-serif;
  opacity: 0;
  transform: translateY(5px);
  transition: .25s ease;
}

.gr-project .project-image-button:hover::after,
.gr-project .project-image-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.gr-project .project-image-button:focus-visible {
  outline: 3px solid #f56b1f;
  outline-offset: -3px;
}

.gr-project .project-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .4s ease;
}

.gr-project .project-image-button:hover img,
.gr-project .project-image-button:focus-visible img {
  transform: scale(1.035);
}

.gr-project small {
  min-height: 15px;
  margin-top: 20px;
  color: #f56b1f;
  font-size: 11px;
  letter-spacing: .08em;
}

.gr-project h3 {
  min-height: 52px;
  margin: 9px 0 0;
  font-size: clamp(22px, 2vw, 25px);
  line-height: 1.02;
}

.gr-project p {
  display: none;
}

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 18, 34, .88);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

body.project-lightbox-open {
  overflow: hidden;
}

.project-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.project-lightbox-dialog {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100dvh - 48px);
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
  transform: translateY(12px) scale(.98);
  transition: transform .25s ease;
}

.project-lightbox.is-open .project-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.project-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 90px);
  object-fit: contain;
  border-radius: 12px;
  background: #f6f9fc;
}

.project-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f56b1f;
  color: #fff;
  font: 700 25px/1 sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

@media (max-width: 850px) {
  .gr-work-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gr-project { min-height: 390px; }
  .gr-project .project-image-button {
    height: 190px;
    padding: 6px 10px 0;
  }
  .gr-project small { margin-top: 8px; }
  .gr-project h3 { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .gr-project .project-image-button img,
  .project-lightbox,
  .project-lightbox-dialog { transition: none; }
}
