/* Fullscreen photo viewer (built by gallery.js, attached to <body>). */
.cdv-lock, .cdv-lock body { overflow: hidden; }
.cdv { position: fixed; inset: 0; z-index: 100000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
	background: #0b0f17; color: #f8fafc; font-family: inherit; box-sizing: border-box; }
.cdv[hidden] { display: none; }
.cdv *, .cdv *::before, .cdv *::after { box-sizing: border-box; }

/* Every viewer button starts from a clean slate (no theme button styles). */
.cdv button { appearance: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
	color: inherit; font: inherit; line-height: 1; text-transform: none; letter-spacing: 0; min-height: 0; cursor: pointer; }
.cdv button:focus { outline: none; }
.cdv button:focus-visible { outline: 2px solid rgba(255,255,255,.85); outline-offset: 3px; border-radius: 8px; }
.cdv svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* Top bar: counter + title on the left, tools on the right. */
.cdv-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 24px; min-height: 64px; }
.cdv-count { font-size: 14px; font-weight: 700; color: #cbd5e1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cdv-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdv-tools { display: flex; gap: 4px; }
.cdv-tool { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px !important;
	color: rgba(255,255,255,.82); transition: background .15s, color .15s; }
.cdv-tool:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Photo area with side arrows. */
.cdv-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 84px; }
.cdv-frame { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y; }
.cdv-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; user-select: none; transition: transform .2s ease; }
.cdv-frame.is-zoomed { cursor: grab; touch-action: none; }
.cdv-frame.is-zoomed:active { cursor: grabbing; }
.cdv-frame.is-zoomed .cdv-img { transition: none; }
.cdv-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50% !important;
	display: inline-flex; align-items: center; justify-content: center; background: rgba(15,23,42,.55) !important; color: #fff; transition: background .15s; z-index: 3; }
.cdv-arrow:hover { background: rgba(15,23,42,.8) !important; }
.cdv-bar, .cdv-strip { position: relative; z-index: 3; background: #0b0f17; }
.cdv-arrow svg { width: 26px; height: 26px; }
.cdv-arrow--prev { left: 18px; }
.cdv-arrow--next { right: 18px; }

/* Thumbnail strip. */
.cdv-strip { display: flex; gap: 8px; padding: 14px 24px 20px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.cdv-strip::before, .cdv-strip::after { content: ""; flex: 1 0 0; }
.cdv-thumb { flex: 0 0 auto; width: 92px; aspect-ratio: 4 / 3; border-radius: 6px !important; overflow: hidden; opacity: .5; outline: 2px solid transparent; outline-offset: 0; transition: opacity .15s, outline-color .15s; }
.cdv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cdv-thumb:hover { opacity: .85; }
.cdv-thumb.is-active { opacity: 1; outline-color: #fff; }

@media (max-width: 640px) {
	.cdv-bar { padding: 8px 8px 8px 16px; min-height: 56px; }
	.cdv-title { display: none; }
	.cdv-stage { padding: 0; }
	.cdv-arrow { width: 42px; height: 42px; background: rgba(0,0,0,.45) !important; }
	.cdv-arrow--prev { left: 8px; } .cdv-arrow--next { right: 8px; }
	.cdv-strip { padding: 10px 12px 14px; }
	.cdv-thumb { width: 68px; }
}
@media (prefers-reduced-motion: reduce) { .cdv-img, .cdv-tool, .cdv-thumb { transition: none; } }
