/* ===== กริดของอัลบั้ม (จัดเป็นคอลัมน์) ===== */
.cg-albums {
	display: grid;
	width: 100%;
	/* grid-template-columns และ gap กำหนดจากหน้า Elementor */
}

.cg-box {
	--cg-inner-gap: 8px;
	display: flex;
	flex-direction: column;
}

/* ===== ภาพปก + รูปย่อย ===== */
.cg-cover,
.cg-thumb {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
	background: #f0f0f0;
	cursor: pointer;
}

.cg-cover img,
.cg-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease, filter 0.35s ease;
}

.cg-thumbs {
	display: grid;
	grid-template-columns: repeat(var(--cg-thumbs-cols, 4), 1fr);
	gap: var(--cg-inner-gap, 8px);
	margin-top: var(--cg-inner-gap, 8px);
}

/* ===== ป้าย +N ===== */
.cg-plus {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
}

/* ===== ชื่ออัลบั้ม ===== */
.cg-title {
	margin-top: 10px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
}

/* ===== ลิงก์ที่ซ่อนไว้ (ยังอยู่ใน lightbox) ===== */
.cg-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	opacity: 0;
	pointer-events: none;
}

/* ===== เอฟเฟกต์ hover ===== */
.cg-hover-zoom .cg-cover:hover img,
.cg-hover-zoom .cg-thumb:hover img {
	transform: scale(1.08);
}

.cg-hover-fade .cg-cover:hover img,
.cg-hover-fade .cg-thumb:hover img {
	filter: brightness(0.6);
}

.cg-hover-lift .cg-box {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cg-hover-lift .cg-box:hover {
	transform: translateY(-5px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

/* ============================================================
   Lightbox มาตรฐานของปลั๊กอิน (ใช้กับ shortcode)
   ============================================================ */
.cg-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.92);
	display: none;
	flex-direction: column;
	padding: 16px;
}
.cg-lb.is-open { display: flex; }

.cg-lb__stage {
	flex: 1;
	margin: 0;
	min-height: 0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cg-lb__img {
	max-width: 90vw;
	max-height: 72vh;
	object-fit: contain;
	display: block;
}

.cg-lb__counter {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 14px;
	background: rgba(0, 0, 0, 0.4);
	padding: 4px 14px;
	border-radius: 20px;
}

.cg-lb__close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: none;
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.cg-lb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
}
.cg-lb__prev { left: 18px; }
.cg-lb__next { right: 18px; }
.cg-lb__nav:hover { background: rgba(255, 255, 255, 0.25); }

.cg-lb__strip {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 12px 4px 4px;
	justify-content: center;
}
.cg-lb__strip img {
	width: 60px;
	height: 60px;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 4px;
	border: 2px solid transparent;
	opacity: 0.5;
	cursor: pointer;
}
.cg-lb__strip img.is-active {
	opacity: 1;
	border-color: #fff;
}

/* ============================================================
   reset ไม่ให้ธีมใส่กรอบ/เส้นใต้/เงา ให้ลิงก์รูปในกล่องอัลบั้ม
   ============================================================ */
.cg-box a {
	display: block;
	border: 0;
	outline: 0;
	box-shadow: none;
	text-decoration: none;
	background: none;
}
.cg-box a:hover,
.cg-box a:focus {
	border: 0;
	outline: 0;
	box-shadow: none;
}
.cg-cover img,
.cg-thumb img {
	border: 0;
}
