.ggw-gallery {
  --ggw-ink: #22261f;
  --ggw-green: #5f9e2e;
  --ggw-green-d: #4e8524;
  --ggw-line: #e6e6df;
  --ggw-muted: #7d8072;
  --ggw-tile-bg: #e8e8e0;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--ggw-ink);
  -webkit-font-smoothing: antialiased;
}

.ggw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
}

.ggw-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border: none;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: var(--ggw-tile-bg);
  text-align: left;
}

.ggw-tile-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  display: block;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.ggw-tile:hover .ggw-tile-img {
  transform: scale(1.05);
}

.ggw-tile-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(18, 20, 16, .74), rgba(18, 20, 16, .04) 58%);
  pointer-events: none;
}

.ggw-tile-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 18px;
}

.ggw-tile-info h3 {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  color: #fff;
  margin: 0;
  letter-spacing: -.01em;
}

.ggw-tile-open {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 2;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ggw-ink);
  background: #fff;
  padding: 6px 12px;
  border-radius: 3px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all .3s ease;
  pointer-events: none;
}

.ggw-tile:hover .ggw-tile-open {
  opacity: 1;
  transform: translateY(0);
}

.ggw-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(16, 18, 14, .86);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  animation: ggwFade .25s ease;
}

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

@keyframes ggwFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ggw-modal-panel {
  background: #fff;
  border-radius: 6px;
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: #22261f;
}

.ggw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
  border-bottom: 1px solid #e6e6df;
}

.ggw-modal-title {
  font-family: 'Spectral', Georgia, serif;
  font-weight: 500;
  font-size: 23px;
  margin: 0;
  letter-spacing: -.01em;
}

.ggw-close {
  background: none;
  border: 1px solid #e6e6df;
  border-radius: 3px;
  width: 38px;
  height: 38px;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  color: #22261f;
  flex: none;
  transition: all .2s;
}

.ggw-close:hover {
  border-color: #5f9e2e;
  color: #4e8524;
}

.ggw-modal-body {
  padding: 22px 26px;
  overflow-y: auto;
}

.ggw-stage {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e8e8e0;
}

.ggw-stage img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  display: block;
}

.ggw-nav-prev,
.ggw-nav-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, .9);
  color: #22261f;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.ggw-nav-prev:hover,
.ggw-nav-next:hover {
  background: #fff;
}

.ggw-nav-prev { left: 18px; }
.ggw-nav-next { right: 18px; }

.ggw-counter {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  color: #fff;
  background: rgba(18, 20, 16, .5);
  padding: 5px 10px;
  border-radius: 3px;
}

.ggw-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 1fr);
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ggw-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #e8e8e0;
  opacity: .55;
  transition: opacity .25s ease;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.ggw-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: contain !important;
  display: block;
}

.ggw-thumb:hover {
  opacity: .85;
}

.ggw-thumb.on {
  opacity: 1;
  outline-color: #5f9e2e;
}

.ggw-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid #e6e6df;
  flex-wrap: wrap;
}

.ggw-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .25s ease;
  white-space: nowrap;
}

.ggw-btn-ghost {
  color: #22261f;
  border-color: #e6e6df;
  padding: 11px 18px;
  background: #fff;
}

.ggw-btn-ghost:hover {
  border-color: #5f9e2e;
  color: #4e8524;
}

.ggw-btn-solid {
  background: #5f9e2e;
  color: #fff;
  padding: 12px 22px;
}

.ggw-btn-solid:hover {
  background: #4e8524;
}

.ggw-btn[hidden] {
  display: none;
}

body.ggw-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .ggw-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ggw-grid {
    grid-template-columns: 1fr;
  }
}
