/* ============================================================
 * Pun66 frontend — controls + badges + In Memoriam heading.
 * Intentionally does NOT hide any FooGallery native UI; the
 * native pills and search remain visible. Our custom dropdown
 * sits alongside them as an extra-convenient navigation.
 * ============================================================ */

/* ----- Custom controls bar -------------------------------------------- */
.pun66-controls {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 0.75rem;
}
.pun66-controls .pun66-filter {
	font-size: 0.95rem;
	padding: 0.45rem 0.6rem;
	border-radius: 4px;
	min-width: 240px;
	max-width: 100%;
	background: #fff;
	border: 1px solid #b8b8b8;
}

/* ----- "In Loving Memory" heading ------------------------------------ */
.pun66-im-heading {
	text-align: center;
	margin: 1.25rem auto 0.75rem;
	color: #555;
	font-family: Georgia, "Times New Roman", serif;
}
.pun66-im-heading h2 {
	font-size: 1.5rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	margin: 0;
	color: #555;
}
.pun66-im-heading p {
	font-size: 1rem;
	margin: 0.25rem 0 0.75rem;
	color: #666;
}
.pun66-im-heading hr {
	width: 60%;
	max-width: 320px;
	margin: 0 auto;
	border: 0;
	border-top: 1px solid #d0d0d0;
}

/* ----- Legend (collapsible) ------------------------------------------ */
.pun66-legend {
	margin: 0.25rem 0 0.75rem;
	font-size: 0.85rem;
}
.pun66-legend summary {
	cursor: pointer;
	color: #555;
	display: inline-block;
	padding: 0.2rem 0;
}
.pun66-legend ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.1rem;
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
}
.pun66-legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
}
.pun66-legend .pun66-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 3px;
	color: #fff;
	font-weight: 600;
	font-size: 11px;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Per-photo event badges (rendered by JS) -----------------------
 * Sits above FooGallery's caption overlay (.fg-caption is z-index 1) and
 * the loader. We avoid pointer-events so badge tooltips work but clicks
 * still pass through to the photo.
 */
.fg-item > .pun66-badges {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: flex;
	gap: 3px;
	z-index: 9999;
	pointer-events: none;
}
.fg-item > .pun66-badges .pun66-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 3px;
	color: #fff;
	font-weight: 700;
	font-size: 10px;
	line-height: 1;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	opacity: 0.95;
	box-shadow: 0 0 0 1px rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.35);
	pointer-events: auto;
	cursor: help;
}
/* Defensive: never show badges on In Memoriam photos. */
.fg-item.pun66-in-memoriam .pun66-badges {
	display: none !important;
}

/* Filter hide — high enough specificity to win over the filter-active
   layout override below. */
.foogallery .fg-item.pun66-hidden,
.foogallery.pun66-filter-active .fg-item.pun66-hidden {
	display: none !important;
}

/* Hide FooGallery's pagination while a filter is active. */
.foogallery.pun66-filter-active .fg-paging-container {
	display: none !important;
}

/* Grey border on In Memoriam photos — independent of FooGallery layout
   so it works in both justified and filtered views. */
.fg-item.pun66-in-memoriam .fg-item-inner,
.fg-item.pun66-in-memoriam .fg-thumb {
	box-shadow: 0 0 0 2px #999 !important;
}
.fg-item.pun66-in-memoriam .fg-image-wrap {
	filter: grayscale(35%);
}

/* When a filter is active, override FooGallery's absolute justified layout
   with a natural inline-block flow so surviving items pack together with no
   gaps where hidden items used to be. */
.foogallery.pun66-filter-active {
	height: auto !important;
	text-align: center;
	font-size: 0; /* removes inline-block whitespace */
}
.foogallery.pun66-filter-active .fg-item {
	/* position:relative (not static) so absolutely-positioned children like
	   our .pun66-badges still anchor to the item, not the gallery. */
	position: relative !important;
	left: auto !important;
	top: auto !important;
	display: inline-block !important;
	vertical-align: top;
	margin: 0 3px 6px 0 !important;
}
.foogallery.pun66-filter-active .fg-item-inner {
	margin: 0 !important;
}
