.wg-app {
	--wg-ink: #1c1c1c;
	--wg-muted: #6b7280;
	--wg-line: #e6e6e6;
	--wg-soft: #f3f4f6;
	--wg-card: #ececec;
	color: var(--wg-ink);
	font-family: inherit;
	line-height: 1.5;
}

.wg-app *,
.wg-app *::before,
.wg-app *::after,
.wg-lightbox *,
.wg-lightbox *::before,
.wg-lightbox *::after {
	box-sizing: border-box;
}

body.wow-gallery-page .wp-block-post-content > .wg-app {
	max-width: min(1120px, calc(100vw - 48px)) !important;
	width: auto;
}

.wg-wrap {
	width: min(1120px, calc(100% - 32px));
	margin: 0 auto;
}

.wg-hero {
	background-color: var(--wg-soft);
	background-image: repeating-linear-gradient(
		-28deg,
		transparent,
		transparent 18px,
		rgba(0, 0, 0, 0.035) 18px,
		rgba(0, 0, 0, 0.035) 19px
	);
	padding: 42px 0 36px;
	margin: 0 0 8px;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.wg-hero.has-image {
	background-size: cover;
	background-position: center;
	position: relative;
}

.wg-hero.has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(243, 244, 246, 0.82);
}

.wg-hero .wg-wrap {
	position: relative;
}

.wg-eyebrow {
	margin: 0 0 6px;
	color: var(--wg-muted);
	font-size: 0.875rem;
}

.wg-hero-title {
	margin: 0;
	font-size: 2.75rem;
	line-height: 1.2;
	font-weight: 700;
	color: #111;
}

.wg-crumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	align-items: center;
	margin: 18px 0 16px;
	color: var(--wg-muted);
	font-size: 0.8125rem;
}

.wg-crumb a {
	color: var(--wg-muted);
	text-decoration: none;
}

.wg-crumb a:hover {
	color: #111;
	text-decoration: underline;
}

.wg-crumb-sep {
	margin: 0 8px;
}

.wg-list-head {
	margin-bottom: 6px;
}

.wg-list-title,
.wg-album-title {
	margin: 0;
	font-size: 1.625rem;
	line-height: 1.35;
	font-weight: 700;
}

.wg-list-sub,
.wg-album-desc {
	margin: 6px 0 0;
	color: #444;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.wg-album-desc {
	margin: 14px 0 18px;
}

.wg-album-desc p {
	margin: 0 0 0.6em;
}

.wg-toolbar,
.wg-album-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.wg-toolbar {
	margin: 14px 0 22px;
}

.wg-toolbar-end {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}

.wg-album-bar {
	margin-top: 10px;
}

.wg-total {
	margin: 0;
	font-size: 0.875rem;
	color: #444;
}

.wg-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--wg-muted);
	font-size: 0.875rem;
}

.wg-sort select {
	appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23333' stroke-width='1.4' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	padding: 7px 32px 7px 12px;
	font: inherit;
	color: #222;
	cursor: pointer;
}

.wg-albums,
.wg-photos {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wg-albums {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px 20px;
}

.wg-card {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
}

.wg-card-copy {
	display: contents;
}

.wg-card:hover {
	color: inherit;
}

.wg-thumb {
	position: relative;
	display: block;
	order: -1;
	aspect-ratio: 4 / 3;
	background: var(--wg-card);
	border-radius: 10px;
	overflow: hidden;
}

.wg-thumb.is-empty {
	background:
		linear-gradient(to top left, transparent calc(50% - 1px), rgba(0, 0, 0, 0.08), transparent calc(50% + 1px)),
		linear-gradient(to top right, transparent calc(50% - 1px), rgba(0, 0, 0, 0.08), transparent calc(50% + 1px)),
		var(--wg-card);
}

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

.wg-card:hover .wg-thumb img {
	transform: scale(1.035);
}

.wg-badge {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	background: #2c2c2c;
	color: #fff;
	border-radius: 6px;
	padding: 3px 8px;
	font-size: 0.75rem;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.wg-badge svg {
	display: block;
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
}

.wg-card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 10px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.45;
}

.wg-card-meta,
.wg-album-meta,
.wg-meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wg-card-meta,
.wg-album-meta {
	margin: 6px 0 0;
	color: var(--wg-muted);
	font-size: 0.8125rem;
	flex-wrap: wrap;
}

.wg-card-meta {
	flex-wrap: nowrap;
	gap: 4px;
	font-size: 0.78125rem;
}

.wg-card-meta .wg-meta-item {
	white-space: nowrap;
	gap: 4px;
}

.wg-album-meta {
	margin: 0;
	font-size: 0.875rem;
}

.wg-meta-sep {
	color: #c5c5c5;
}

.wg-photos {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.wg-photo-item.is-deferred {
	display: none;
}

.wg-photo {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--wg-card);
	border-radius: 6px;
	overflow: hidden;
	cursor: zoom-in;
	aspect-ratio: 1;
}

.wg-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wg-photo:hover img {
	opacity: 0.92;
}

.wg-actions,
.wg-share {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.wg-app a.wg-icon-btn {
	color: #222;
	text-decoration: none;
}

.wg-icon-btn,
.wg-slide-btn,
.wg-more {
	font-family: inherit;
	background: #fff;
	color: #222;
	border: 1px solid #e5e7eb;
	cursor: pointer;
}

.wg-icon-btn {
	width: 38px;
	height: 38px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding: 0;
}

#wg-native-share[hidden] {
	display: none;
}

.wg-slide-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	border-radius: 999px;
	font-size: 0.875rem;
}

.wg-icon-btn:hover,
.wg-slide-btn:hover,
.wg-more:hover {
	border-color: #111;
	color: #111;
}

.wg-more {
	display: block;
	margin: 26px auto 0;
	border-radius: 999px;
	padding: 8px 18px;
	font-size: 0.875rem;
}

.wg-related {
	margin-top: 48px;
}

.wg-related h2 {
	margin: 0 0 18px;
	font-size: 1.25rem;
	line-height: 1.35;
	font-weight: 700;
}

.wg-lb-swipe {
	display: none;
	margin: 14px 0 0;
	padding: 6px 14px;
	border: 1px dashed rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.75rem;
	line-height: 1.4;
	text-align: center;
}

.wg-sentinel {
	height: 1px;
}

.wg-pager {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 36px 0 12px;
}

.wg-pager a,
.wg-pager span {
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--wg-line);
	border-radius: 8px;
	color: #222;
	text-decoration: none;
	background: #fff;
	font-size: 0.875rem;
}

.wg-pager .is-current {
	background: #2c2c2c;
	border-color: #2c2c2c;
	color: #fff;
}

.wg-pager .is-disabled {
	opacity: 0.35;
}

.wg-pager .is-gap {
	border: 0;
	background: transparent;
	min-width: 24px;
}

.wg-empty {
	margin: 12px 0 24px;
	padding: 48px 16px;
	text-align: center;
	color: #666;
	border: 1px dashed #ddd;
	border-radius: 12px;
}

.wg-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wg-card:focus-visible,
.wg-photo:focus-visible,
.wg-icon-btn:focus-visible,
.wg-slide-btn:focus-visible,
.wg-more:focus-visible,
.wg-pager a:focus-visible,
.wg-sort select:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

html:has(body.wow-gallery-page),
body.wow-gallery-page {
	overflow-x: clip;
}

body.wg-lock {
	overflow: hidden;
}

body.wow-gallery-page .wp-block-post-title,
body.wow-gallery-page h1.entry-title {
	display: none;
}

.wg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #161616;
	color: #fff;
	display: flex;
	flex-direction: column;
	font-family: inherit;
}

.wg-lightbox[hidden] {
	display: none !important;
}

.wg-lb-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	padding: 18px 22px 8px;
}

.wg-lb-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	min-width: 0;
}

.wg-lb-title,
.wg-lb-counter,
.wg-lb-count-text {
	margin: 0;
}

.wg-lb-title {
	font-size: 0.9375rem;
	font-weight: 600;
}

.wg-lb-counter {
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.wg-lb-tools {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.wg-lb-count-text {
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.88);
	text-align: right;
}

.wg-lb-progress {
	width: 180px;
	height: 2px;
	margin-top: 6px;
	background: rgba(255, 255, 255, 0.28);
}

.wg-lb-progress > span {
	display: block;
	height: 100%;
	width: 0;
	background: #fff;
}

.wg-lb-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.wg-lightbox a.wg-lb-btn {
	color: #fff;
	text-decoration: none;
}

.wg-lb-btn,
.wg-lb-arrow {
	border: 0;
	color: #fff;
	font-family: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.wg-lb-btn {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
}

.wg-lb-btn:hover,
.wg-lb-arrow:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.22);
}

.wg-lb-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 76px 0;
}

.wg-lb-frame {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: min(960px, 100%);
	max-height: 100%;
}

.wg-lb-photo {
	position: relative;
	line-height: 0;
	max-width: 100%;
	flex: 0 0 auto;
}

.wg-lb-mark-box {
	position: absolute;
	inset: 0;
	container-type: inline-size;
	pointer-events: none;
}

.wg-lb-img {
	display: block;
	max-width: min(960px, 100%);
	max-height: min(62vh, calc(100vh - 280px));
	width: auto;
	height: auto;
	object-fit: contain;
	background: #2a2a2a;
}

.wg-lb-mark {
	position: absolute;
	z-index: 1;
	width: var(--wg-wm-size, 15%);
	max-width: 70%;
	height: auto;
	opacity: var(--wg-wm-opacity, 0.5);
	pointer-events: none;
	object-fit: contain;
}

.wg-lb-mark[hidden] {
	display: none !important;
}

.wg-lb-photo[data-wm="top-left"] .wg-lb-mark { top: var(--wg-wm-gap, 20px); left: var(--wg-wm-gap, 20px); }
.wg-lb-photo[data-wm="top-center"] .wg-lb-mark { top: var(--wg-wm-gap, 20px); left: 50%; transform: translateX(-50%); }
.wg-lb-photo[data-wm="top-right"] .wg-lb-mark { top: var(--wg-wm-gap, 20px); right: var(--wg-wm-gap, 20px); }
.wg-lb-photo[data-wm="middle-left"] .wg-lb-mark { top: 50%; left: var(--wg-wm-gap, 20px); transform: translateY(-50%); }
.wg-lb-photo[data-wm="center"] .wg-lb-mark { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.wg-lb-photo[data-wm="middle-right"] .wg-lb-mark { top: 50%; right: var(--wg-wm-gap, 20px); transform: translateY(-50%); }
.wg-lb-photo[data-wm="bottom-left"] .wg-lb-mark { bottom: var(--wg-wm-gap, 20px); left: var(--wg-wm-gap, 20px); }
.wg-lb-photo[data-wm="bottom-center"] .wg-lb-mark { bottom: var(--wg-wm-gap, 20px); left: 50%; transform: translateX(-50%); }
.wg-lb-photo[data-wm="bottom-right"] .wg-lb-mark { right: var(--wg-wm-gap, 20px); bottom: var(--wg-wm-gap, 20px); }

.wg-lb-mark.is-text {
	width: auto;
	max-width: 80%;
	color: #fff;
	font-size: max(12px, calc(var(--wg-wm-pct, 15) * 1cqw / 6));
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
	white-space: nowrap;
}

.wg-lb-photo[data-wm="tile"] .wg-lb-mark.is-tile {
	inset: var(--wg-wm-gap, 20px);
	width: auto;
	max-width: none;
	height: auto;
}

.wg-lb-photo[data-wm="tile"] .wg-lb-mark.is-tile:not(.is-text) {
	background-repeat: repeat;
	background-position: left top;
	background-size: var(--wg-wm-size, 15%) auto;
}

.wg-lb-photo[data-wm="tile"] .wg-lb-mark.is-text {
	display: flex;
	flex-wrap: wrap;
	align-content: space-around;
	justify-content: space-evenly;
	gap: 10px;
	white-space: normal;
}

.wg-lb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #3a3a3a;
	z-index: 2;
}

.wg-lb-prev {
	left: 18px;
}

.wg-lb-next {
	right: 18px;
}

.wg-lb-arrow:disabled {
	opacity: 0.28;
	cursor: default;
}

.wg-lb-caption {
	flex: 0 0 auto;
	width: 100%;
	margin: 12px 0 0;
	padding: 0 8px;
	text-align: center;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: #f3f3f3;
}

.wg-lb-caption[hidden] {
	display: none !important;
}

.wg-lb-thumbs {
	display: flex;
	gap: 8px;
	justify-content: center;
	overflow-x: auto;
	padding: 8px 24px 18px;
}

.wg-lb-thumb {
	width: 64px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	flex: 0 0 auto;
	background: #2a2a2a;
	cursor: pointer;
}

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

.wg-lb-thumb.is-active {
	border-color: #fff;
}

.wg-lightbox button:focus-visible,
.wg-lightbox a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.wg-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	background: #111;
	color: #fff;
	padding: 10px 16px;
	border-radius: 999px;
	z-index: 100002;
	font-size: 0.875rem;
	font-family: inherit;
}

.wg-toast[hidden] {
	display: none;
}

@media (max-width: 1024px) {
	.wg-albums {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wg-photos {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.wg-hero {
		padding: 28px 0 24px;
	}

	.wg-hero-title {
		font-size: 2rem;
	}

	.wg-albums {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.wg-photos {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.wg-thumb {
		order: 1;
	}

	.wg-card-title {
		margin-top: 0;
	}

	.wg-card-meta {
		margin: 4px 0 10px;
	}

	.wg-toolbar,
	.wg-album-bar,
	.wg-actions {
		flex-wrap: wrap;
	}

	.wg-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.wg-toolbar-end {
		width: 100%;
		min-width: 0;
		margin-left: 0;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.wg-sort {
		flex: 1 1 100%;
		min-width: 0;
		justify-content: flex-start;
		gap: 8px;
	}

	.wg-sort select {
		flex: 1 1 auto;
		min-width: 0;
		max-width: 100%;
	}

	.wg-album-bar {
		align-items: flex-start;
		flex-direction: column;
	}

	.wg-lb-top {
		align-items: center;
		padding: 12px 14px 4px;
	}

	.wg-lb-title,
	.wg-lb-countdown,
	.wg-lb-thumbs,
	.wg-lb-arrow,
	#wg-lb-facebook,
	#wg-lb-line,
	#wg-lb-x,
	#wg-lb-copy,
	#wg-lb-full,
	#wg-lb-native {
		display: none !important;
	}

	.wg-lb-tools,
	.wg-lb-buttons {
		width: auto;
	}

	.wg-lb-counter {
		color: #fff;
		font-size: 0.9375rem;
	}

	.wg-lb-swipe {
		display: inline-block;
	}

	.wg-lb-stage {
		padding: 8px 16px 0;
	}

	.wg-lb-img {
		max-height: min(68vh, calc(100vh - 160px));
	}
}

/*
 * DGA header controls. Sizes use rem so ขนาดตัวอักษร (root font-size) scales
 * them. โหมดการแสดงผล paints every element with the page colors and clears
 * background images, so overlays that sit on photographs stay transparent
 * and the hero image is restored through .dga-display-media.
 */
html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) .wg-hero.has-image::before,
html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) .wg-lb-mark-box {
	background-color: transparent !important;
	background-image: none !important;
}

html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) .wg-hero.has-image :is(.wg-eyebrow, .wg-hero-title) {
	display: table;
	width: fit-content;
	max-width: 100%;
	margin-bottom: 6px;
	padding: 2px 8px;
	border-radius: 6px;
	background-color: var(--dgan-page-bg) !important;
	color: var(--dgan-page-fg) !important;
}

html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) :is(.wg-thumb, .wg-photo, .wg-lb-thumb, .wg-badge, .wg-icon-btn, .wg-slide-btn, .wg-more, .wg-sort select) {
	border: 1px solid var(--dgan-page-fg) !important;
}

html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) .wg-lb-thumb.is-active {
	border: 2px solid var(--dgan-page-focus) !important;
}

html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) .wg-pager .is-current {
	background-color: var(--dgan-page-fg) !important;
	color: var(--dgan-page-bg) !important;
	border-color: var(--dgan-page-fg) !important;
}

html[data-dgan-mode="dark"] .wg-sort select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.4' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
}

html[data-dgan-mode="light"] .wg-sort select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.4' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
}

html:is([data-dgan-mode="dark"], [data-dgan-mode="light"]) :is(.wg-app, .wg-lightbox, .wg-toast) svg {
	color: inherit;
}

@media (prefers-reduced-motion: reduce) {
	.wg-thumb img {
		transition: none;
	}
}
