/* ===============================================================
   DW Design Gallery — frontend
   Swiper grid (peek layout) + filters + lightbox.
   All selectors are namespaced (.dwdg) so this never collides with
   other Swiper instances on the same page.
=============================================================== */

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

.dwdg {
	--dwc-dark:     #1a1a1a;
	--dwc-olive:    #7E8460;
	--dwc-muted:    #756050;
	--dwc-offwhite: #F7F7F3;
	--dwc-white:    #FFFFFF;
	--dwc-sans:     'Poppins', system-ui, -apple-system, sans-serif;
	--dwc-serif:    'Libre Baskerville', Georgia, serif;

	position: relative;
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	background-color: var(--dwc-white);
	padding: 110px 24px;
	font-family: var(--dwc-sans);
	color: var(--dwc-dark);
}

/* ---- Header ---- */
.dwdg-header-wrap { max-width: 1300px; margin: 0 auto 40px; }
.dwdg-header { text-align: center; max-width: 760px; margin: 0 auto; }
.dwdg-eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--dwc-olive);
	margin-bottom: 20px;
}
.dwdg-rule {
	display: block;
	width: 44px;
	height: 1px;
	background-color: rgba(126, 132, 96, 0.45);
	margin: 0 auto 26px;
}
.dwdg-title {
	font-family: var(--dwc-serif);
	font-size: clamp(28px, 3.4vw, 46px);
	font-weight: 400;
	line-height: 1.16;
	letter-spacing: 0.005em;
	color: var(--dwc-dark);
	margin: 0;
}

/* ---- Filters ---- */
.dwdg-filters-wrap {
	max-width: 1300px;
	margin: 0 auto 50px;
	display: flex;
	justify-content: center;
}
.dwdg-filters {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.dwdg-filter {
	background: transparent !important;
	border: 1px solid rgba(126, 132, 96, 0.4) !important;
	color: var(--dwc-olive) !important;
	font-family: var(--dwc-sans) !important;
	font-size: 10.5px !important;
	font-weight: 500 !important;
	letter-spacing: 0.22em !important;
	text-transform: uppercase !important;
	padding: 10px 20px !important;
	border-radius: 50px !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.dwdg-filter:hover {
	background-color: rgba(126, 132, 96, 0.08) !important;
	border-color: rgba(126, 132, 96, 0.55) !important;
}
.dwdg-filter.is-active {
	background-color: var(--dwc-olive) !important;
	border-color: var(--dwc-olive) !important;
	color: var(--dwc-white) !important;
}

/* ---- Swiper ---- */
.dwdg-swiper-wrap {
	position: relative;
	max-width: 1300px;
	margin: 0 auto;
}
.dwdg-swiper {
	overflow: hidden !important;
	padding-bottom: 4px;
}
.dwdg-swiper .swiper-wrapper { align-items: stretch; }
.dwdg-swiper .swiper-slide { height: auto; display: flex; }

/* ---- Item ---- */
.dwdg-item {
	position: relative;
	width: 100%;
	background: var(--dwc-offwhite) !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	cursor: pointer;
	overflow: hidden;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition: transform 0.4s ease;
}

.dwdg-item-img { position: absolute; inset: 0; overflow: hidden; }
.dwdg-item-img img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
	opacity: 0;
	transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}
.dwdg-item-img img.is-loaded { opacity: 1; }
.dwdg-item:hover .dwdg-item-img img { transform: scale(1.06); }

/* Skeleton shimmer until the image decodes */
.dwdg-skeleton {
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg,
		rgba(0,0,0,0.04) 30%,
		rgba(0,0,0,0.08) 50%,
		rgba(0,0,0,0.04) 70%);
	background-size: 200% 100%;
	animation: dwdg-shimmer 1.4s ease-in-out infinite;
	transition: opacity 0.4s ease;
}
.dwdg-item.is-loaded .dwdg-skeleton { opacity: 0; }
@keyframes dwdg-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Meta overlay (tag + title) */
.dwdg-item-meta {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	padding: 22px;
	background: linear-gradient(to top,
		rgba(26, 26, 26, 0.78) 0%,
		rgba(26, 26, 26, 0.25) 50%,
		rgba(26, 26, 26, 0) 100%);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.45s ease, transform 0.45s ease;
	text-align: left;
	pointer-events: none;
}
.dwdg-item:hover .dwdg-item-meta,
.dwdg-item:focus-visible .dwdg-item-meta { opacity: 1; transform: translateY(0); }
.dwdg-item-tag {
	display: inline-block;
	font-family: var(--dwc-sans);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: #E9E0CF;
	margin-bottom: 8px;
}
.dwdg-item-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	font-family: var(--dwc-serif);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.25;
	color: #fff;
	letter-spacing: 0.005em;
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* Zoom badge */
.dwdg-item::after {
	content: '';
	position: absolute;
	top: 18px;
	right: 18px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 16px 16px;
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}
.dwdg-item:hover::after,
.dwdg-item:focus-visible::after { opacity: 1; transform: scale(1); }

/* Empty state */
.dwdg-empty {
	text-align: center;
	padding: 60px 20px;
	font-family: var(--dwc-serif);
	font-style: italic;
	color: var(--dwc-muted);
}
.dwdg-empty[hidden] { display: none; }

/* ---- Controls (arrows + dots) — styled to match the site's other swiper ---- */
.dwdg-controls {
	margin: 50px auto 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 32px;
}
.dwdg-controls.is-hidden { display: none; }
.dwdg-arrow {
	background: transparent !important;
	border: 0 !important;
	padding: 10px !important;
	color: var(--dwc-dark) !important;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}
.dwdg-arrow svg { width: 22px; height: 22px; }
.dwdg-arrow:hover { color: var(--dwc-olive) !important; }
.dwdg-prev:hover { transform: translateX(-3px); }
.dwdg-next:hover { transform: translateX(3px); }
.dwdg-arrow.swiper-button-disabled { opacity: 0.25; pointer-events: none; }

/* Custom windowed pagination — at most 5 dots, always centered. */
.dwdg-pagination {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 10px;
}
.dwdg-dot {
	width: 10px;
	height: 10px;
	flex: 0 0 auto;
	padding: 0 !important;
	border: 0 !important;
	background-color: rgba(26, 26, 26, 0.18) !important;
	border-radius: 5px !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.35s ease, width 0.4s ease, transform 0.35s ease, opacity 0.35s ease;
}
.dwdg-dot:hover { background-color: rgba(26, 26, 26, 0.4) !important; }
.dwdg-dot.is-active {
	background-color: var(--dwc-olive) !important;
	width: 28px;
}
/* Edge dots hint that there are more slides beyond the window. */
.dwdg-dot.is-edge { transform: scale(0.62); opacity: 0.55; }
.dwdg-dot.is-edge.is-active { transform: none; opacity: 1; }

/* ===== Lightbox ===== */
.dwdg-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	visibility: hidden;
	font-family: var(--dwc-sans);
}
.dwdg-lb.is-open { pointer-events: auto; visibility: visible; }

.dwdg-lb-backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(26, 26, 26, 0.94);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.35s ease;
}
.dwdg-lb.is-open .dwdg-lb-backdrop { opacity: 1; }

.dwdg-lb-stage {
	position: relative;
	z-index: 2;
	max-width: 92vw;
	max-height: 84vh;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.92);
	transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
				transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.dwdg-lb.is-open .dwdg-lb-stage { opacity: 1; transform: scale(1); }
.dwdg-lb.is-navigating .dwdg-lb-stage { opacity: 0; transform: scale(0.96); }

.dwdg-lb-img {
	max-width: 92vw !important;
	max-height: 84vh !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	display: block !important;
	border-radius: 4px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.dwdg-lb-spinner {
	position: absolute;
	width: 40px;
	height: 40px;
	border: 2px solid rgba(255,255,255,0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: dwdg-spin 0.8s linear infinite;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}
.dwdg-lb.is-navigating .dwdg-lb-spinner { opacity: 1; }
@keyframes dwdg-spin { to { transform: rotate(360deg); } }

.dwdg-lb-counter {
	position: fixed;
	top: 32px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 3;
	font-family: var(--dwc-serif);
	font-size: 14px;
	color: #fff;
	letter-spacing: 0.08em;
	opacity: 0;
	transition: opacity 0.35s ease 0.2s;
}
.dwdg-lb.is-open .dwdg-lb-counter { opacity: 1; }
.dwdg-lb-counter-sep { margin: 0 10px; opacity: 0.45; }
.dwdg-lb-counter-total { opacity: 0.55; }

.dwdg-lb-close {
	position: fixed;
	top: 26px;
	right: 28px;
	z-index: 3;
	width: 52px !important;
	height: 52px !important;
	background: transparent !important;
	border: 0 !important;
	padding: 0 !important;
	cursor: pointer;
	box-shadow: none !important;
	color: #fff !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.35s ease 0.2s;
}
.dwdg-lb.is-open .dwdg-lb-close { opacity: 1; }
.dwdg-lb-close-circle {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 50%;
	transition: border-color 0.4s ease, background-color 0.4s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dwdg-lb-close-icon {
	position: relative;
	z-index: 1;
	width: 18px;
	height: 18px;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s ease;
}
.dwdg-lb-close:hover .dwdg-lb-close-circle { background-color: #fff; border-color: #fff; transform: scale(1.08); }
.dwdg-lb-close:hover .dwdg-lb-close-icon { transform: rotate(90deg); color: #1a1a1a !important; }
.dwdg-lb-close:hover .dwdg-lb-close-icon line,
.dwdg-lb-close:hover .dwdg-lb-close-icon path { stroke: #1a1a1a !important; }

.dwdg-lb-nav {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 48px !important;
	height: 48px !important;
	border-radius: 50% !important;
	background: transparent !important;
	border: 1px solid rgba(255, 255, 255, 0.32) !important;
	color: #fff !important;
	cursor: pointer;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	box-shadow: none !important;
	opacity: 0;
	transition: opacity 0.35s ease 0.2s, background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}
.dwdg-lb.is-open .dwdg-lb-nav { opacity: 1; }
.dwdg-lb-nav:hover { background-color: #fff !important; border-color: #fff !important; color: var(--dwc-dark) !important; }
.dwdg-lb-nav svg { width: 16px; height: 16px; }
.dwdg-lb-prev { left: 30px; }
.dwdg-lb-next { right: 30px; }
.dwdg-lb-nav.is-hidden { display: none; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	.dwdg { padding: 90px 20px; }
}
@media (max-width: 700px) {
	.dwdg { padding: 70px 16px; }
	.dwdg-item-meta { padding: 16px; }
	.dwdg-item-tag { font-size: 9px; letter-spacing: 0.26em; margin-bottom: 6px; }
	.dwdg-item-title { font-size: 13px; line-height: 1.22; }
	.dwdg-item::after { top: 12px; right: 12px; width: 30px; height: 30px; background-size: 13px 13px; }
	/* On mobile the controls bar is hidden; users swipe/scroll horizontally. */
	.dwdg-controls { display: none; }
	.dwdg-lb-nav { width: 42px !important; height: 42px !important; }
	.dwdg-lb-prev { left: 14px; }
	.dwdg-lb-next { right: 14px; }
	.dwdg-lb-close { top: 18px; right: 18px; width: 44px !important; height: 44px !important; }
	.dwdg-lb-counter { top: 24px; font-size: 12.5px; }
}
@media (max-width: 480px) {
	.dwdg-filter { padding: 9px 16px !important; font-size: 10px !important; }
	.dwdg-item-title { font-size: 12px; }
	.dwdg-item-tag { font-size: 8.5px; }
}
