/* Neutral baseline -- usable on any theme. A theme restyles these same
   classes to match its own design system, rather than this plugin
   assuming a CSS framework is present. */

.ojji-gallery__item {
	border: 0;
	padding: 0;
	background: none;
	cursor: zoom-in;
	display: block;
}

.ojji-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Grid ---- */

.ojji-gallery--grid .ojji-gallery__track {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 10px;
}

.ojji-gallery--grid .ojji-gallery__item {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
}

/* ---- Carousel ---- */

.ojji-gallery--carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ojji-gallery--carousel .ojji-gallery__track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 4px;
}

.ojji-gallery--carousel .ojji-gallery__item {
	flex: 0 0 auto;
	width: 70%;
	max-width: 420px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 6px;
	scroll-snap-align: start;
}

@media (min-width: 640px) {
	.ojji-gallery--carousel .ojji-gallery__item {
		width: 320px;
	}
}

.ojji-gallery__nav {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
	font-size: 1.1rem;
}

/* ---- Lightbox (shared overlay, appended to <body> by assets/gallery.js) ---- */

.ojji-gallery-lightbox-open {
	overflow: hidden;
}

.ojji-gallery-lightbox {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.88);
	z-index: 10000;
	padding: 2rem;
}

.ojji-gallery-lightbox.is-open {
	display: flex;
}

.ojji-gallery-lightbox__figure {
	margin: 0;
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ojji-gallery-lightbox__img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	display: block;
}

.ojji-gallery-lightbox__caption {
	color: #fff;
	margin-top: 0.75rem;
	font-size: 0.9rem;
	text-align: center;
}

.ojji-gallery-lightbox__close,
.ojji-gallery-lightbox__nav {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
}

.ojji-gallery-lightbox__close {
	top: 1.25rem;
	right: 1.25rem;
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
	line-height: 1;
}

.ojji-gallery-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	font-size: 1.25rem;
}

.ojji-gallery-lightbox__nav--prev {
	left: 1.25rem;
}

.ojji-gallery-lightbox__nav--next {
	right: 1.25rem;
}
