/* Axiom photo galleries: justified grid + lightbox (lightbox markup from axiom-gallery.js). */
.mg-grid { --rh: 260px; display: flex; flex-wrap: wrap; margin: -3px; }
.mg-grid::after { content: ""; flex-grow: 999999; }
.mg-item { position: relative; display: block; margin: 3px; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * var(--rh)); max-height: calc(var(--rh) * 2.2); background: var(--ax-surface); border-radius: 3px; overflow: hidden; }
.mg-item::before { content: ""; display: block; padding-top: calc(100% / var(--r)); }
.mg-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .2s ease; }
.mg-item:hover img { transform: scale(1.03); }
.mg-item:focus-visible { outline: 3px solid var(--ax-coral); outline-offset: 2px; }
@media (max-width: 900px) { .mg-grid { --rh: 180px; } }
@media (max-width: 600px) { .mg-grid { --rh: 120px; margin: -2px; } .mg-item { margin: 2px; } }

/* Gallery cards (photography hub) */
.ax-gal-card { position: relative; display: block; overflow: hidden; border-radius: var(--ax-radius); aspect-ratio: 4 / 3; background: var(--ax-surface); text-decoration: none !important; color: var(--ax-on-dark) !important; isolation: isolate; }
@supports not (aspect-ratio: 1) { .ax-gal-card { height: 0; padding-top: 75%; } }
.ax-gal-card img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s ease; }
.ax-gal-card::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; background: linear-gradient(180deg, rgba(28, 28, 28, 0) 45%, rgba(28, 28, 28, .9) 100%); }
.ax-gal-card__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 24px; }
.ax-gal-card h3 { margin: 0 0 4px; font: 400 19.2px/1.2 var(--ax-display); text-transform: uppercase; color: var(--ax-on-dark); }
.ax-gal-card span { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ax-coral); }
a.ax-gal-card:hover img { transform: scale(1.05); }

/* Lightbox */
.mg-lb { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; background: rgba(18, 18, 18, .97); touch-action: pan-y pinch-zoom; }
.mg-lb[hidden] { display: none; }
.mg-lb__fig { margin: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 72px; box-sizing: border-box; }
.mg-lb__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; user-select: none; -webkit-user-select: none; }
.mg-lb__bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 20px; background: linear-gradient(rgba(18, 18, 18, .85), rgba(18, 18, 18, 0)); }
.mg-lb__count { font: 700 14px/1 var(--ax-body); color: var(--ax-on-dark); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.mg-lb__title { font-size: 14px; color: var(--ax-on-dark-2); margin-left: 14px; }
.mg-lb button { -webkit-appearance: none; appearance: none; display: inline-block; width: 48px; height: 48px; padding: 0; margin: 0; line-height: 0; text-align: center; border: 1px solid var(--ax-line-dark); border-radius: var(--ax-radius); background: rgba(43, 43, 43, .9); color: var(--ax-on-dark); cursor: pointer; }
.mg-lb button:hover { border-color: var(--ax-coral); background: var(--ax-btn); }
.mg-lb button:focus-visible { outline: 3px solid var(--ax-coral); outline-offset: 3px; }
.mg-lb button svg { width: 22px; height: 22px; vertical-align: middle; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mg-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.mg-lb__prev { left: 12px; }
.mg-lb__next { right: 12px; }
.mg-lb__spin { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 3px solid var(--ax-line-dark); border-top-color: var(--ax-coral); border-radius: 50%; opacity: 0; pointer-events: none; }
.mg-lb.is-loading .mg-lb__spin { opacity: 1; animation: mg-spin .8s linear infinite; }
@keyframes mg-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
	.mg-lb__fig { padding: 60px 0 76px; }
	.mg-lb__nav { top: auto; bottom: 14px; transform: none; }
	.mg-lb__prev { left: calc(50% - 60px); }
	.mg-lb__next { right: calc(50% - 60px); }
	.mg-lb__title { display: none; }
}
html.mg-lb-open, html.mg-lb-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .mg-item img, .ax-gal-card img { transition: none; } .mg-lb.is-loading .mg-lb__spin { animation: none; } }
/* Card titles readable on bright photos */
.ax-gal-card::before { background: linear-gradient(180deg, rgba(20, 20, 20, 0) 30%, rgba(20, 20, 20, .55) 58%, rgba(20, 20, 20, .94) 100%); }
.ax-gal-card h3, .ax-gal-card span { text-shadow: 0 1px 10px rgba(0, 0, 0, .55); }
/* Owner request: gallery titles bright white with a strong drop shadow on every section tone */
body.ax-site .ax-gal-card h3 { color: #fbfafa !important; text-shadow: 0 2px 4px rgba(0, 0, 0, .9), 0 4px 18px rgba(0, 0, 0, .75) !important; }
body.ax-site .ax-gal-card span { color: #fbfafa !important; opacity: .92; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 2px 10px rgba(0, 0, 0, .7) !important; }
