/**
 * Featured Gallery Slider — frontend styles (rebuilt)
 *
 * Serene, sunlit aesthetic: a soft cream frame holds one large featured
 * image above a strip of rounded thumbnails. The featured image is made of
 * two stacked layers that crossfade, so switching never shows a blank frame.
 */

.featured-gallery {
	--fg-cream: #f6ecdf;
	--fg-cream-2: #fbf5ec;
	--fg-ink: #6b5d4f;
	--fg-ring: rgba(196, 158, 112, 0.55);
	--fg-shadow: rgba(120, 96, 66, 0.18);
	--fg-radius-frame: 28px;
	--fg-radius-img: 18px;
	--fg-radius-thumb: 14px;
	--fg-gap: clamp(10px, 1.4vw, 16px);
	--fg-fade: 0.5s;
	--fg-cols: 5;

	box-sizing: border-box;
	width: 100%;
	max-width: 1120px;
	margin-inline: auto;
	font-family: inherit;
}

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

/* Cream frame */
.featured-gallery__frame {
	background: linear-gradient(160deg, var(--fg-cream-2) 0%, var(--fg-cream) 100%);
	border-radius: var(--fg-radius-frame);
	padding: clamp(14px, 2vw, 22px);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 45px -22px var(--fg-shadow);
}

/* ---- Featured (single image, instant cached swap) ----------------------- */
.featured-gallery__stage {
	position: relative;
	cursor: pointer;
}

.featured-gallery__viewport {
	position: relative;
	overflow: hidden;
	border-radius: var(--fg-radius-img);
	aspect-ratio: 16 / 8.4;
	background: var(--fg-cream);
}

.featured-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Full-screen affordance */
.featured-gallery__zoom {
	position: absolute;
	inset-block-end: 14px;
	inset-inline-end: 14px;
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--fg-ink);
	background: rgba(251, 245, 236, 0.82);
	backdrop-filter: blur(6px);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
	z-index: 2;
}

.featured-gallery__stage:hover .featured-gallery__zoom,
.featured-gallery__zoom:focus-visible { opacity: 1; transform: translateY(0); }
.featured-gallery__zoom:hover { background: #fff; }

/* ---- Thumbnail carousel (single line, horizontal scroll) ---------------- */
.featured-gallery__strip {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: var(--fg-gap) 0 0;
}

.featured-gallery__thumbs {
	position: relative;
	display: flex;
	gap: var(--fg-gap);
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.featured-gallery__thumbs::-webkit-scrollbar { display: none; }

.featured-gallery__thumb-item {
	flex: 0 0 calc((100% - (var(--fg-cols) - 1) * var(--fg-gap)) / var(--fg-cols));
	margin: 0;
	scroll-snap-align: start;
}

/* Carousel arrows */
.featured-gallery__tnav {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--fg-ink);
	background: var(--fg-cream-2);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 6px 16px -10px var(--fg-shadow);
	transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.featured-gallery__tnav svg { width: 16px; height: 16px; }
.featured-gallery__tnav:hover { background: #fff; transform: scale(1.06); }
.featured-gallery__tnav[hidden] { display: none; }
.featured-gallery__tnav.is-disabled { opacity: 0.3; pointer-events: none; }

.featured-gallery__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: var(--fg-radius-thumb);
	overflow: hidden;
	position: relative;
	aspect-ratio: 16 / 11;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease, filter 0.3s ease;
}

.featured-gallery__thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 2px transparent;
	transition: box-shadow 0.3s ease;
	pointer-events: none;
}

.featured-gallery__thumb:hover { transform: translateY(-3px); }
.featured-gallery__thumb:hover img { transform: scale(1.06); }
.featured-gallery__thumb.is-active { box-shadow: 0 8px 20px -10px var(--fg-shadow); }
.featured-gallery__thumb.is-active::after { box-shadow: inset 0 0 0 2px var(--fg-ring); }

/* ---- Grid layout -------------------------------------------------------- */
.featured-gallery__grid {
	display: grid;
	grid-template-columns: repeat(var(--fg-cols), 1fr);
	gap: var(--fg-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}
.featured-gallery__grid-item { margin: 0; }

.featured-gallery__grid-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: var(--fg-radius-thumb);
	overflow: hidden;
	aspect-ratio: 4 / 3;
	transition: transform 0.3s ease;
}
.featured-gallery__grid-btn img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.featured-gallery__grid-btn:hover { transform: translateY(-3px); }
.featured-gallery__grid-btn:hover img { transform: scale(1.05); }

/* ---- Lightbox ----------------------------------------------------------- */
.featured-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(46, 38, 30, 0.82);
	backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.featured-lightbox.is-open { opacity: 1; visibility: visible; }

.featured-lightbox__img {
	max-width: min(1200px, 94vw);
	max-height: 88vh;
	border-radius: 14px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
	transform: scale(0.96);
	transition: transform 0.3s ease;
	object-fit: contain;
}
.featured-lightbox.is-open .featured-lightbox__img { transform: scale(1); }

.featured-lightbox__close,
.featured-lightbox__nav {
	position: absolute;
	display: inline-grid;
	place-items: center;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}
.featured-lightbox__close { top: clamp(14px, 3vw, 26px); right: clamp(14px, 3vw, 26px); width: 44px; height: 44px; font-size: 22px; line-height: 1; }
.featured-lightbox__nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 24px; }
.featured-lightbox__nav--prev { left: clamp(10px, 2vw, 28px); }
.featured-lightbox__nav--next { right: clamp(10px, 2vw, 28px); }
.featured-lightbox__close:hover, .featured-lightbox__nav:hover { background: rgba(255, 255, 255, 0.24); }
.featured-lightbox__nav:hover { transform: translateY(-50%) scale(1.06); }

/* ---- Editor notice ------------------------------------------------------ */
.featured-gallery__notice { padding: 14px 18px; border-radius: 10px; background: #fbf5ec; color: #8a7a66; font-size: 14px; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) { .featured-gallery__viewport { aspect-ratio: 16 / 10; } }
@media (max-width: 680px) {
	.featured-gallery__grid { grid-template-columns: repeat(3, 1fr); }
	.featured-gallery__thumb-item { flex-basis: calc((100% - 2 * var(--fg-gap)) / 3); }
	.featured-gallery__viewport { aspect-ratio: 4 / 3; }
}
@media (max-width: 420px) {
	.featured-gallery__grid { grid-template-columns: repeat(2, 1fr); }
	.featured-gallery__thumb-item { flex-basis: calc((100% - 1 * var(--fg-gap)) / 2); }
}

/* ---- Reduced motion: keep it working, drop the animation ---------------- */
@media (prefers-reduced-motion: reduce) {
	.featured-gallery *, .featured-lightbox * { transition-duration: 0.001ms !important; }
	.featured-gallery__thumb:hover { transform: none; }
	.featured-gallery__thumb:hover img { transform: none; }
}

/* --------------------------------------------------------------------------
   Elementor / theme button compatibility
   Force our own button look with !important so Elementor's global "Buttons"
   styles (and theme button rules) can't bleed into the gallery.
   -------------------------------------------------------------------------- */
.featured-gallery button,
.featured-lightbox button {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	font: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	text-decoration: none !important;
	outline: none !important;
}

.featured-gallery__thumb,
.featured-gallery__grid-btn {
	display: block !important;
	width: 100% !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	color: inherit !important;
	cursor: pointer !important;
	border-radius: var(--fg-radius-thumb) !important;
	box-shadow: none !important;
	transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.featured-gallery__thumb.is-active { box-shadow: 0 8px 20px -10px var(--fg-shadow) !important; }
.featured-gallery__thumb:focus-visible,
.featured-gallery__grid-btn:focus-visible { box-shadow: 0 0 0 3px var(--fg-ring) !important; }

.featured-gallery__zoom {
	width: 38px !important;
	height: 38px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	color: var(--fg-ink) !important;
	background: rgba(251, 245, 236, 0.82) !important;
	cursor: pointer !important;
	box-shadow: none !important;
	transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease !important;
}
.featured-gallery__zoom:hover { background: #fff !important; }

.featured-gallery__tnav {
	width: 34px !important;
	height: 34px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	color: var(--fg-ink) !important;
	background: var(--fg-cream-2) !important;
	cursor: pointer !important;
	box-shadow: 0 6px 16px -10px var(--fg-shadow) !important;
}
.featured-gallery__tnav:hover { background: #fff !important; }

.featured-lightbox__close,
.featured-lightbox__nav {
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	color: #fff !important;
	background: rgba(255, 255, 255, 0.12) !important;
	cursor: pointer !important;
	box-shadow: none !important;
}
.featured-lightbox__close { width: 44px !important; height: 44px !important; }
.featured-lightbox__nav { width: 48px !important; height: 48px !important; }
.featured-lightbox__close:hover,
.featured-lightbox__nav:hover { background: rgba(255, 255, 255, 0.24) !important; }
