/* KTM Reference v0.8.2: folder-based gallery / unobtrusive lightbox. */
.ktm-reference-featured { margin:0; padding:0; }
.ktm-reference-featured img { display:block; max-width:100%; width:100%; height:auto; }
.ktm-photo-gallery { width:100%; min-width:0; }
.ktm-photo-gallery__grid {
 display:grid; grid-template-columns:repeat(var(--ktm-photo-columns,3),minmax(0,1fr));
 gap:var(--ktm-photo-gallery-gap,16px);
}
.ktm-photo-gallery__item { display:block; position:relative; aspect-ratio:4/3; overflow:hidden; cursor:zoom-in; }
.ktm-photo-gallery__item img { display:block; height:100%; width:100%; object-fit:cover; transition:transform 300ms ease; }
.ktm-photo-gallery__item:hover img, .ktm-photo-gallery__item:focus-visible img { transform:scale(1.035); }
@media(max-width:980px) {
 .ktm-photo-gallery__grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .ktm-photo-gallery[data-ktm-columns="1"] .ktm-photo-gallery__grid { grid-template-columns:1fr; }
}
@media(max-width:520px) { .ktm-photo-gallery__grid { grid-template-columns:1fr; } }

.ktm-photo-lightbox[hidden] { display:none !important; }
.ktm-photo-lightbox {
 position:fixed; inset:0; z-index:999999;
 display:flex; align-items:center; justify-content:center;
 background:rgba(10,14,19,.95); padding:65px 62px;
 color:#fff; box-sizing:border-box;
 opacity:0; visibility:hidden;
 transition:opacity 280ms ease, visibility 280ms ease;
}
.ktm-photo-lightbox.is-active { opacity:1; visibility:visible; }
.ktm-photo-lightbox__image {
 display:block; max-width:100%; max-height:calc(100vh - 130px);
 width:auto; height:auto; object-fit:contain;
 opacity:0; transform:translateY(7px) scale(.955);
 transition:opacity 260ms ease, transform 320ms ease;
}
.ktm-photo-lightbox.is-active .ktm-photo-lightbox__image {
 opacity:1; transform:translateY(0) scale(1);
}
/* Neutralise Divi's default button background, borders and pseudo-icons. */
.ktm-photo-lightbox button.ktm-photo-lightbox__button,
.ktm-photo-lightbox button.ktm-photo-lightbox__button:hover,
.ktm-photo-lightbox button.ktm-photo-lightbox__button:focus,
.ktm-photo-lightbox button.ktm-photo-lightbox__button:active {
 position:absolute; display:flex; align-items:center; justify-content:center;
 width:54px; height:54px; min-width:54px; min-height:54px;
 margin:0 !important; padding:0 !important;
 color:#fff !important; background:transparent !important;
 background-image:none !important; border:0 !important;
 border-radius:0 !important; box-shadow:none !important;
 cursor:pointer; line-height:1 !important; font-weight:300;
 opacity:.85; text-shadow:0 1px 4px rgba(0,0,0,.35);
 transition:opacity 250ms ease, transform 250ms ease;
 -webkit-tap-highlight-color:transparent;
}
.ktm-photo-lightbox button.ktm-photo-lightbox__button:hover { opacity:1; }
.ktm-photo-lightbox button.ktm-photo-lightbox__button:focus-visible {
 opacity:1; outline:2px solid rgba(255,255,255,.7) !important;
 outline-offset:2px;
}
.ktm-photo-lightbox button.ktm-photo-lightbox__button::before,
.ktm-photo-lightbox button.ktm-photo-lightbox__button::after { display:none !important; content:none !important; }
.ktm-photo-lightbox button.ktm-photo-lightbox__button[hidden] { display:none !important; }
.ktm-photo-lightbox__close { right:15px; top:12px; font-family:Arial, sans-serif; font-size:44px !important; }
.ktm-photo-lightbox__prev,.ktm-photo-lightbox__next { top:50%; font-family:Georgia, serif; font-size:55px !important; }
.ktm-photo-lightbox__prev { left:7px; transform:translateY(-50%); }
.ktm-photo-lightbox__next { right:7px; transform:translateY(-50%); }
.ktm-photo-lightbox__count { position:absolute; bottom:14px; left:0; right:0; font-size:13px; text-align:center; opacity:.84; pointer-events:none; }
body.ktm-photo-lightbox-open { overflow:hidden; }
@media(max-width:580px) {
 .ktm-photo-lightbox { padding:55px 12px 70px; }
 .ktm-photo-lightbox__image { max-height:calc(100dvh - 140px); }
 .ktm-photo-lightbox__prev,.ktm-photo-lightbox__next { top:auto; bottom:15px; transform:none; }
}
@media(prefers-reduced-motion:reduce) {
 .ktm-photo-gallery__item img,
 .ktm-photo-lightbox,
 .ktm-photo-lightbox__image,
 .ktm-photo-lightbox button.ktm-photo-lightbox__button { transition:none !important; }
}
