/* ==========================================================================
   Gallery page
   ========================================================================== */

/* Hero without a background image: shrink to its content */
.page-hero--plain { min-height: 0; padding-top: calc(var(--mm-header-h) + 24px); padding-bottom: 36px; }

.gallery {
  --gallery-ratio: 4 / 3; /* tile shape: 4 / 3 landscape, 1 / 1 square, 3 / 4 portrait */
  padding: 40px 0 64px; background: var(--mm-cream); scroll-margin-top: var(--mm-header-h);
}

.gallery__intro { max-width: 720px; margin: 0 auto 32px; color: var(--mm-dark); font-size: 1.05rem; line-height: 1.8; text-align: center; }
.gallery__intro > :first-child { margin-top: 0; }
.gallery__intro > :last-child { margin-bottom: 0; }

/* 4 equal tiles per row */
.gallery__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.gallery__item {
  position: relative; display: block; overflow: hidden; aspect-ratio: var(--gallery-ratio);
  border-radius: 14px; background: #e9e1d2; box-shadow: 0 8px 22px rgba(31, 36, 40, .08); cursor: zoom-in;
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery__item:hover, .gallery__item:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(31, 36, 40, .18); }
.gallery__item:focus-visible { outline: 3px solid var(--mm-gold); outline-offset: 3px; }

.gallery__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.gallery__item:hover .gallery__img, .gallery__item:focus-visible .gallery__img { transform: scale(1.07); }

/* Hover veil with a round "+" */
.gallery__item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  background: rgba(18, 51, 63, .38);
}
.gallery__zoom {
  position: absolute; top: 50%; left: 50%; z-index: 2; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: var(--mm-gold); opacity: 0; transform: scale(.8);
  transition: opacity .3s ease, transform .3s ease;
}
.gallery__zoom::before, .gallery__zoom::after { content: ""; position: absolute; top: 50%; left: 50%; background: var(--mm-navy); border-radius: 2px; }
.gallery__zoom::before { width: 18px; height: 2px; margin: -1px 0 0 -9px; }
.gallery__zoom::after { width: 2px; height: 18px; margin: -9px 0 0 -1px; }
.gallery__item:hover::after, .gallery__item:focus-visible::after { opacity: 1; }
.gallery__item:hover .gallery__zoom, .gallery__item:focus-visible .gallery__zoom { opacity: 1; transform: scale(1); }

/* Empty state */
.gallery__empty { max-width: 560px; margin: 0 auto; padding: 48px 24px; border: 1.5px dashed rgba(196, 146, 44, .6); border-radius: 16px; text-align: center; }
.gallery__empty p { margin: 0; color: var(--mm-muted); line-height: 1.7; }
.gallery__empty p + p { margin-top: 8px; color: var(--mm-dark); font-weight: 500; }

/* Tablet: 3 per row */
@media (max-width: 991px) {
  .gallery { padding: 34px 0 52px; }
  .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

/* Mobile: 2 per row */
@media (max-width: 575px) {
  .gallery { padding: 28px 0 44px; }
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gallery__item { border-radius: 10px; }
}

/* Touch screens have no hover */
@media (hover: none) {
  .gallery__item::after, .gallery__zoom { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__item, .gallery__img, .gallery__item::after, .gallery__zoom { transition: none; }
}


/* ---------- Gallery categories ---------- */
.gallery__cats { list-style: none; margin: 0 0 44px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.gallery__cat-link {
  display: inline-block; padding: 10px 24px; border: 1.5px solid rgba(196, 146, 44, .6); border-radius: 999px;
  color: var(--mm-navy); font-size: .92rem; font-weight: 600; line-height: 1.2; text-decoration: none;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.gallery__cat-link:hover, .gallery__cat-link:focus-visible { background: var(--mm-gold); border-color: var(--mm-gold); color: var(--mm-dark); }
.gallery__cat-link:focus-visible { outline: 3px solid var(--mm-gold); outline-offset: 3px; }

.gallery__section { scroll-margin-top: calc(var(--mm-header-h) + 16px); }
.gallery__section + .gallery__section { margin-top: 60px; }

.gallery__heading {
  position: relative; margin: 0 0 24px; padding-bottom: 14px; color: var(--mm-navy);
  font-family: var(--mm-font-heading); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2;
}
.gallery__heading::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 3px; border-radius: 2px; background: var(--mm-gold); }

@media (max-width: 575px) {
  .gallery__cats { margin-bottom: 32px; gap: 8px; }
  .gallery__cat-link { padding: 8px 16px; font-size: .86rem; }
  .gallery__section + .gallery__section { margin-top: 44px; }
  .gallery__heading { margin-bottom: 18px; }
}