/* =============================================================
   MuniDocs — Image cards + lightbox
   Loaded alongside munidocs-lightbox.js whenever a grid or list
   shortcode contains at least one image-type document.
   ============================================================= */

/* ---- Image card — replaces the normal header icon ---- */

.mng-card--image .mng-card-header { display: none; }

.mng-card-img-link {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #0a0a0a;
	text-decoration: none;
	flex-shrink: 0;
	border-radius: var(--mng-radius, 10px) var(--mng-radius, 10px) 0 0;
}

.mng-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease, opacity .2s;
	opacity: .9;
}

.mng-card--image:hover .mng-card-img {
	transform: scale(1.05);
	opacity: 1;
}

.mng-card-img-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: rgba(0, 0, 0, .44);
	color: #fff;
	font-size: .88rem;
	font-weight: 700;
	letter-spacing: .03em;
	opacity: 0;
	transition: opacity .22s;
	pointer-events: none;
}

.mng-card--image:hover .mng-card-img-overlay,
.mng-card-img-link:focus-visible .mng-card-img-overlay {
	opacity: 1;
}

.mng-img-count-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, .56);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 3px 9px;
	border-radius: 20px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	pointer-events: none;
}

/* ---- Thumbnail strip (multi-image card footer) ---- */

.mng-card-footer--gallery {
	padding: 10px 14px;
	border-top: 1px solid var(--mng-border, #e5e7eb);
	margin-top: auto;
}

.mng-thumb-strip {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--mng-border, #e5e7eb) transparent;
	padding-bottom: 2px;
}

.mng-thumb-item {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 5px;
	overflow: hidden;
	display: block;
	border: 2px solid transparent;
	transition: border-color .15s, transform .15s;
	text-decoration: none;
}

.mng-thumb-item:hover,
.mng-thumb-item:focus-visible {
	border-color: var(--mng-brand, #1a6dba);
	outline: none;
	transform: scale(1.07);
}

.mng-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Hidden anchors used only for JS gallery collection ---- */
.mng-lb-hidden {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
}

/* ---- List shortcode image items ---- */
.munidocs-list-item--image   { list-style: none; margin-left: -1.5em; }
.munidocs-list-img-badge     { font-size: .78rem; color: #6b7280; margin-left: 5px; }

/* =============================================================
   Lightbox overlay
   ============================================================= */

.mng-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mng-lightbox[hidden] { display: none; }

.mng-lb-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .92);
	cursor: pointer;
}

.mng-lb-panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 95vw;
	max-height: 95dvh;
	padding: 0 8px;
}

.mng-lb-close {
	position: fixed;
	top: 16px;
	right: 20px;
	z-index: 2;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .28);
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.mng-lb-close:hover,
.mng-lb-close:focus-visible {
	background: rgba(255, 255, 255, .28);
	outline: none;
}

.mng-lb-img-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 0;
}

.mng-lb-img {
	display: block;
	max-width: 90vw;
	max-height: 80dvh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 8px 48px rgba(0, 0, 0, .55);
}

.mng-lb-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 0 4px;
	width: 100%;
	min-width: 0;
}

.mng-lb-prev,
.mng-lb-next {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .22);
	background: rgba(255, 255, 255, .1);
	color: #fff;
	font-size: 1.9rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
}

.mng-lb-prev:hover,
.mng-lb-next:hover,
.mng-lb-prev:focus-visible,
.mng-lb-next:focus-visible {
	background: rgba(255, 255, 255, .25);
	outline: none;
}

/* Keep layout stable when buttons are hidden (single-image) */
.mng-lb-prev[hidden],
.mng-lb-next[hidden] { visibility: hidden; }

.mng-lb-meta {
	flex: 1;
	text-align: center;
	min-width: 0;
	overflow: hidden;
}

.mng-lb-caption {
	color: rgba(255, 255, 255, .92);
	font-size: .88rem;
	margin: 0 0 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mng-lb-counter {
	display: block;
	color: rgba(255, 255, 255, .55);
	font-size: .78rem;
}

/* ---- Eye icon used in overlay ---- */
.mng-eye-icon {
	display: inline-block;
	vertical-align: middle;
}
