/**
 * Tiny Theater PDX archive page (template-specific).
 */

.tiny-theater-pdx *,
.tiny-theater-pdx *::before,
.tiny-theater-pdx *::after {
	box-sizing: border-box;
}

.tiny-theater-pdx {
	font-family: Georgia, "Times New Roman", serif;
	background: #f5f3ee;
	color: #2a2a28;
	min-height: 60vh;
	padding: 2rem 1rem 3rem;
}

.tiny-theater-pdx-intro {
	text-align: center;
	margin-bottom: 2rem;
}

.tiny-theater-pdx-intro h1 {
	font-size: 2rem;
	font-weight: normal;
	letter-spacing: 0.02em;
	color: #1a1a18;
}

.tiny-theater-pdx-intro .entry-content,
.tiny-theater-pdx-intro p {
	font-size: 14px;
	color: #888;
	margin-top: 6px;
}

.tiny-theater-pdx-empty {
	max-width: 1100px;
	margin: 2rem auto;
	text-align: center;
	font-family: Arial, sans-serif;
	font-size: 15px;
	color: #666;
}

/* Modern masonry: natural image heights, tight columns */
.tiny-theater-pdx .gallery-grid.gallery-grid--masonry {
	max-width: 1280px;
	margin: 0 auto;
	column-gap: 10px;
	column-count: 4;
}

@media (max-width: 1024px) {
	.tiny-theater-pdx .gallery-grid.gallery-grid--masonry {
		column-count: 3;
	}
}

@media (max-width: 640px) {
	.tiny-theater-pdx .gallery-grid.gallery-grid--masonry {
		column-gap: 8px;
		column-count: 2;
	}
}

.tiny-theater-pdx .thumb-card {
	display: inline-block;
	width: 100%;
	margin: 0 0 10px;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	transition:
		transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.25s ease;
	box-shadow:
		0 1px 2px rgba(42, 42, 40, 0.06),
		0 4px 16px rgba(42, 42, 40, 0.04);
}

.tiny-theater-pdx .thumb-card:hover {
	transform: translateY(-4px);
	box-shadow:
		0 4px 12px rgba(42, 42, 40, 0.08),
		0 16px 40px rgba(42, 42, 40, 0.12);
}

.tiny-theater-pdx .thumb-card:focus-visible {
	outline: 2px solid #6b8f71;
	outline-offset: 3px;
}

.tiny-theater-pdx .img-wrap {
	width: 100%;
	background: #ebe8e2;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	min-height: 120px;
}

.tiny-theater-pdx .img-wrap img {
	width: 100%;
	height: auto;
	display: block;
}

.tiny-theater-pdx .img-placeholder {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 160px;
	color: #aaa;
	font-size: 13px;
	font-family: Arial, sans-serif;
	text-align: center;
	padding: 20px;
}

.tiny-theater-pdx .img-placeholder i {
	font-size: 32px;
}

.tiny-theater-pdx .caption {
	padding: 10px 12px 11px;
	font-size: 13px;
	line-height: 1.4;
	color: #5c5a56;
	border-top: 1px solid #f0eeea;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tiny-theater-pdx .caption:empty {
	display: none;
}

html.tiny-theater-pdx-modal-open,
html.tiny-theater-pdx-modal-open body {
	overflow: hidden;
}

/* Lightbox: lives under body; use ID selector so it still applies after relocate */
#tiny-theater-pdx-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.92);
	align-items: center;
	justify-content: center;
	padding: 44px 16px 12px;
	box-sizing: border-box;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

#tiny-theater-pdx-overlay.is-open {
	display: flex;
}

#tiny-theater-pdx-overlay .lb-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	cursor: pointer;
	font-size: 0;
	line-height: 0;
	transition: background 0.15s;
}

#tiny-theater-pdx-overlay .lb-close:hover {
	background: rgba(255, 255, 255, 0.22);
}

#tiny-theater-pdx-overlay .lb-close .ti {
	font-size: 22px;
	line-height: 1;
}

/*
 * Inner .lightbox must override the theme’s global gallery `.lightbox` rules
 * (_gallery-pg.scss: fixed fullscreen, visibility:hidden until .active).
 * This page uses #tiny-theater-pdx-overlay + .is-open instead of .lightbox.active.
 */
#tiny-theater-pdx-overlay .lightbox {
	position: relative;
	inset: auto;
	z-index: auto;
	background: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	max-width: 98vw;
	width: 100%;
	max-height: none;
	min-height: 0;
	margin: auto;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

#tiny-theater-pdx-overlay.is-open .lightbox {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

#tiny-theater-pdx-overlay .lb-img-viewport {
	overflow: hidden;
	width: min(96vw, 1600px);
	max-width: 100%;
	height: min(82vh, calc(100vh - 120px));
	min-height: 280px;
	position: relative;
	border-radius: 8px;
	background: #111;
	cursor: zoom-in;
	flex-shrink: 0;
}

#tiny-theater-pdx-overlay .lb-img-viewport.zoomed {
	cursor: grab;
}

#tiny-theater-pdx-overlay .lb-img-viewport.dragging {
	cursor: grabbing;
}

#tiny-theater-pdx-overlay .lb-img-viewport img {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	transform-origin: center center;
	max-width: none !important;
	max-height: none !important;
	width: auto;
	height: auto;
	border-radius: 0;
	display: block;
	transition:
		transform 0.15s ease,
		width 0.15s ease,
		height 0.15s ease;
	user-select: none;
	pointer-events: none;
	image-rendering: auto;
}

#tiny-theater-pdx-overlay #tiny-theater-pdx-lb-content {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

#tiny-theater-pdx-overlay .lb-img-placeholder {
	width: min(96vw, 1600px);
	max-width: 100%;
	height: min(82vh, calc(100vh - 120px));
	min-height: 280px;
	background: #1a1a1a;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 12px;
	color: #666;
	font-family: Arial, sans-serif;
	font-size: 14px;
}

#tiny-theater-pdx-overlay .lb-controls {
	display: flex;
	align-items: center;
	gap: 16px;
}

#tiny-theater-pdx-overlay .lb-btn {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	border-radius: 8px;
	padding: 8px 14px;
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 14px;
	font-family: Arial, sans-serif;
	transition: background 0.15s;
}

#tiny-theater-pdx-overlay .lb-btn .ti {
	font-size: 22px;
	line-height: 1;
}

#tiny-theater-pdx-overlay .lb-btn:hover {
	background: rgba(255, 255, 255, 0.22);
}

#tiny-theater-pdx-overlay .lb-label {
	color: rgba(255, 255, 255, 0.6);
	font-size: 13px;
	font-family: Arial, sans-serif;
	min-width: 60px;
	text-align: center;
}

#tiny-theater-pdx-overlay .lb-caption {
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	font-family: Arial, sans-serif;
	text-align: center;
	max-width: min(96vw, 1600px);
	padding: 0 8px;
	word-wrap: break-word;
}

@media (max-width: 640px) {
	#tiny-theater-pdx-overlay {
		padding: 40px 8px 8px;
	}

	#tiny-theater-pdx-overlay .lb-img-viewport,
	#tiny-theater-pdx-overlay .lb-img-placeholder {
		width: 100%;
		height: min(72vh, calc(100vh - 160px));
		min-height: 200px;
	}
}

#tiny-theater-pdx-overlay .zoom-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

#tiny-theater-pdx-overlay .zoom-btn {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	border-radius: 6px;
	width: 40px;
	height: 40px;
	cursor: pointer;
	font-size: 0;
	line-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.12s;
	font-family: Arial, sans-serif;
}

#tiny-theater-pdx-overlay .zoom-btn .ti {
	font-size: 20px;
	line-height: 1;
}

#tiny-theater-pdx-overlay .zoom-btn:hover {
	background: rgba(255, 255, 255, 0.22);
}

#tiny-theater-pdx-overlay .zoom-level {
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	font-family: Arial, sans-serif;
	min-width: 40px;
	text-align: center;
}

#tiny-theater-pdx-overlay .zoom-tip {
	color: rgba(255, 255, 255, 0.35);
	font-size: 12px;
	font-family: Arial, sans-serif;
}

#tiny-theater-pdx-overlay .lb-toolbar {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	justify-content: center;
	flex-shrink: 0;
	padding-bottom: 4px;
}

#tiny-theater-pdx-overlay .lb-btn-reset {
	padding: 8px 12px;
	min-width: 44px;
	min-height: 44px;
	font-size: 0;
}

#tiny-theater-pdx-overlay .lb-btn-reset .ti {
	font-size: 20px;
}