/* Gallery wall: categories (a heading and a core Gallery block each) in justified rows of natural-ratio photographs,
   with the shared category bar above and a full-screen viewer (gallery.js). Authors add photos and categories in
   the editor; nothing here depends on how many there are. */
.mdb-page--gallery .mdb-gallery-wall { --wall-gap: clamp(10px, 1.6vw, 22px); max-width: none !important; padding-inline: max(var(--mdb-gutter, 24px), calc((100vw - var(--mdb-max, 1440px)) / 2 + var(--mdb-gutter, 24px))) !important; margin: 0 calc(50% - 50vw) !important; width: 100vw; }
.mdb-page--gallery .mdb-gallery-wall > .mdb-menu-nav { margin-bottom: clamp(36px, 5vw, 64px) !important; }
.mdb-page--gallery .mdb-gallery-set { max-width: none !important; margin: 0 0 clamp(64px, 8vw, 120px) !important; padding: 0 !important; scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 132px); }

/* Category heading: title and photo count on one hairline, like the menu's section titles. */
.mdb-page--gallery .mdb-gallery-set > h2 { display: inline-block; margin: 0 !important; max-width: none !important; font-size: clamp(34px, 3.6vw, 52px) !important; font-weight: 300; line-height: 1.05; }
.mdb-page--gallery .mdb-gallery-set__count { display: inline-block; margin: 0 0 0 16px !important; font-family: var(--mdb-ui-font, Geist, Inter, sans-serif); font-size: 11px !important; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8e958d !important; font-variant-numeric: tabular-nums; }
.mdb-page--gallery .mdb-gallery-set > h2 + .mdb-gallery-set__count + .wp-block-gallery,
.mdb-page--gallery .mdb-gallery-set > .wp-block-gallery { margin-top: 18px !important; padding-top: clamp(20px, 2.4vw, 32px); border-top: 1px solid rgb(201 174 121 / 22%); }

/* Justified rows: every photo keeps its own proportions (--r, width / height, set by the theme from the Media
   Library), each row fills the width, reading order is left to right, and any number of photos fits. The last
   row keeps its natural size instead of stretching (the ::after filler takes the spare space). */
.mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images { --row: clamp(132px, 21vw, 330px); display: flex !important; flex-wrap: wrap; gap: var(--wall-gap) !important; max-width: none !important; }
.mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images::after { content: ""; flex-grow: 999; }
.mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { position: relative; flex: var(--r, 1.5) 1 calc(var(--r, 1.5) * var(--row)); width: auto !important; margin: 0 !important; overflow: hidden; border-radius: 4px; background: #1a1e1c; }
.mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images figure.wp-block-image img { display: block; width: 100% !important; height: auto !important; aspect-ratio: var(--r, 1.5); max-width: none; object-fit: cover; border-radius: 0 !important; transform-origin: 50% 60%; transition: transform .9s cubic-bezier(.22, 1, .36, 1), filter .6s ease; }
.mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { position: absolute; inset: auto 0 0; margin: 0; padding: 48px 18px 16px; max-height: none; overflow: visible; background: linear-gradient(transparent, rgb(10 12 11 / 78%)); font-family: var(--mdb-display-font, "Cormorant Garamond", Georgia, serif); font-size: 19px; line-height: 1.25; text-align: left; color: #f0eee7; pointer-events: none; opacity: .92; transform: translateY(6px); transition: opacity .5s ease, transform .6s cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) {
  .mdb-page--gallery .mdb-gallery-wall figure.wp-block-image:hover img { transform: scale(1.035); filter: brightness(1.06); }
  .mdb-page--gallery .mdb-gallery-wall figure.wp-block-image:not(:hover) figcaption { opacity: 0; }
  .mdb-page--gallery .mdb-gallery-wall figure.wp-block-image:hover figcaption { transform: none; }
}
@media (max-width: 700px) {
  /* Tiles are too small for captions on phones; the viewer shows them. */
  .mdb-page--gallery .mdb-gallery-wall .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { display: none; }
}
/* Waiting to be revealed (gallery.js sets this only on photos below the fold, and only with motion allowed). */
.mdb-page--gallery .mdb-gallery-wall figure.is-reveal-pending { opacity: 0; }

/* Viewer trigger: the whole photo is the button. */
.mdb-gallery-open { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.mdb-gallery-open:focus-visible { outline: 2px solid #f5dda5; outline-offset: -4px; }

/* Viewer */
.mdb-lightbox { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #f0eee7; overflow: hidden; }
.mdb-lightbox::backdrop { background: transparent; }
.mdb-lightbox__scrim { position: absolute; inset: 0; background: rgb(9 11 10 / 96%); }
.mdb-lightbox__bar { position: absolute; inset: 0 0 auto; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 14px clamp(14px, 3vw, 32px); }
.mdb-lightbox__meta { display: flex; align-items: baseline; gap: 14px; min-width: 0; font-family: var(--mdb-ui-font, Geist, Inter, sans-serif); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.mdb-lightbox__category { color: var(--mdb-gold, #c9ae79); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-lightbox__position { color: #8e958d; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mdb-lightbox button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgb(240 238 231 / 18%); border-radius: 50%; background: rgb(14 17 16 / 55%); color: #f0eee7; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.mdb-lightbox button:hover { border-color: var(--mdb-gold, #c9ae79); color: var(--mdb-gold, #c9ae79); }
.mdb-lightbox button:focus-visible { outline: 2px solid #f5dda5; outline-offset: 3px; }
.mdb-lightbox button .mdb-icon { width: 22px; height: 22px; }
.mdb-lightbox__close { margin-left: auto; }
.mdb-lightbox__stage { position: absolute; inset: 76px clamp(12px, 8vw, 120px) 96px; display: grid; place-items: center; touch-action: none; }
.mdb-lightbox__image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; cursor: grab; }
.mdb-lightbox__image:active { cursor: grabbing; }
.mdb-lightbox__step { position: absolute; top: 50%; z-index: 3; margin-top: -24px; }
.mdb-lightbox__step--previous { left: clamp(12px, 3vw, 40px); }
.mdb-lightbox__step--next { right: clamp(12px, 3vw, 40px); }
.mdb-lightbox__caption { position: absolute; inset: auto 0 0; z-index: 2; margin: 0; pointer-events: none; padding: 22px clamp(16px, 8vw, 120px) 30px; font-family: var(--mdb-display-font, "Cormorant Garamond", Georgia, serif); font-size: clamp(19px, 2vw, 24px); line-height: 1.3; text-align: center; color: #f0eee7; }
@media (max-width: 700px) {
  .mdb-lightbox__stage { inset: 68px 0 132px; }
  .mdb-lightbox__image { border-radius: 0; }
  .mdb-lightbox__step { top: auto; bottom: 24px; margin: 0; }
  .mdb-lightbox__step--previous { left: 16px; }
  .mdb-lightbox__step--next { right: 16px; }
  .mdb-lightbox__caption { padding: 0 80px 34px; font-size: 18px; min-height: 82px; display: flex; align-items: flex-end; justify-content: center; }
}
html.mdb-lightbox-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .mdb-page--gallery .mdb-gallery-wall figure.wp-block-image img, .mdb-page--gallery .mdb-gallery-wall figure.wp-block-image figcaption, .mdb-lightbox button { transition: none !important; }
}
