.apcph-pg-gallery {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.apcph-pg-gallery__search {
	width: 100%;
	max-width: 400px;
	padding: 10px 14px;
	font-size: 15px;
	border: 1px solid #d8d8dc;
	border-radius: 10px;
	margin-bottom: 20px;
	display: block;
	box-sizing: border-box;
}

.apcph-pg-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.apcph-pg-card__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid #e4e4e7;
	border-radius: 10px;
	overflow: hidden;
	background: #f2f2f4;
	cursor: pointer;
	aspect-ratio: 3 / 4;
}

.apcph-pg-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.apcph-pg-card__title {
	font-size: 14px;
	font-weight: 600;
	margin-top: 8px;
	line-height: 1.3;
}

.apcph-pg-card__author {
	font-size: 12px;
	color: #6b6b70;
	margin-top: 2px;
}

.apcph-pg-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.apcph-pg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.apcph-pg-modal__content {
	position: relative;
	background: #1c1c1e;
	border-radius: 12px;
	width: 95vw;
	height: 92vh;
	z-index: 1;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.apcph-pg-modal__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 14px;
	background: #2a2a2d;
	color: #fff;
	flex-shrink: 0;
}

.apcph-pg-modal__heading {
	flex: 1;
	min-width: 0;
}

.apcph-pg-modal__title {
	font-size: 14px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apcph-pg-modal__author {
	font-size: 12px;
	color: #b3b3b8;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apcph-pg-modal__zoom {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.apcph-pg-modal__zoom button {
	min-width: 36px;
	height: 32px;
	padding: 0 10px;
	border-radius: 6px;
	border: 1px solid #44444a;
	background: #33333a;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

.apcph-pg-modal__zoom button:hover {
	background: #44444a;
}

.apcph-pg-modal__close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #33333a;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
	flex-shrink: 0;
}

.apcph-pg-modal__close:hover {
	background: #44444a;
}

.apcph-pg-modal__viewport {
	flex: 1;
	overflow: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.apcph-pg-modal__viewport img {
	max-width: 100%;
	max-height: 100%;
	transform-origin: center center;
	transition: transform 0.15s ease;
	display: block;
}

.apcph-pg-modal__error {
	color: #ff8a8a;
	font-size: 14px;
	text-align: center;
	padding: 16px;
}
.apcph-pg-modal[hidden] {
    display: none !important;
}