/* Home: centre the bottom row when there are 5 amenity tiles */
@media (min-width: 1024px) {
  .amenities-grid-5 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .amenities-grid-5 > * {
    grid-column: span 2;
  }

  .amenities-grid-5 > *:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .amenities-grid-5 > *:nth-child(5) {
    grid-column: 4 / span 2;
  }
}

/* Location: align Finding Us and Getting Here columns */
@media (min-width: 1024px) {
  .location-find-grid {
    align-items: start;
  }

  .location-find-grid > .location-getting-here {
    align-self: start;
    margin-top: 3.75rem; /* line up with Finding Us body (below h2) */
  }
}

/* Prices: pricing card beside What's Included */
.prices-included-row {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.prices-intro {
  flex-shrink: 0;
  width: 100%;
  max-width: 22rem;
}

.prices-included-main {
  flex: 1;
  min-width: 0;
}

@media (min-width: 1024px) {
  .prices-included-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 3rem;
  }

  .prices-included-main {
    order: 1;
  }

  .prices-intro {
    order: 2;
    margin-left: auto;
  }

  .prices-included-main .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Home: slow hero image crossfade */
.home-hero-slider {
  background: #0f172a;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.03);
  animation-duration: 18s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.home-hero-slide-house {
  background-image: url('images/balnacraig/front-exterior.jpg');
  animation-name: homeHeroHouse;
}

.home-hero-slide-landscape {
  background-image: url('images/balnacraig/highland-approach.jpg');
  animation-name: homeHeroLandscape;
}

.home-hero-slide-view {
  background-image: url('images/balnacraig/lounge-window-view.jpg');
  animation-name: homeHeroView;
}

@keyframes homeHeroHouse {
  0%, 28%, 100% { opacity: 1; }
  36%, 92% { opacity: 0; }
}

@keyframes homeHeroLandscape {
  0%, 28%, 68%, 100% { opacity: 0; }
  36%, 60% { opacity: 1; }
}

@keyframes homeHeroView {
  0%, 60%, 100% { opacity: 0; }
  68%, 92% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-slide {
    animation: none;
  }

  .home-hero-slide-house {
    opacity: 1;
  }
}

/* Gallery: full-screen image lightbox */
.gallery-lightbox-trigger:focus-visible {
  outline: 3px solid #d97706;
  outline-offset: 4px;
}

.gallery-lightbox-open {
  overflow: hidden;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 4rem 1fr 4rem;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.94);
  color: #fff;
}

.gallery-lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
}

.gallery-lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 0.75rem;
  object-fit: contain;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-figure figcaption {
  max-width: 48rem;
  margin-top: 1rem;
  color: #e2e8f0;
  text-align: center;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
  border-color: #f59e0b;
  background: rgba(217, 119, 6, 0.9);
  outline: none;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  line-height: 1;
}

.gallery-lightbox-nav {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 3rem;
  line-height: 1;
}

.gallery-lightbox-prev {
  justify-self: end;
}

.gallery-lightbox-next {
  justify-self: start;
}

/* Contact: Contact Form 7 shortcode output */
.contact-form-content .wpcf7-form {
  display: grid;
  gap: 1.5rem;
}

.contact-form-content .wpcf7-form p {
  margin: 0;
}

.contact-form-content label {
  display: block;
  color: #334155;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.contact-form-content input:not([type="submit"]),
.contact-form-content select,
.contact-form-content textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form-content input:not([type="submit"]):focus,
.contact-form-content select:focus,
.contact-form-content textarea:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgb(253 230 138 / 1);
}

.contact-form-content input[type="submit"] {
  width: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: #d97706;
  color: #fff;
  cursor: pointer;
  font-size: 1.125rem;
  padding: 1rem 2rem;
  transition: background-color 0.2s ease;
}

.contact-form-content input[type="submit"]:hover {
  background: #b45309;
}

@media (max-width: 640px) {
  .gallery-lightbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    padding: 1rem;
  }

  .gallery-lightbox-figure {
    grid-column: 1 / -1;
  }

  .gallery-lightbox-figure img {
    max-height: 72vh;
  }

  .gallery-lightbox-nav {
    width: 3rem;
    height: 3rem;
    font-size: 2.5rem;
  }

  .gallery-lightbox-prev {
    justify-self: end;
  }

  .gallery-lightbox-next {
    justify-self: start;
  }
}