/* ==========================================================================
   Gallery Slideshow Styles
   ========================================================================== */

/**
 * Gallery Image Viewer
 */
.jj-gallery-viewer {
	margin-bottom: 20px;
}

.jj-gallery-main-image {
	margin: 0 0 15px 0;
	padding: 0;
}

.jj-gallery-main-image img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	transition: opacity 0.2s ease;
}

/**
 * Gallery Navigation
 */
.jj-gallery-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	gap: 10px;
}

.jj-gallery-nav__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	background-color: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #333;
	text-decoration: none;
	font-size: 14px;
	transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
	cursor: pointer;
}

.jj-gallery-nav__btn:hover {
	background-color: #e5e5e5;
	border-color: #ccc;
	text-decoration: none;
	color: #333;
}

.jj-gallery-nav__btn.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}

.jj-gallery-nav__btn .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	line-height: 1;
}

.jj-gallery-nav__prev {
	margin-right: auto;
}

.jj-gallery-nav__next {
	margin-left: auto;
}

.jj-gallery-nav__counter {
	font-size: 14px;
	color: #666;
	font-weight: 500;
}

.jj-gallery-nav__label {
	font-size: 14px;
}

/**
 * Parent Post Excerpt
 */
.jj-gallery-excerpt {
	margin-bottom: 20px;
	padding: 15px;
	background-color: #f9f9f9;
	border-left: 3px solid #ddd;
	font-size: 14px;
	line-height: 1.6;
}

.jj-gallery-excerpt__link {
	display: inline-block;
	margin-top: 8px;
	font-weight: 600;
}

/**
 * Thumbnail Strip
 */
.jj-gallery-thumbs {
	margin-bottom: 20px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.jj-gallery-thumbs__title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 10px 0;
}

.jj-gallery-thumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jj-gallery-thumbs__item {
	display: block;
	border: 2px solid transparent;
	transition: border-color 0.2s ease, opacity 0.2s ease;
	opacity: 0.7;
}

.jj-gallery-thumbs__item:hover {
	opacity: 1;
}

.jj-gallery-thumbs__item.is-active {
	border-color: #333;
	opacity: 1;
}

.jj-gallery-thumbs__item img {
	display: block;
	width: 80px;
	height: 120px;
	object-fit: cover;
}

/**
 * Back to Article
 */
.jj-gallery-back {
	padding-top: 15px;
	border-top: 1px solid #eee;
	font-size: 14px;
}

.jj-gallery-back p {
	margin: 0;
}

/**
 * Gallery Slider (in-post thumbnail strip)
 */
.jj-gallery-slider {
	margin: 20px 0;
}

.jj-gallery-slider__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jj-gallery-slider__slide {
	flex: 0 0 auto;
}

.jj-gallery-slider__slide img {
	display: block;
	width: 80px;
	height: 120px;
	object-fit: cover;
}

/**
 * Photo Credit (below post content / gallery)
 */
.jj-photo-credit {
	margin-top: 10px;
	font-size: 13px;
	color: #666;
	font-style: italic;
}

.jj-photo-credit a {
	color: #666;
	text-decoration: underline;
}

/* ==========================================================================
   Prev / Next Post Navigation
   ========================================================================== */

.jj-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.jj-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 48%;
	text-decoration: none;
	color: #333;
	transition: color 0.2s ease;
}

.jj-post-nav__link:hover {
	color: #000;
	text-decoration: none;
}

.jj-post-nav__next {
	margin-left: auto;
	text-align: right;
}

.jj-post-nav__label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
}

.jj-post-nav__title {
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media ( max-width: 768px ) {
	.jj-gallery-nav__label {
		display: none;
	}

	.jj-gallery-nav__btn {
		padding: 8px 12px;
	}

	.jj-gallery-nav__btn .dashicons {
		font-size: 24px;
		width: 24px;
		height: 24px;
	}

	.jj-gallery-thumbs__item img {
		width: 60px;
		height: 90px;
	}

	.jj-gallery-slider__slide img {
		width: 60px;
		height: 90px;
	}

	.jj-post-nav {
		flex-direction: column;
		gap: 15px;
	}

	.jj-post-nav__link {
		max-width: 100%;
	}

	.jj-post-nav__next {
		text-align: left;
	}
}
