/* Minimal overrides – production WordPress CSS does the heavy lifting */

.home .wp-container-core-group-is-layout-1292ae2f > .wp-block-buttons {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Duotone filter */
.wp-duotone-duotone-1 img,
.wp-duotone-duotone-1.wp-block-image img {
  filter: var(--wp--preset--duotone--duotone-1);
}

/* Gallery masonry (FooGallery replacement) */
.foogallery.fg-masonry {
  --fg-gutter: 10px;
  column-count: 4;
  column-gap: var(--fg-gutter);
}

@media (max-width: 1024px) {
  .foogallery.fg-masonry {
    column-count: 3;
  }
}

@media (max-width: 781px) {
  .foogallery.fg-masonry {
    column-count: 2;
  }
}

@media (max-width: 480px) {
  .foogallery.fg-masonry {
    column-count: 1;
  }
}

.fg-item {
  break-inside: avoid;
  margin-bottom: var(--fg-gutter);
  position: relative;
}

.fg-thumb {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.fg-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.fg-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}

.fg-thumb:hover .fg-image {
  transform: scale(1.04);
}

.fg-thumb:hover .fg-image-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.fg-caption {
  display: none;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 5rem;
  overflow-y: auto;
}

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

.gallery-lightbox__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: min(1200px, 100%);
  max-height: none;
}

.gallery-lightbox__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.gallery-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(78vh, 860px);
  object-fit: contain;
}

.gallery-lightbox__caption {
  width: 100%;
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: center;
  overflow: visible;
}

.gallery-lightbox__caption p {
  margin: 0 0 0.75rem;
}

.gallery-lightbox__caption p:last-child {
  margin-bottom: 0;
}

.gallery-lightbox__close,
.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: fixed;
  z-index: 100003;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__prev:focus-visible,
.gallery-lightbox__next:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.65);
  outline: none;
}

.gallery-lightbox__close {
  top: 1rem;
  right: 1rem;
}

.gallery-lightbox__prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox__next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 900px) {
  .gallery-lightbox {
    padding: 4rem 1.25rem 1.5rem;
    align-items: flex-start;
  }

  .gallery-lightbox__image {
    max-height: min(62vh, 640px);
  }

  .gallery-lightbox__caption {
    font-size: 0.8rem;
    max-width: 100%;
    text-align: left;
  }

  .gallery-lightbox__prev {
    left: 0.5rem;
  }

  .gallery-lightbox__next {
    right: 0.5rem;
  }
}

/* 404 page */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-page h1 {
  font-size: clamp(4rem, 12vw, 8rem);
  margin: 0;
  line-height: 1;
}

.error-page p {
  margin-top: 1rem;
}
