.gwe-news-gallery {
  box-sizing: border-box;
  clear: both;
  margin: 1.5rem 0 1.75rem;
  padding: 1rem;
  border: 1px solid rgb(172 220 117 / 22%);
  border-radius: 16px;
  background: rgb(172 220 117 / 5%);
}

.gwe-news-gallery .gwe-news-gallery__header {
  margin: 0 0 .8rem;
}

.gwe-news-gallery .gwe-news-gallery__header .gwe-news-gallery__title {
  margin: 0 0 .2rem;
  padding: 0;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: #f2f5ed;
}

.gwe-news-gallery .gwe-news-gallery__header .gwe-news-gallery__hint {
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
  color: #bfd6ad;
}

.gwe-news-gallery .gwe-news-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.gwe-news-gallery .gwe-news-gallery__item {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.gwe-news-gallery .gwe-news-gallery__thumbnail {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: #243427;
  cursor: zoom-in;
  text-decoration: none;
}

/* This also overrides the full-article feed's later, broader image rule. */
.gwe-news-gallery .gwe-news-gallery__grid .gwe-news-gallery__thumbnail > img {
  display: block;
  width: 100%;
  height: 100% !important;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  transition: transform .18s ease;
}

.gwe-news-gallery .gwe-news-gallery__thumbnail:hover > img {
  transform: scale(1.04);
}

.gwe-news-gallery .gwe-news-gallery__thumbnail:focus-visible,
.gwe-news-image__link:focus-visible {
  outline: 3px solid #348b48;
  outline-offset: 3px;
}

.gwe-news-gallery .gwe-news-gallery__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .15rem;
  background: rgb(9 30 15 / 69%);
  color: #fff;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
}

.gwe-news-gallery .gwe-news-gallery__more > strong {
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  font-weight: 700;
}

.gwe-news-gallery .gwe-news-gallery__more > span {
  font-size: .8rem;
}

.gwe-news-gallery-source[hidden] {
  display: none !important;
}

.gwe-news-image__link {
  cursor: zoom-in;
}

body.gwe-news-lightbox-open {
  overflow: hidden;
}

dialog.gwe-news-lightbox {
  box-sizing: border-box;
  width: min(1200px, 96vw);
  max-width: none;
  max-height: 96vh;
  max-height: 96dvh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #111813;
  color: #fff;
  box-shadow: 0 20px 80px rgb(0 0 0 / 45%);
}

.gwe-news-lightbox::backdrop {
  background: rgb(0 0 0 / 88%);
}

.gwe-news-lightbox .gwe-news-lightbox__panel {
  display: flex;
  max-height: 96vh;
  max-height: 96dvh;
  flex-direction: column;
}

.gwe-news-lightbox .gwe-news-lightbox__toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
  padding: .25rem .5rem .25rem 1rem;
}

.gwe-news-lightbox .gwe-news-lightbox__count {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
}

.gwe-news-lightbox .gwe-news-lightbox__stage {
  position: relative;
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  overflow: hidden;
  background: #080c09;
  touch-action: pan-y pinch-zoom;
}

.gwe-news-lightbox .gwe-news-lightbox__stage > .gwe-news-lightbox__image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: calc(96vh - 154px);
  max-height: calc(96dvh - 154px);
  margin: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gwe-news-lightbox .gwe-news-lightbox__button {
  display: flex;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 50%;
  background: rgb(12 22 15 / 82%);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  appearance: none;
}

.gwe-news-lightbox .gwe-news-lightbox__button:hover {
  background: #28663a;
}

.gwe-news-lightbox .gwe-news-lightbox__button:focus-visible {
  outline: 3px solid #a5e8b4;
  outline-offset: 2px;
}

.gwe-news-lightbox .gwe-news-lightbox__previous,
.gwe-news-lightbox .gwe-news-lightbox__next {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
}

.gwe-news-lightbox .gwe-news-lightbox__previous {
  left: .65rem;
}

.gwe-news-lightbox .gwe-news-lightbox__next {
  right: .65rem;
}

.gwe-news-lightbox .gwe-news-lightbox__caption {
  flex: 0 0 auto;
  max-height: 12vh;
  overflow: auto;
  margin: 0;
  padding: .75rem 1rem 0;
  color: #f2f6f3;
  font-size: .93rem;
  line-height: 1.45;
  text-align: center;
}

.gwe-news-lightbox .gwe-news-lightbox__hint {
  flex: 0 0 auto;
  margin: 0;
  padding: .65rem 1rem .85rem;
  color: #b8c8bc;
  font-size: .78rem;
  line-height: 1.45;
  text-align: center;
}

.gwe-news-lightbox [hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .gwe-news-gallery {
    margin: 1rem 0 1.4rem;
    padding: .75rem;
    border-radius: 12px;
  }

  .gwe-news-gallery .gwe-news-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }

  dialog.gwe-news-lightbox {
    width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .gwe-news-lightbox .gwe-news-lightbox__panel {
    max-height: 100vh;
    max-height: 100dvh;
  }

  .gwe-news-lightbox .gwe-news-lightbox__stage > .gwe-news-lightbox__image {
    max-height: calc(100vh - 154px);
    max-height: calc(100dvh - 154px);
  }

  .gwe-news-lightbox .gwe-news-lightbox__previous { left: .35rem; }
  .gwe-news-lightbox .gwe-news-lightbox__next { right: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gwe-news-gallery .gwe-news-gallery__thumbnail > img {
    transition: none;
  }
}
