/* =========================================================
   Gallery Modern — ภาพผลงาน / วิดีโอผลงาน
   ========================================================= */

:root {
	--g-red: #c80000;
	--g-red-dark: #8f0000;
	--g-ink: #1d1d1f;
	--g-muted: #6b7280;
	--g-line: #e8e8ec;
	--g-bg: #f6f6f8;
	--g-radius: 16px;
	--g-shadow: 0 4px 18px rgba(20, 20, 30, .07);
	--g-shadow-hover: 0 18px 38px rgba(140, 0, 0, .18);
}

/* ---------- HERO ---------- */
.g-hero {
	position: relative;
	padding: 64px 0 60px;
	background-size: cover;
	background-position: center center;
	overflow: hidden;
}
.g-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(120, 0, 0, .93) 0%, rgba(200, 0, 0, .82) 55%, rgba(40, 0, 0, .92) 100%);
}
.g-hero > .container {
	position: relative;
	z-index: 2;
}
.g-hero-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px;
	margin-bottom: 16px;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 999px;
	color: #fff;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: .3px;
	background: rgba(255, 255, 255, .10);
	backdrop-filter: blur(4px);
}
.g-hero h1 {
	color: #fff !important;
	font-size: 42px;
	line-height: 54px;
	font-weight: 600;
	margin: 0 0 12px;
	text-shadow: 0 3px 18px rgba(0, 0, 0, .35);
}
.g-hero p.g-hero-sub {
	color: rgba(255, 255, 255, .88) !important;
	font-size: 17px;
	line-height: 29px !important;
	max-width: 640px;
	margin: 0 auto !important;
}
.g-hero-stats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 26px;
}
.g-hero-stats span {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 20px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	border: 1px solid rgba(255, 255, 255, .25);
	color: #fff;
	font-size: 15px;
	line-height: 22px;
}
.g-hero-stats span i {
	opacity: .85;
}

/* ---------- TOOLBAR (ค้นหา + จำนวน) ---------- */
.g-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 30px;
}
.g-toolbar-title {
	font-size: 24px;
	line-height: 34px;
	font-weight: 600;
	color: var(--g-ink);
	margin: 0;
	position: relative;
	padding-left: 16px;
}
.g-toolbar-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	bottom: 6px;
	width: 5px;
	border-radius: 4px;
	background: linear-gradient(180deg, var(--g-red) 0%, var(--g-red-dark) 100%);
}
.g-toolbar-title small {
	display: block;
	font-size: 14px;
	line-height: 20px;
	color: var(--g-muted);
	font-weight: 400;
}
.g-search {
	position: relative;
	flex: 0 1 340px;
	min-width: 240px;
}
.g-search i {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	color: #b9b9c2;
	font-size: 15px;
	pointer-events: none;
}
.g-search input {
	width: 100%;
	height: 48px;
	padding: 0 18px 0 44px;
	border: 1px solid var(--g-line);
	border-radius: 999px;
	background: #fff;
	font-size: 16px;
	color: var(--g-ink);
	outline: none;
	transition: box-shadow .25s ease, border-color .25s ease;
}
.g-search input:focus {
	border-color: rgba(200, 0, 0, .45);
	box-shadow: 0 0 0 4px rgba(200, 0, 0, .09);
}

/* ---------- SECTION TITLE (จัดกลาง ไม่มีแถบข้าง) ---------- */
.g-section-title {
	font-size: 27px;
	line-height: 38px;
	font-weight: 600;
	color: var(--g-ink);
	margin: 0 0 10px;
}
.g-section-sub {
	color: var(--g-muted) !important;
	margin: 0 0 26px !important;
}

/* ---------- GRID ---------- */
.g-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 26px 22px;
}
.g-grid.g-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g-item.is-hidden,
.g-item.is-filtered {
	display: none;
}

/* ---------- CARD ---------- */
.g-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--g-line);
	border-radius: var(--g-radius);
	overflow: hidden;
	text-decoration: none !important;
	box-shadow: var(--g-shadow);
	transition: transform .32s cubic-bezier(.2, .7, .3, 1), box-shadow .32s ease, border-color .32s ease;
}
.g-card:hover,
.g-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: var(--g-shadow-hover);
	border-color: rgba(200, 0, 0, .25);
}
.g-card-media {
	position: relative;
	width: 100%;
	padding-top: 72%;
	overflow: hidden;
	background: #ececf0;
}
.g-card-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .55s cubic-bezier(.2, .7, .3, 1);
}
.g-card:hover .g-card-media img {
	transform: scale(1.07);
}
.g-card-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .35) 100%);
	opacity: 0;
	transition: opacity .35s ease;
}
.g-card:hover .g-card-media::after {
	opacity: 1;
}
.g-card-zoom {
	position: absolute;
	z-index: 2;
	right: 14px;
	bottom: 14px;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--g-red);
	color: #fff;
	font-size: 15px;
	opacity: 0;
	transform: translateY(10px) scale(.85);
	transition: all .35s cubic-bezier(.2, .7, .3, 1);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.g-card:hover .g-card-zoom {
	opacity: 1;
	transform: translateY(0) scale(1);
}
.g-card-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 18px 18px;
}
.g-card-title {
	margin: 0;
	font-size: 16px;
	line-height: 25px;
	font-weight: 600;
	color: var(--g-ink);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color .25s ease;
	min-height: 50px;
}
.g-card:hover .g-card-title {
	color: var(--g-red);
}
.g-card-more {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	line-height: 20px;
	color: var(--g-red);
	font-weight: 500;
}
.g-card-more i {
	transition: transform .3s ease;
	font-size: 12px;
}
.g-card:hover .g-card-more i {
	transform: translateX(5px);
}

/* ---------- VIDEO CARD ---------- */
.g-video {
	display: block;
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	border-radius: var(--g-radius);
	overflow: hidden;
	background: #0d0d0f;
	border: 1px solid var(--g-line);
	box-shadow: var(--g-shadow);
	cursor: pointer;
	transition: transform .32s cubic-bezier(.2, .7, .3, 1), box-shadow .32s ease;
}
.g-video:hover {
	transform: translateY(-6px);
	box-shadow: var(--g-shadow-hover);
}
.g-video.is-playing {
	cursor: default;
	transform: none;
}
.g-video img,
.g-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.g-video img {
	object-fit: cover;
	transition: transform .55s cubic-bezier(.2, .7, .3, 1), filter .35s ease;
}
.g-video:hover img {
	transform: scale(1.06);
	filter: brightness(.82);
}
.g-video-play {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 68px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	padding: 0;
	border-radius: 50%;
	background: rgba(200, 0, 0, .95);
	color: #fff;
	font-size: 24px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
	transition: transform .3s cubic-bezier(.2, .7, .3, 1), background .3s ease;
}
.g-video:hover .g-video-play {
	transform: translate(-50%, -50%) scale(1.12);
	background: #e00000;
}
.g-video-play::before {
	content: "";
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .35);
}
.g-video-badge {
	position: absolute;
	z-index: 2;
	left: 14px;
	top: 14px;
	padding: 5px 13px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 13px;
	line-height: 19px;
	backdrop-filter: blur(3px);
}
.g-video.is-playing .g-video-play,
.g-video.is-playing .g-video-badge {
	display: none;
}
.g-video-admin {
	margin-top: 12px;
	text-align: center;
}

/* ---------- LOAD MORE ---------- */
.g-more {
	margin-top: 42px;
	text-align: center;
}
.g-more .g-count {
	display: block;
	margin-bottom: 14px;
	color: var(--g-muted);
	font-size: 15px;
	line-height: 22px;
}
.g-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 34px;
	border: 0;
	border-radius: 999px;
	font-size: 17px;
	line-height: 24px;
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
	transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.g-btn-primary {
	background: linear-gradient(120deg, #a80000 0%, #cb0000 100%);
	color: #fff !important;
	box-shadow: 0 8px 22px rgba(180, 0, 0, .28);
}
.g-btn-primary:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(180, 0, 0, .38);
	color: #fff !important;
}
.g-btn-ghost {
	background: #fff;
	color: var(--g-red) !important;
	border: 2px solid rgba(200, 0, 0, .35);
}
.g-btn-ghost:hover {
	transform: translateY(-3px);
	border-color: var(--g-red);
	box-shadow: 0 12px 26px rgba(180, 0, 0, .18);
}
.g-btn-light {
	background: #fff;
	color: var(--g-red) !important;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
.g-btn-light:hover {
	transform: translateY(-3px);
	color: var(--g-red) !important;
}
.g-btn-outline-light {
	background: transparent;
	color: #fff !important;
	border: 2px solid rgba(255, 255, 255, .7);
}
.g-btn-outline-light:hover {
	background: rgba(255, 255, 255, .12);
	color: #fff !important;
	transform: translateY(-3px);
}

/* ---------- EMPTY STATE ---------- */
.g-empty {
	display: none;
	padding: 60px 20px;
	text-align: center;
	color: var(--g-muted);
	background: var(--g-bg);
	border-radius: var(--g-radius);
}
.g-empty i {
	display: block;
	font-size: 40px;
	margin-bottom: 14px;
	color: #c9c9d2;
}
.g-empty.is-visible {
	display: block;
}

/* ---------- CTA ---------- */
.g-cta {
	position: relative;
	padding: 54px 0;
	background: linear-gradient(120deg, #1f1f22 0%, #2c2c31 100%);
	overflow: hidden;
}
.g-cta::after {
	content: "";
	position: absolute;
	right: -80px;
	top: -80px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(200, 0, 0, .45) 0%, rgba(200, 0, 0, 0) 70%);
}
.g-cta > .container {
	position: relative;
	z-index: 2;
}
.g-cta h2 {
	color: #fff;
	font-size: 28px;
	line-height: 40px;
	font-weight: 600;
	margin: 0 0 8px;
}
.g-cta p {
	color: rgba(255, 255, 255, .72) !important;
	margin: 0 0 22px !important;
}
.g-cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

/* ---------- ADMIN BAR ---------- */
.g-adminbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 18px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1199px) {
	.g-grid {
		gap: 22px 18px;
	}
}
@media (max-width: 991px) {
	.g-grid,
	.g-grid.g-grid-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.g-hero h1 {
		font-size: 34px;
		line-height: 46px;
	}
}
@media (max-width: 767px) {
	.g-grid,
	.g-grid.g-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px 14px;
	}
	.g-hero {
		padding: 46px 0 44px;
	}
	.g-hero h1 {
		font-size: 27px;
		line-height: 38px;
	}
	.g-hero p.g-hero-sub {
		font-size: 15px;
		line-height: 26px !important;
	}
	.g-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.g-search {
		flex: 1 1 auto;
	}
	.g-card-body {
		padding: 12px 13px 14px;
		gap: 7px;
	}
	.g-card-title {
		font-size: 14px;
		line-height: 22px;
		min-height: 44px;
	}
	.g-card-more {
		font-size: 13px;
	}
	.g-video-play {
		width: 54px;
		height: 54px;
		font-size: 19px;
	}
	.g-cta h2 {
		font-size: 22px;
		line-height: 33px;
	}
}
@media (max-width: 575px) {
	.g-grid.g-grid-3 {
		grid-template-columns: minmax(0, 1fr);
	}
}
