.ees-gallery {
  --ees-navy: #0b2e4a;
  --ees-gold: #f7ca18;
  --ees-red: #c82028;
  --ees-muted: #3a4a58;
}

.ees-gallery-empty {
  margin: 0 0 28px;
  color: var(--ees-muted);
}

.ees-gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 128px;
  gap: 12px;
}

.ees-gallery-item {
  position: relative;
  display: block;
  min-height: 128px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--ees-navy);
  box-shadow: 0 10px 28px rgba(11, 46, 74, 0.12);
  text-decoration: none;
  color: #fff;
}

.ees-gallery-item:nth-child(8n+1) {
  grid-column: span 2;
  grid-row: span 2;
}

.ees-gallery-item:nth-child(8n+6) {
  grid-column: span 2;
}

.ees-gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.35s ease;
}

.ees-gallery-item:hover img,
.ees-gallery-item:focus img {
  transform: scale(1.06);
}

.ees-gallery-veil {
  position: absolute;
  inset: auto 0 0;
  padding: 36px 16px 14px;
  background: linear-gradient(180deg, rgba(11, 46, 74, 0) 0%, rgba(11, 46, 74, 0.78) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ees-gallery-item:hover .ees-gallery-veil,
.ees-gallery-item:focus .ees-gallery-veil {
  opacity: 1;
}

.ees-gallery-item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.ees-gallery-kicker,
.ees-gallery-card-kicker {
  margin: 0 0 6px;
  color: var(--ees-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ees-gallery-heading {
  margin: 0 0 8px;
  color: var(--ees-navy);
  font-family: "Myriad Pro", "Source Sans 3", Arial, sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
}

.ees-gallery-related {
  margin-top: 48px;
}

.ees-gallery-related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ees-gallery-related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 22px 24px;
  border: 1px solid rgba(11, 46, 74, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(11, 46, 74, 0.08);
  text-decoration: none;
}

.ees-gallery-related-title {
  color: var(--ees-navy);
  font-family: "Myriad Pro", "Source Sans 3", Arial, sans-serif;
  font-size: 22px;
}

.ees-gallery-related-text {
  color: var(--ees-muted);
  font-size: 15px;
  line-height: 1.5;
}

.ees-gallery-related-card:hover .ees-gallery-related-title {
  color: var(--ees-red);
}

.ees-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 46, 74, 0.92);
  padding: 48px 72px 64px;
}

.ees-gallery-lightbox[hidden] {
  display: none;
}

.ees-gallery-lightbox figure {
  margin: 0;
  max-width: min(1200px, 100%);
  text-align: center;
}

.ees-gallery-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.ees-gallery-lightbox figcaption {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
}

.ees-gallery-close,
.ees-gallery-prev,
.ees-gallery-next {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.ees-gallery-close {
  top: 16px;
  right: 22px;
  font-size: 42px;
}

.ees-gallery-prev,
.ees-gallery-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 54px;
  padding: 8px 12px;
}

.ees-gallery-prev { left: 12px; }
.ees-gallery-next { right: 22px; }

.ees-gallery-close:hover,
.ees-gallery-prev:hover,
.ees-gallery-next:hover {
  color: var(--ees-gold);
}

@media (max-width: 900px) {
  .ees-gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }
  .ees-gallery-item:nth-child(8n+1),
  .ees-gallery-item:nth-child(8n+6) {
    grid-column: span 1;
    grid-row: span 1;
  }
  .ees-gallery-item:nth-child(odd) {
    grid-row: span 1;
  }
  .ees-gallery-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ees-gallery-mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .ees-gallery-item:nth-child(8n+1),
  .ees-gallery-item:nth-child(8n+6) {
    grid-column: span 1;
    grid-row: span 1;
  }
  .ees-gallery-lightbox {
    padding: 56px 16px 48px;
  }
  .ees-gallery-prev,
  .ees-gallery-next {
    font-size: 40px;
  }
}
