/**
 * WORDthy Builder design gallery.
 * Scoped under .wbg so nothing leaks into the rest of the theme.
 */

.wbg {
	--wbg-ink: #131a1e;
	--wbg-ink-2: #3a4850;
	--wbg-muted: #65777f;
	--wbg-line: #d2dce1;
	--wbg-surface: #fff;
	--wbg-surface-2: #eef2f4;
	--wbg-blue: #069;
	--wbg-blue-deep: #004e75;
	--wbg-blue-soft: #e2eff6;
	--wbg-yellow: #ffe81a;
	--wbg-cols: 4;

	color: var(--wbg-ink);
	font-size: 16px;
	line-height: 1.55;
}

.wbg *,
.wbg *::before,
.wbg *::after {
	box-sizing: border-box;
}

.wbg button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

.wbg :focus-visible {
	outline: 3px solid var(--wbg-blue);
	outline-offset: 2px;
	border-radius: 6px;
}

/* ---------- filter bar ---------- */

.wbg-bar {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 14px;
}

.wbg-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.wbg-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 15px;
	border-radius: 99px;
	border: 1.5px solid var(--wbg-line);
	background: var(--wbg-surface);
	font-size: 14px;
	font-weight: 600;
	color: var(--wbg-ink-2);
}

.wbg-chip:hover {
	border-color: var(--wbg-ink);
	color: var(--wbg-ink);
}

.wbg-chip[aria-pressed="true"] {
	background: var(--wbg-ink);
	border-color: var(--wbg-ink);
	color: #fff;
}

.wbg-n {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	opacity: .65;
}

.wbg-search {
	flex: 1;
	min-width: 180px;
	padding: 9px 15px;
	border: 1.5px solid var(--wbg-line);
	border-radius: 99px;
	background: var(--wbg-surface);
	color: var(--wbg-ink);
	font: inherit;
	font-size: 14px;
}

.wbg-search:focus {
	outline: none;
	border-color: var(--wbg-blue);
	box-shadow: 0 0 0 3px var(--wbg-blue-soft);
}

.wbg-count {
	font-family: ui-monospace, Menlo, monospace;
	font-size: 12px;
	color: var(--wbg-muted);
	margin: 0 0 18px;
}

/* ---------- grid ---------- */

.wbg-grid {
	display: grid;
	grid-template-columns: repeat(var(--wbg-cols), minmax(0, 1fr));
	gap: 18px;
}

@media (max-width: 1100px) {
	.wbg-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.wbg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 13px;
	}
}

@media (max-width: 400px) {
	.wbg-grid {
		grid-template-columns: 1fr;
	}
}

.wbg-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--wbg-line);
	border-radius: 14px;
	background: var(--wbg-surface);
	overflow: hidden;
	text-align: left;
	transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.wbg-tile:hover {
	transform: translateY(-3px);
	border-color: var(--wbg-blue);
	box-shadow: 0 2px 4px rgba(19, 26, 30, .06), 0 20px 40px -22px rgba(19, 26, 30, .4);
}

.wbg-art {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 20px;
	background: var(--wbg-surface-2);
}

.wbg-art img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.wbg-missing {
	font-size: 13px;
	color: var(--wbg-muted);
	text-align: center;
	padding: 10px;
}

.wbg-cap {
	display: block;
	padding: 12px 14px 14px;
	border-top: 1px solid var(--wbg-line);
}

/* Two lines reserved either way, so every tile's artwork sits on the same
   baseline however long the name is. */
.wbg-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 700;
	font-size: 14.5px;
	line-height: 1.3;
	letter-spacing: -.01em;
	min-height: 2.6em;
}

.wbg-meta {
	display: block;
	font-family: ui-monospace, Menlo, monospace;
	font-size: 11px;
	color: var(--wbg-muted);
	margin-top: 4px;
}

.wbg-badge {
	position: absolute;
	top: 11px;
	left: 11px;
	z-index: 2;
	font-family: ui-monospace, Menlo, monospace;
	font-size: 9.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 4px 8px;
	border-radius: 99px;
	background: var(--wbg-yellow);
	color: #131a1e;
}

.wbg-empty {
	text-align: center;
	color: var(--wbg-muted);
	padding: 48px 20px;
	font-size: 15px;
}

/* ---------- lightbox ---------- */

body.wbg-locked {
	overflow: hidden;
}

.wbg-lb {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(10, 15, 18, .86);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.wbg-lb[hidden] {
	display: none;
}

.wbg-lb-inner {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: 0;
	background: var(--wbg-surface);
	border-radius: 18px;
	overflow: hidden;
	max-width: 900px;
	width: 100%;
	max-height: calc(100vh - 48px);
}

@media (max-width: 720px) {
	.wbg-lb {
		padding: 12px;
	}

	.wbg-lb-inner {
		grid-template-columns: 1fr;
		max-height: calc(100vh - 24px);
		overflow-y: auto;
	}
}

.wbg-lb-art {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 36px;
	background: var(--wbg-surface-2);
	min-height: 260px;
}

.wbg-lb-art img {
	max-width: 100%;
	max-height: 56vh;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

@media (max-width: 720px) {
	.wbg-lb-art {
		padding: 24px;
		min-height: 0;
	}

	.wbg-lb-art img {
		max-height: 38vh;
	}
}

.wbg-lb-meta {
	padding: 30px 28px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow-y: auto;
}

.wbg-lb-num {
	font-family: ui-monospace, Menlo, monospace;
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--wbg-muted);
	margin: 0;
}

.wbg-lb-meta h3 {
	margin: 0;
	font-size: 24px;
	line-height: 1.12;
	letter-spacing: -.02em;
}

.wbg-lb-blurb {
	margin: 0;
	color: var(--wbg-ink-2);
	font-size: 15px;
}

.wbg-lb-note {
	margin: 0;
	font-size: 13px;
	color: var(--wbg-muted);
}

.wbg-lb-note:empty,
.wbg-lb-blurb:empty {
	display: none;
}

.wbg-cta {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wbg-blue);
	color: #fff;
	border-radius: 99px;
	padding: 14px 24px;
	font-weight: 700;
	font-size: 15px;
	text-decoration: none;
}

.wbg-cta:hover {
	background: var(--wbg-blue-deep);
	color: #fff;
}

.wbg-cta[hidden] {
	display: none;
}

.wbg-close {
	position: absolute;
	top: 16px;
	right: 18px;
	width: 42px;
	height: 42px;
	border-radius: 99px;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	display: grid;
	place-items: center;
	z-index: 3;
}

.wbg-close:hover {
	background: rgba(255, 255, 255, .26);
}

.wbg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 99px;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	display: grid;
	place-items: center;
	z-index: 3;
}

.wbg-arrow:hover {
	background: rgba(255, 255, 255, .26);
}

.wbg-arrow[hidden] {
	display: none;
}

.wbg-prev {
	left: 18px;
}

.wbg-next {
	right: 18px;
}

@media (max-width: 720px) {
	.wbg-arrow {
		top: auto;
		bottom: 18px;
		transform: none;
		width: 42px;
		height: 42px;
	}

	.wbg-prev {
		left: 20px;
	}

	.wbg-next {
		right: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wbg * {
		transition-duration: .01ms !important;
	}
}
