/**
 * Edwin Gallery widget — isolated styles.
 */

.edwin-gallery {
	background-color: var(--edwin-white);
	color: var(--edwin-charcoal) !important;
	padding: var(--edwin-space-8) var(--edwin-space-4);
}

.edwin-gallery__header {
	max-width: 640px;
	margin: 0 auto var(--edwin-space-3);
	text-align: center;
}

.edwin-gallery__eyebrow {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--edwin-orange) !important;
	margin-bottom: var(--edwin-space-1);
}

.edwin-gallery__title {
	font-size: clamp(28px, 3.4vw, 40px);
	font-weight: 800;
	line-height: 1.2;
	color: var(--edwin-charcoal) !important;
	margin-bottom: var(--edwin-space-2) !important;
}

.edwin-gallery__subtitle {
	font-size: 16px;
	line-height: 1.7;
	color: var(--edwin-gray) !important;
}

/* ---------------------------------------------------------------------
 * Filter tabs
 * ------------------------------------------------------------------ */
.edwin-gallery__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: var(--edwin-space-4);
}

.edwin-gallery__filter {
	font-size: 14px;
	font-weight: 700;
	color: var(--edwin-gray) !important;
	background: var(--edwin-white) !important;
	border: 1px solid var(--edwin-border);
	border-radius: 999px;
	padding: 10px 20px;
	cursor: pointer;
	transition: var(--edwin-transition);
}

.edwin-gallery__filter:hover {
	border-color: var(--edwin-orange);
	color: var(--edwin-orange) !important;
}

.edwin-gallery__filter.is-active {
	background: var(--edwin-orange) !important;
	border-color: var(--edwin-orange) !important;
	color: var(--edwin-white) !important;
}

/* ---------------------------------------------------------------------
 * Grid + item
 * ------------------------------------------------------------------ */
.edwin-gallery__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--edwin-space-2);
	max-width: 1280px;
	margin: 0 auto;
}

.edwin-gallery__item {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	border-radius: var(--edwin-radius-md);
	background: var(--edwin-gray-light);
	padding: 0;
	text-align: left;
}

.edwin-gallery__item.is-hidden {
	display: none;
}

.edwin-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

/* Aspect ratios */
.edwin-gallery--ratio-square .edwin-gallery__item {
	aspect-ratio: 1 / 1;
}

.edwin-gallery--ratio-landscape .edwin-gallery__item {
	aspect-ratio: 4 / 3;
}

.edwin-gallery--ratio-portrait .edwin-gallery__item {
	aspect-ratio: 3 / 4;
}

.edwin-gallery--ratio-auto .edwin-gallery__item {
	aspect-ratio: auto;
}

.edwin-gallery__item:hover .edwin-gallery__img {
	transform: scale(1.08);
}

.edwin-gallery__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: rgba(26, 26, 26, 0.65) !important;
	opacity: 0;
	transition: var(--edwin-transition);
	pointer-events: none;
	padding: var(--edwin-space-2);
	text-align: center;
}

.edwin-gallery__item:hover .edwin-gallery__overlay,
.edwin-gallery__item:focus-visible .edwin-gallery__overlay {
	opacity: 1;
}

.edwin-gallery__overlay i {
	color: var(--edwin-white) !important;
	font-size: 22px !important;
	width: auto !important;
	height: auto !important;
}

.edwin-gallery__caption {
	color: var(--edwin-white) !important;
	font-size: 13px;
	font-weight: 600;
}

button.edwin-gallery__item {
	cursor: zoom-in;
	border: none;
}

/* ---------------------------------------------------------------------
 * Lightbox
 * ------------------------------------------------------------------ */
.edwin-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 10, 0.95) !important;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
	padding: var(--edwin-space-4);
}

.edwin-gallery__lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.edwin-gallery__lightbox-figure {
	max-width: min(1100px, 92vw);
	max-height: 88vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.edwin-gallery__lightbox-img {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: var(--edwin-radius-sm);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.edwin-gallery__lightbox-caption {
	color: var(--edwin-white) !important;
	font-size: 14px;
	text-align: center;
}

.edwin-gallery__lightbox-caption:empty {
	display: none;
}

.edwin-gallery__lightbox-close,
.edwin-gallery__lightbox-prev,
.edwin-gallery__lightbox-next {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--edwin-white) !important;
	background: rgba(255, 255, 255, 0.1) !important;
	border-radius: 50%;
	transition: var(--edwin-transition);
}

.edwin-gallery__lightbox-close:hover,
.edwin-gallery__lightbox-prev:hover,
.edwin-gallery__lightbox-next:hover {
	background: var(--edwin-orange) !important;
}

.edwin-gallery__lightbox-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
}

.edwin-gallery__lightbox-close i {
	font-size: 18px !important;
	width: auto !important;
	height: auto !important;
}

.edwin-gallery__lightbox-prev,
.edwin-gallery__lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
}

.edwin-gallery__lightbox-prev {
	left: 20px;
}

.edwin-gallery__lightbox-next {
	right: 20px;
}

.edwin-gallery__lightbox-prev i,
.edwin-gallery__lightbox-next i {
	font-size: 18px !important;
	width: auto !important;
	height: auto !important;
}

/* ---------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.edwin-gallery__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	.edwin-gallery {
		padding: var(--edwin-space-6) var(--edwin-space-2);
	}

	.edwin-gallery__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.edwin-gallery__lightbox-prev,
	.edwin-gallery__lightbox-next {
		width: 40px;
		height: 40px;
	}

	.edwin-gallery__lightbox-prev {
		left: 8px;
	}

	.edwin-gallery__lightbox-next {
		right: 8px;
	}

	.edwin-gallery__lightbox-close {
		top: 10px;
		right: 10px;
	}
}
