/* Adithya Multimedia Gallery box – frontend styles */

.amgb-gallery {
	--amgb-columns: 4;
	--amgb-gap: 8px;
	display: grid;
	grid-template-columns: repeat(var(--amgb-columns), 1fr);
	gap: var(--amgb-gap);
	margin: 20px 0;
}

.amgb-item {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	aspect-ratio: 1 / 1;
}

.amgb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}

.amgb-item:hover img {
	transform: scale(1.06);
}

/* Layout variants */
.amgb-layout-columnized {
	display: block;
	column-count: var(--amgb-columns);
	column-gap: var(--amgb-gap);
}

.amgb-layout-columnized .amgb-item {
	display: block;
	width: 100%;
	margin-bottom: var(--amgb-gap);
	break-inside: avoid;
	aspect-ratio: auto;
}

.amgb-layout-masonry {
	display: block;
	column-count: var(--amgb-columns);
	column-gap: var(--amgb-gap);
}

.amgb-layout-masonry .amgb-item {
	display: block;
	width: 100%;
	margin-bottom: var(--amgb-gap);
	break-inside: avoid;
	aspect-ratio: auto;
}

.amgb-layout-justified {
	display: flex;
	flex-wrap: wrap;
}

.amgb-layout-justified .amgb-item {
	flex: 1 1 180px;
	aspect-ratio: 4 / 3;
}

.amgb-item.amgb-hidden {
	display: none;
}

.amgb-load-more-wrap {
	text-align: center;
	margin: 16px 0;
}

/* Tag filter + search */
.amgb-gallery-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.amgb-tag-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.amgb-tag-btn {
	background: #fff;
	border: 1px solid #d6d8db;
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	color: #3c3c3c;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.amgb-tag-btn:hover {
	border-color: #8bc34a;
}

.amgb-tag-btn.is-active {
	background: #7cb342;
	border-color: #7cb342;
	color: #fff;
}

.amgb-tag-count {
	opacity: .75;
	font-size: 11px;
}

.amgb-search-box {
	position: relative;
	flex: 0 0 auto;
}

.amgb-search-input {
	padding: 6px 32px 6px 12px;
	border: 1px solid #d6d8db;
	border-radius: 4px;
	font-size: 13px;
	min-width: 200px;
}

.amgb-item.amgb-filtered-out,
.amgb-collection-card.amgb-filtered-out {
	display: none !important;
}

/* Image-to-gallery Box layout */
.amgb-layout-box {
	position: relative;
	display: block;
	max-width: 340px;
}

.amgb-layout-box .amgb-item {
	display: none;
}

.amgb-layout-box .amgb-item:first-child {
	display: block;
	aspect-ratio: 4 / 3;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.amgb-layout-box .amgb-item:first-child::before,
.amgb-layout-box .amgb-item:first-child::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: inherit;
	border-radius: 6px;
	z-index: -1;
}

.amgb-layout-box .amgb-item:first-child::before {
	transform: translate(10px, 10px) rotate(2deg);
	background: #e0e0e0;
}

.amgb-layout-box .amgb-item:first-child::after {
	transform: translate(-10px, 8px) rotate(-2deg);
	background: #ececec;
}

.amgb-box-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 100, 148, 0.85);
	color: #fff;
	font-size: 28px;
	font-weight: 600;
	padding: 14px 22px;
	border-radius: 50%;
	line-height: 1;
}

/* Slider layout */
.amgb-layout-slider {
	display: block;
}

.amgb-layout-slider .amgb-slider-main {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.amgb-layout-slider .amgb-slider-main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.amgb-layout-slider .amgb-item {
	display: none;
}

.amgb-slider-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
}

.amgb-slider-thumb {
	flex: 0 0 auto;
	width: 76px;
	height: 56px;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	opacity: .6;
	border: 2px solid transparent;
}

.amgb-slider-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.amgb-slider-thumb.is-active {
	opacity: 1;
	border-color: #7cb342;
}

.amgb-slider-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
}

.amgb-slider-nav:hover {
	background: rgba(0, 0, 0, 0.65);
}

.amgb-slider-prev { left: 10px; }
.amgb-slider-next { right: 10px; }

/* Carousel layout */
.amgb-layout-carousel {
	position: relative;
}

.amgb-carousel-track {
	display: grid;
	grid-template-columns: repeat(var(--amgb-columns), 1fr);
	grid-auto-rows: 1fr;
	gap: var(--amgb-gap);
}

.amgb-layout-carousel .amgb-item {
	aspect-ratio: 1 / 1;
}

.amgb-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
}

.amgb-carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d6d8db;
	border: none;
	cursor: pointer;
	padding: 0;
}

.amgb-carousel-dot.is-active {
	background: #7cb342;
}

.amgb-carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: #fff;
	border: 1px solid #d6d8db;
	color: #444;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
}

.amgb-carousel-arrow:hover {
	background: #f5f5f5;
}

.amgb-carousel-prev { left: -16px; }
.amgb-carousel-next { right: -16px; }

/* Playlist layout: big player on the left, scrollable list on the right */
.amgb-layout-playlist {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-start;
}

.amgb-layout-playlist .amgb-item {
	display: none;
	aspect-ratio: auto;
}

.amgb-layout-playlist .amgb-item.amgb-playlist-active {
	display: block;
	flex: 1 1 480px;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	overflow: hidden;
	background: #000;
}

.amgb-playlist-sidebar {
	flex: 0 0 300px;
	max-width: 100%;
	background: #f7f7f7;
	border-radius: 6px;
	overflow: hidden;
}

.amgb-playlist-header {
	padding: 10px 14px;
	font-weight: 600;
	font-size: 14px;
	background: #ececec;
	border-bottom: 1px solid #e0e0e0;
}

.amgb-playlist-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 420px;
	overflow-y: auto;
}

.amgb-playlist-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	cursor: pointer;
	border-bottom: 1px solid #ececec;
	transition: background-color .15s ease;
}

.amgb-playlist-row:hover {
	background: #eef3f8;
}

.amgb-playlist-row.is-active {
	background: #dbe9f7;
}

.amgb-playlist-thumb {
	position: relative;
	flex: 0 0 72px;
	width: 72px;
	height: 44px;
	border-radius: 4px;
	overflow: hidden;
	background: #222;
}

.amgb-playlist-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.amgb-playlist-thumb-icon {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 14px;
}

.amgb-playlist-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 12px;
	background: rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity .15s ease;
}

.amgb-playlist-row:hover .amgb-playlist-play,
.amgb-playlist-row.is-active .amgb-playlist-play {
	opacity: 1;
}

.amgb-playlist-title {
	font-size: 13px;
	line-height: 1.3;
	color: #1a1a1a;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

@media (max-width: 700px) {
	.amgb-layout-playlist {
		flex-direction: column;
	}
	.amgb-layout-playlist .amgb-item.amgb-playlist-active {
		flex: 1 1 100%;
		width: 100%;
	}
	.amgb-playlist-sidebar {
		flex: 1 1 100%;
		width: 100%;
	}
	.amgb-playlist-list {
		max-height: 260px;
	}
	.amgb-playlist-row {
		display: flex;
		flex-direction: row;
	}
}

/* Video-containing carousels: full width, single column on small screens */
@media (max-width: 600px) {
	.amgb-carousel-has-video {
		grid-template-columns: 1fr !important;
	}

	.amgb-carousel-has-video .amgb-item {
		aspect-ratio: 16 / 9;
	}

	.amgb-carousel-has-video .amgb-carousel-arrow {
		width: 40px;
		height: 40px;
		font-size: 20px;
	}

	.amgb-carousel-has-video .amgb-carousel-prev { left: 6px; }
	.amgb-carousel-has-video .amgb-carousel-next { right: 6px; }

	.amgb-carousel-has-video .amgb-carousel-dot {
		width: 10px;
		height: 10px;
	}
}

/* Watermark overlay */
.amgb-has-watermark .amgb-item {
	position: relative;
}

.amgb-has-watermark .amgb-item::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--amgb-wm-url);
	background-repeat: no-repeat;
	background-size: 30%;
	opacity: var(--amgb-wm-opacity, 0.5);
	pointer-events: none;
}

.amgb-wm-center .amgb-item::after   { background-position: center; }
.amgb-wm-top-left .amgb-item::after     { background-position: 8% 8%; }
.amgb-wm-top-right .amgb-item::after    { background-position: 92% 8%; }
.amgb-wm-bottom-left .amgb-item::after  { background-position: 8% 92%; }
.amgb-wm-bottom-right .amgb-item::after { background-position: 92% 92%; }

.amgb-no-select img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* Collections */
.amgb-collection-controls {
	margin-bottom: 14px;
}

.amgb-collection-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 18px;
}

.amgb-collection-card.amgb-hidden {
	display: none;
}

.amgb-collection-card {
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow .2s ease;
}

.amgb-collection-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.amgb-collection-card-cover {
	display: block;
	aspect-ratio: 4 / 3;
	background: #f0f0f1;
}

.amgb-collection-card-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.amgb-collection-card-body {
	padding: 12px 14px;
}

.amgb-collection-card-body h4 {
	margin: 0 0 6px;
	font-size: 15px;
}

.amgb-collection-card-body p {
	margin: 0 0 8px;
	font-size: 13px;
	color: #555;
}

.amgb-collection-card-count {
	font-size: 12px;
	color: #888;
}

.amgb-collection-inline-gallery {
	grid-column: 1 / -1;
	margin: 6px 0 10px;
}

/* Video items */
.amgb-item-video video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	background: #000;
}

.amgb-item-video-no-poster {
	background: linear-gradient(135deg, #2b2b2b, #111);
}

.amgb-video-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #222;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	pointer-events: none;
}

/* Auto-population captions */
.amgb-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 2px;
	pointer-events: none;
}

.amgb-caption-title {
	font-size: 13px;
	line-height: 1.3;
}

.amgb-caption-author {
	font-size: 11px;
	opacity: 0.85;
}

.amgb-caption-desc {
	font-size: 11px;
	opacity: 0.75;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* External embeds (YouTube/Facebook/Instagram/Google Drive) */
.amgb-item-embed {
	position: relative;
}

.amgb-embed-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #000;
}

.amgb-embed-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Instagram's embed is naturally taller than a 16:9/1:1 video box (it
   includes the caption below the media), so it needs its own aspect
   ratio rather than being squeezed into whatever box every other
   embed type uses. */
.amgb-item-embed-instagram {
	aspect-ratio: 4 / 5 !important;
}

/* A YouTube link with a playlist attached renders YouTube's own player
   PLUS its native playlist panel underneath, in the same iframe — that
   needs real extra height, not the standard 16:9 video box, or the
   playlist panel gets cropped off. It also looks better spanning the
   full gallery width rather than being squeezed into one grid column. */
.amgb-item-embed-youtube-playlist {
	aspect-ratio: auto !important;
	height: 480px;
	grid-column: 1 / -1;
}
@media (max-width: 480px) {
	.amgb-item-embed-youtube-playlist {
		height: 420px;
	}
}

/* Upload form */
.amgb-upload-form {
	max-width: 480px;
}

.amgb-upload-notice {
	padding: 10px 14px;
	border-radius: 4px;
	background: #f0f0f1;
}

.amgb-upload-success {
	background: #d7f2d7;
}

.amgb-upload-error {
	background: #fbe1e1;
}

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

/* Lightbox */
.amgb-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}

.amgb-lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}

.amgb-lightbox img {
	max-width: 90vw;
	max-height: 85vh;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.amgb-lightbox-close,
.amgb-lightbox-prev,
.amgb-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 10px 14px;
	border-radius: 4px;
}

.amgb-lightbox-close:hover,
.amgb-lightbox-prev:hover,
.amgb-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.25);
}

.amgb-lightbox-close {
	top: 20px;
	right: 20px;
}

.amgb-lightbox-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.amgb-lightbox-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}
