/*======== Villa gallery (grid + lightbox slideshow) ===========*/
#gallery-section {
  padding-bottom: 80px;
}

.vg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}
.vg-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: #ddd;
  aspect-ratio: 3 / 2;
  cursor: zoom-in;
}
/* first photo is the big "hero" tile */
.vg-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}
.vg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, filter .4s ease;
}
.vg-item:hover img,
.vg-item:focus-visible img {
  transform: scale(1.05);
  filter: brightness(.85);
}
.vg-item:focus-visible {
  outline: 3px solid #E8A20C;
  outline-offset: 2px;
}
.vg-item.vg-extra {
  display: none;
}
.vg-grid.vg-expanded .vg-item.vg-extra {
  display: block;
}
.vg-more-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
}
.vg-grid.vg-expanded .vg-more-overlay {
  display: none;
}
.vg-show-all {
  margin-top: 30px;
  background: #E8A20C;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 12px 28px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background .3s;
}
.vg-show-all:hover {
  background: #2A2A2A;
}
.vg-show-all i {
  margin-right: 6px;
}

@media (max-width: 767px) {
  .vg-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 6px;
  }
  .vg-item:first-child {
    grid-row: span 1;
    aspect-ratio: 3 / 2;
  }
}

/*---- lightbox ----*/
body.vg-open {
  overflow: hidden;
}
.vg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(12, 12, 12, .96);
  display: flex;
  flex-direction: column;
  color: #fff;
  user-select: none;
}
.vg-lightbox[hidden] {
  display: none;
}
.vg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex: 0 0 auto;
}
.vg-counter {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  opacity: .85;
}
.vg-actions {
  display: flex;
  gap: 6px;
}
.vg-btn,
.vg-nav {
  background: rgba(255, 255, 255, .08);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.vg-btn:hover,
.vg-nav:hover {
  background: #E8A20C;
}
.vg-btn.vg-active {
  background: #E8A20C;
}
.vg-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 70px;
  touch-action: pan-y;
}
.vg-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  transition: opacity .25s ease;
}
.vg-image.vg-fade {
  opacity: 0;
}
.vg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 20px;
  z-index: 2;
}
.vg-prev { left: 12px; }
.vg-next { right: 12px; }
.vg-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #E8A20C;
  border-radius: 50%;
  animation: vg-spin .8s linear infinite;
  display: none;
}
.vg-spinner.vg-visible {
  display: block;
}
@keyframes vg-spin {
  to { transform: rotate(360deg); }
}
.vg-thumbs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
.vg-thumbs button {
  flex: 0 0 auto;
  width: 84px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  background: #222;
  opacity: .5;
  cursor: pointer;
  transition: opacity .2s, border-color .2s;
}
.vg-thumbs button:hover {
  opacity: .85;
}
.vg-thumbs button.vg-current {
  opacity: 1;
  border-color: #E8A20C;
}
.vg-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .vg-stage {
    padding: 0;
  }
  .vg-nav {
    width: 42px;
    height: 42px;
    font-size: 16px;
    background: rgba(0, 0, 0, .45);
  }
  .vg-prev { left: 6px; }
  .vg-next { right: 6px; }
  .vg-thumbs button {
    width: 64px;
    height: 43px;
  }
}
