.gallery-simple {
	box-sizing: border-box;
	min-width: 0;
	/* Let WordPress control alignment widths, including full-width negative margins. */
	container-type: inline-size;
}
.gallery-simple *, .gallery-simple *::before, .gallery-simple *::after { box-sizing: border-box; }
.gallery-simple [hidden] { display: none !important; }
.gallery-simple__header {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 10px;
	line-height: 1.5;
}
.gallery-simple__title,
.gallery-simple__counter {
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
}
.gallery-simple__title {
	min-width: 0;
	overflow-wrap: anywhere;
}
.gallery-simple__counter {
	flex-shrink: 0;
	margin-left: auto;
	white-space: nowrap;
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.gallery-simple__header--center .gallery-simple__counter { margin-right: auto; }
.gallery-simple__captions {
	display: grid;
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.5;
}
.gallery-simple__caption {
	grid-area: 1 / 1;
	min-width: 0;
	text-align: center;
	white-space: pre-line;
	overflow-wrap: anywhere;
}
/* Reserve the tallest caption's space so switching photos does not move the thumbnails. */
.gallery-simple__caption[aria-hidden="true"] { visibility: hidden; }
.gallery-simple__stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--gallery-simple-ratio, 3 / 2);
	max-height: min(640px, 70vh);
	overflow: hidden;
	border-radius: 8px;
	background: #f3f3f3;
}
.gallery-simple .gallery-simple__slide { position: absolute; inset: 0; margin: 0; padding: 0; width: 100%; height: 100%; }
.gallery-simple .gallery-simple__image { display: block; width: 100%; max-width: 100%; height: auto; margin: 0; border-radius: 0; }
.gallery-simple .gallery-simple__slide .gallery-simple__image { height: 100%; max-height: 100%; object-fit: contain; object-position: center; }
.gallery-simple .gallery-simple__arrow {
	position: absolute;
	top: 0;
	transform: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(44px, 12%, 120px);
	height: 100%;
	min-width: 44px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
	appearance: none;
	cursor: pointer;
	box-shadow: none;
	text-shadow: none;
	transition: opacity 150ms ease;
}
/* Opacity keeps the controls reachable with Tab; mouse clicks do not pin them open. */
@media (hover: hover) and (pointer: fine) {
	.gallery-simple .gallery-simple__arrow { opacity: 0; pointer-events: none; }
	.gallery-simple:hover .gallery-simple__arrow,
	.gallery-simple .gallery-simple__arrow:focus-visible { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.gallery-simple .gallery-simple__arrow, .gallery-simple .gallery-simple__arrow span { transition: none; }
}
.gallery-simple__arrow span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 0; opacity: .6; transition: opacity 150ms ease; }
.gallery-simple__arrow:hover span,
.gallery-simple__arrow:focus-visible span,
.gallery-simple__arrow:active span { opacity: 1; }
.gallery-simple__arrow span::before {
	content: '';
	display: block;
	width: 15px;
	height: 15px;
	border-top: 2.5px solid currentColor;
	border-right: 2.5px solid currentColor;
	filter: drop-shadow(0 1px 2px #0004);
}
.gallery-simple__arrow--prev span { justify-content: flex-start; padding-left: 12px; }
.gallery-simple__arrow--next span { justify-content: flex-end; padding-right: 12px; }
.gallery-simple__arrow--prev span::before { transform: translateX(3px) rotate(-135deg); }
.gallery-simple__arrow--next span::before { transform: translateX(-3px) rotate(45deg); }
.gallery-simple__arrow--prev { left: 0; }
.gallery-simple__arrow--next { right: 0; }
.gallery-simple .gallery-simple__arrow:hover { background: transparent; color: #fff; }
.gallery-simple__thumbnails {
	display: flex;
	gap: 4px;
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	padding: 0 0 8px;
	margin: 4px 0 0;
	scrollbar-width: thin;
}
.gallery-simple .gallery-simple__thumbnail {
	position: relative;
	flex: 0 0 76px;
	width: 76px;
	height: 76px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	opacity: .35;
}
.gallery-simple .gallery-simple__thumbnail img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; border-radius: inherit; margin: 0; }
.gallery-simple .gallery-simple__thumbnail[aria-current="true"] { opacity: 1; }
.gallery-simple .gallery-simple__thumbnail[aria-current="true"]::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 2px solid #888b;
	border-radius: inherit;
	pointer-events: none;
}
.gallery-simple .gallery-simple__thumbnail:not([aria-current="true"]):hover,
.gallery-simple .gallery-simple__thumbnail:not([aria-current="true"]):focus-visible { opacity: .7; }
.gallery-simple--square .gallery-simple__stage,
.gallery-simple--square .gallery-simple__arrow,
.gallery-simple--square .gallery-simple__thumbnail,
.gallery-simple--square .gallery-simple__thumbnail img { border-radius: 0; }
.gallery-simple__fallback-image { position: relative; margin-top: 12px; }
.gallery-simple__fallback-image > img { display: block; width: 100%; height: auto; }
@container (max-width: 360px) {
	.gallery-simple .gallery-simple__thumbnail { flex-basis: 60px; width: 60px; height: 60px; }
	.gallery-simple__arrow--prev { left: 0; }
	.gallery-simple__arrow--next { right: 0; }
}

/* Auto margins center short rows and collapse to zero for safely scrollable overflow. */
.gallery-simple__thumbnails--center > .gallery-simple__thumbnail:first-child { margin-inline-start: auto; }
.gallery-simple__thumbnails--center > .gallery-simple__thumbnail:last-child { margin-inline-end: auto; }

.gallery-simple .gallery-simple__expand {
	position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
	background: transparent; box-shadow: none; color: white; cursor: zoom-in; z-index: 1;
}
.gallery-simple__expand span { position: absolute; bottom: 8px; right: 50%; transform: translateX(50%); display: grid; place-items: center; width: 44px; height: 44px; font-size: 28px; text-shadow: 0 1px 2px #0008; }
.gallery-simple .gallery-simple__arrow { z-index: 2; }
.gallery-simple-lightbox:not([open]) { display: none; }
.gallery-simple-lightbox[open] {
	position: fixed; inset: 0; display: flex; flex-direction: column;
	box-sizing: border-box; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
	margin: 0; padding: 12px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	border: 0; border-radius: 0; background: #111; color: #fff; overflow: hidden;
	font-family: inherit; font-size: 14px; line-height: 1.5;
}
.gallery-simple-lightbox::backdrop { background: #111; }
.gallery-simple-lightbox *, .gallery-simple-lightbox *::before { box-sizing: border-box; }
.gallery-simple-lightbox [hidden] { display: none !important; }
.gallery-simple-lightbox__toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-height: 44px; font-variant-numeric: tabular-nums; }
.gallery-simple-lightbox button {
	display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; margin: 0;
	border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #fff;
	font: 36px/1 sans-serif; cursor: pointer; touch-action: manipulation;
}
.gallery-simple-lightbox button:hover { background: #ffffff1a; }
.gallery-simple-lightbox__viewer { display: flex; align-items: center; flex: 1; min-height: 0; min-width: 0; }
.gallery-simple-lightbox .gallery-simple-lightbox__figure { display: flex; flex-direction: column; flex: 1; height: 100%; min-height: 0; min-width: 0; margin: 0; }
.gallery-simple-lightbox__image { flex: 1; min-height: 0; min-width: 0; touch-action: pan-y pinch-zoom; }
.gallery-simple-lightbox .gallery-simple-lightbox__image img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; border-radius: 0; object-fit: contain; }
.gallery-simple-lightbox .gallery-simple-lightbox__caption { flex-shrink: 0; max-height: 20vh; overflow: auto; margin: 8px 0 0; color: inherit; text-align: center; white-space: pre-line; overflow-wrap: anywhere; font: inherit; }

.gallery-simple--dark-arrows .gallery-simple__arrow { color: #222; }
.gallery-simple--dark-arrows .gallery-simple__arrow:hover { color: #222; background: transparent; }
.gallery-simple--dark-arrows .gallery-simple__arrow span::before { filter: drop-shadow(0 1px 2px #fff4); }

.gallery-simple--cover .gallery-simple__slide .gallery-simple__image { object-fit: cover; }
.gallery-simple .gallery-simple__thumbnails--draggable,
.gallery-simple .gallery-simple__thumbnails--draggable .gallery-simple__thumbnail { cursor: grab; }
.gallery-simple .gallery-simple__thumbnails--dragging,
.gallery-simple .gallery-simple__thumbnails--dragging .gallery-simple__thumbnail { cursor: grabbing; user-select: none; }


/* Keep theme button hover/focus styles out of the transparent navigation zones. */
.gallery-simple { --gallery-simple-arrow-color: #fff; }
.gallery-simple--dark-arrows { --gallery-simple-arrow-color: #222; }
.gallery-simple button.gallery-simple__arrow,
.gallery-simple button.gallery-simple__arrow:is(:hover, :focus, :focus-visible, :active) {
	color: var(--gallery-simple-arrow-color) !important;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
}
.gallery-simple button.gallery-simple__arrow span { color: var(--gallery-simple-arrow-color) !important; }
.gallery-simple button.gallery-simple__arrow span::before { border-color: var(--gallery-simple-arrow-color) !important; }
/* Keep keyboard navigation without visible focus decoration, as configured for this gallery. */
.gallery-simple:is(:focus, :focus-visible),
.gallery-simple button:is(:focus, :focus-visible),
.gallery-simple-lightbox:is(:focus, :focus-visible),
.gallery-simple-lightbox button:is(:focus, :focus-visible) {
	outline: none !important;
	box-shadow: none !important;
}

.gallery-simple__captions--above { margin: 0 0 8px; }
.gallery-simple__footer { display: flex; margin: 4px 0 0; }
.gallery-simple__footer--center .gallery-simple__counter { margin-right: auto; }

/* Icon styles keep the full-height navigation hit areas unchanged. */
.gallery-simple-lightbox :is([data-lightbox-prev], [data-lightbox-next]) span {
 display: flex; align-items: center; justify-content: center; position: relative;
 width: 100%; height: 100%; font-size: 0;
}
.gallery-simple-lightbox :is([data-lightbox-prev], [data-lightbox-next]) span::before {
 content: ''; display: block; width: 15px; height: 15px;
 border-top: 2.5px solid currentColor; border-right: 2.5px solid currentColor;
}
.gallery-simple-lightbox [data-lightbox-prev] span::before { transform: translateX(3px) rotate(-135deg); }
.gallery-simple-lightbox [data-lightbox-next] span::before { transform: translateX(-3px) rotate(45deg); }
[data-gallery-arrow-style="slim"] :is(.gallery-simple__arrow, [data-lightbox-prev], [data-lightbox-next]) span::before {
 width: 20px; height: 20px; border-width: 1.5px;
}
[data-gallery-arrow-style="long"] :is(.gallery-simple__arrow, [data-lightbox-prev], [data-lightbox-next]) span { position: relative; }
[data-gallery-arrow-style="long"] :is(.gallery-simple__arrow, [data-lightbox-prev], [data-lightbox-next]) span::before {
 width: 12px; height: 12px; border-width: 2px;
}
[data-gallery-arrow-style="long"] :is(.gallery-simple__arrow, [data-lightbox-prev], [data-lightbox-next]) span::after {
 content: ''; position: absolute; top: 50%; width: 28px; height: 2px;
 transform: translateY(-50%); background: currentColor;
}
[data-gallery-arrow-style="long"] .gallery-simple__arrow--prev span::after { left: 12px; }
[data-gallery-arrow-style="long"] .gallery-simple__arrow--next span::after { right: 12px; }
.gallery-simple-lightbox[data-gallery-arrow-style="long"] [data-lightbox-prev] span::after { left: calc(50% - 6px); }
.gallery-simple-lightbox[data-gallery-arrow-style="long"] [data-lightbox-next] span::after { right: calc(50% - 6px); }

.gallery-simple__stage { touch-action: pan-y pinch-zoom; }
.gallery-simple__stage img { user-select: none; -webkit-user-drag: none; }

/* Disable double-tap zoom throughout both gallery surfaces; retain pinch zoom. */
.gallery-simple, .gallery-simple-lightbox { touch-action: manipulation; }

/* Override sticky mobile hover/focus without disabling the edge tap targets. */
.gallery-simple[data-gallery-touch-arrows] .gallery-simple__arrow { pointer-events: auto; }
.gallery-simple[data-gallery-touch-arrows="hidden"] .gallery-simple__arrow { opacity: 0; }
.gallery-simple[data-gallery-touch-arrows="visible"] .gallery-simple__arrow { opacity: 1; }
