.ilb, .ilb * { box-sizing: border-box; }

/* Tunable animation variables (aimed to feel like Magnific Popup's zoom) */
:root {
	--ilb-speed: .35s; /* overall animation duration */
	--ilb-ease: cubic-bezier(.215,.61,.355,1); /* ease-out cubic */
	--ilb-scale-start: .90; /* starting scale for zoom */
}
.ilb {
	display: inline-block;
	max-width: 100%;
	margin-bottom:48px;
}

/* Wide and full alignment */
.ilb.alignwide,
.ilb.alignfull {
	display: block;
}
.ilb.alignwide .ilb-trigger,
.ilb.alignfull .ilb-trigger {
	display: block;
	width: 100%;
}
.ilb.alignwide .ilb-trigger img,
.ilb.alignfull .ilb-trigger img {
	width: 100%;
}

.ilb-trigger {
	display: inline-block;
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
}

.ilb-trigger img {
	display: block;
	max-width: 100%;
	height: auto;
}

.ilb-caption {
	margin-top: 8px;
	font-size: .95rem;
	color: #555;
}

/* Modal is always in flow so opacity can animate */
.ilb-modal {
	position: fixed;
	inset: 0;
	display: flex;
	z-index: 200000;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--ilb-speed) ease-in-out, visibility 0s linear var(--ilb-speed); /* hide visibility after fade */
}
.ilb-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity var(--ilb-speed) ease-in-out, visibility 0s linear 0s;
}

.ilb-backdrop {
	position: absolute;
	inset: 0;
	/* White overlay to match desired light look */
	background: rgba(255,255,255,.96);
	opacity: 0;
	z-index: 0;
	transition: opacity .3s ease-out;
}
.ilb-modal.is-open .ilb-backdrop {
	opacity: 1;
}

.ilb-dialog {
	position: relative;
	display: inline-block;
	z-index: 1;
	padding: 0;
	transform: scale(var(--ilb-scale-start)); /* pure zoom-in */
	opacity: 0;                           /* start invisible */
	transition: transform var(--ilb-speed) var(--ilb-ease), opacity var(--ilb-speed) var(--ilb-ease);
	will-change: transform, opacity;
	backface-visibility: hidden;
	transform-origin: center center;
}
.ilb-modal.is-open .ilb-dialog {
	transform: scale(1);    /* zoom in gracefully */
	opacity: 1;
}

.ilb-dialog img {
	display: block;
	max-width: 95vw;
	max-height: 85vh;
	/* Crisp edges, no heavy drop shadow for clean presentation */
	border-radius: 0;
	box-shadow: none;
}

.ilb-close {
	/* Fixed to viewport so it sits at the top-right of the overlay */
	position: fixed;
	top: 18px;
	right: 18px;
	z-index: 3;
	width: 32px;
	height: 32px;
	border: none;
	background: #222222;
	color: #ffffff;
	font-size: 24px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
	opacity: 0;
	box-shadow: 0 1px 6px rgba(0,0,0,.12);
	transition: opacity var(--ilb-speed) ease-in-out;
}

.ilb-modal.is-open .ilb-close { opacity: .96; }
/* Keep the same look on hover (no change) */
.ilb-close:hover { background: #222222; }

.ilb-close:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

@media (hover:hover) {
	.ilb-trigger img { transition: none; }
	.ilb-trigger:hover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ilb-modal,
	.ilb-backdrop,
	.ilb-dialog,
	.ilb-trigger img {
		transition: none !important;
	}
}