/* Simple External Image Gallery styles */

.seg-gallery-wrap {
	--seg-gap: 12px;
	margin: 24px 0;
}

.seg-grid {
	display: grid;
	grid-template-columns: repeat(var(--seg-columns, 4), 1fr);
	gap: var(--seg-gap);
}

.seg-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: #f0f0f0;
	aspect-ratio: 1 / 1;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.seg-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.seg-link {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.seg-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Pagination */

.seg-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 20px;
}

.seg-page-link {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 4px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	font-size: 14px;
	line-height: 1.4;
}

.seg-page-link:hover {
	background: #f5f5f5;
}

.seg-page-link.seg-active {
	background: #1e1e1e;
	border-color: #1e1e1e;
	color: #fff;
}

.seg-empty {
	opacity: 0.7;
}

/* Modal / lightbox popup */

.seg-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
}

.seg-modal.seg-open {
	display: flex;
}

.seg-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.seg-modal-content {
	position: relative;
	z-index: 1;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.seg-modal-img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	background: #111;
}

.seg-modal-caption {
	color: #fff;
	margin-top: 12px;
	text-align: center;
	font-size: 14px;
	max-width: 80vw;
}

.seg-modal-close {
	position: absolute;
	top: -40px;
	right: -8px;
	background: none;
	border: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.seg-modal-close:hover {
	opacity: 0.75;
}

/* Responsive */

@media (max-width: 782px) {
	.seg-grid {
		grid-template-columns: repeat(min(3, var(--seg-columns, 4)), 1fr);
	}
}

@media (max-width: 480px) {
	.seg-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.seg-modal-close {
		top: -36px;
		right: 0;
		font-size: 28px;
	}
}
