/*
 * Superior Homes Gallery Tabs - frontend styles.
 * Every selector is scoped under .shk-gallery-tabs / .shk-gallery-tabs-modal
 * so this sheet can never leak into Elementor or the rest of the site.
 * Tab/card/modal structure and defensive rules are deliberately mirrored
 * from superior-homes-videos' frontend.css for visual and technical
 * consistency between the two tabbed components.
 */

.shk-gallery-tabs {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}
.shk-gallery-tabs *,
.shk-gallery-tabs *::before,
.shk-gallery-tabs *::after {
	box-sizing: border-box;
}
.shk-gallery-tabs .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
	border: 0;
	padding: 0;
	margin: -1px;
}

/* ---------- Tabs ---------- */
.shk-gallery-tabs__tabs-wrap {
	position: relative;
	margin: 0 0 28px;
	border-bottom: 1px solid rgba(31, 31, 31, 0.08);
}
.shk-gallery-tabs__tabs {
	display: flex;
	gap: 32px;
	overflow-x: auto;
	overflow-y: hidden;
	-ms-overflow-style: none;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 1px;
	scroll-behavior: smooth;
}
.shk-gallery-tabs__tabs::-webkit-scrollbar {
	display: none;
}

/* ---------- Tab-strip scroll arrows ---------- */
/* Hidden by default (see [hidden] rule below) and shown only by JS once it
 * confirms the strip actually overflows in that direction — a mouse/touch
 * user who can already see every tab never gets a dead-looking button, and
 * a no-JS visitor never gets a button that does nothing. Positioned as a
 * fading overlay rather than reserving fixed layout space so the arrows
 * work identically on mobile and desktop without a separate breakpoint. */
/* Doubled class — see the .shk-gallery-tabs__tab comment further up. These
 * are <button>s too, so without it the global Elementor Kit button rule
 * paints a solid accent-color background-color underneath the intended
 * fade gradient (the gradient's own transparent end then reveals it). */
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow {
	position: absolute;
	top: 0;
	bottom: 9px;
	z-index: 2;
	display: flex;
	align-items: center;
	width: 40px;
	appearance: none;
	border: 0;
	padding: 0 6px;
	color: var(--color-accent, #f28c28);
	cursor: pointer;
}
.shk-gallery-tabs__tabs-arrow[hidden] {
	display: none;
}
.shk-gallery-tabs__tabs-arrow--prev.shk-gallery-tabs__tabs-arrow--prev {
	left: -6px;
	justify-content: flex-start;
	background: linear-gradient(to right, var(--color-bg, #fff) 55%, transparent);
}
.shk-gallery-tabs__tabs-arrow--next.shk-gallery-tabs__tabs-arrow--next {
	right: -6px;
	justify-content: flex-end;
	background: linear-gradient(to left, var(--color-bg, #fff) 55%, transparent);
}
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow:hover,
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow:focus,
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow:focus-visible {
	background-color: transparent;
	color: var(--color-text, #1f1f1f);
}
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow:focus {
	outline: none;
}
.shk-gallery-tabs__tabs-arrow.shk-gallery-tabs__tabs-arrow:focus-visible {
	outline: 2px solid var(--color-accent, #f28c28);
	outline-offset: 2px;
	border-radius: var(--radius-sm, 4px);
}
/* Doubled class is deliberate, not a typo: sites commonly ship a global
 * Elementor Kit rule like ".elementor-kit-N button { background-color:
 * ...; border-radius: 20px; }" on <body>, which has higher specificity
 * (class+element, 0-1-1) than a plain ".shk-gallery-tabs__tab" (0-1-0) and
 * would otherwise paint every tab button as an orange pill regardless of
 * stylesheet load order. Doubling the class raises us to 0-2-0 so this
 * always wins without !important. */
.shk-gallery-tabs__tab.shk-gallery-tabs__tab {
	position: relative;
	flex: 0 0 auto;
	appearance: none;
	background-color: transparent;
	border: 0;
	margin: 0;
	padding: 0 0 12px;
	color: var(--color-text, #1f1f1f);
	font: var(--text-h3, 400 28px/32px var(--font-heading, "Oswald", sans-serif));
	font-family: var(--font-heading, "Oswald", sans-serif);
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s ease;
}
.shk-gallery-tabs__tab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background-color: transparent;
}
.shk-gallery-tabs__tab.shk-gallery-tabs__tab:hover,
.shk-gallery-tabs__tab.shk-gallery-tabs__tab:focus,
.shk-gallery-tabs__tab.shk-gallery-tabs__tab:focus-visible {
	background-color: transparent;
	color: var(--color-accent, #f28c28);
}
.shk-gallery-tabs__tab:hover::after,
.shk-gallery-tabs__tab:focus::after,
.shk-gallery-tabs__tab:focus-visible::after,
.shk-gallery-tabs__tab.is-active::after {
	background-color: var(--color-accent, #f28c28);
}
.shk-gallery-tabs__tab.shk-gallery-tabs__tab.is-active {
	background-color: transparent;
	color: var(--color-accent, #f28c28);
	font-weight: 400;
}
.shk-gallery-tabs__tab.shk-gallery-tabs__tab:focus {
	outline: none;
}
.shk-gallery-tabs__tab.shk-gallery-tabs__tab:focus-visible {
	outline: 2px solid var(--color-accent, #f28c28);
	outline-offset: 3px;
	border-radius: var(--radius-sm, 4px);
}

/* ---------- Grid ---------- */
.shk-gallery-tabs__grid {
	display: grid;
	grid-template-columns: repeat(var(--shk-gallery-tabs-columns-mobile, 1), minmax(0, 1fr));
	gap: 20px 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}
@media (min-width: 600px) {
	.shk-gallery-tabs__grid {
		grid-template-columns: repeat(var(--shk-gallery-tabs-columns-tablet, 2), minmax(0, 1fr));
	}
}
@media (min-width: 1024px) {
	.shk-gallery-tabs__grid {
		grid-template-columns: repeat(var(--shk-gallery-tabs-columns, 4), minmax(0, 1fr));
		gap: 28px 24px;
	}
}
.shk-gallery-tabs__item {
	margin: 0;
	list-style: none;
}
.shk-gallery-tabs__item[hidden] {
	display: none;
}

/* ---------- Card ---------- */
/* Doubled class here too — see the .shk-gallery-tabs__tab comment above.
 * This card is a <button>, equally exposed to a global Elementor Kit
 * "button { background-color: ...; border-radius: 20px; }" rule. */
.shk-gallery-card.shk-gallery-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	appearance: none;
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	text-align: left;
	color: inherit;
	font: inherit;
	white-space: normal;
	cursor: pointer;
}
.shk-gallery-card.shk-gallery-card:hover,
.shk-gallery-card.shk-gallery-card:focus,
.shk-gallery-card.shk-gallery-card:focus-visible {
	background-color: transparent;
}
.shk-gallery-card.shk-gallery-card:focus {
	outline: none;
}
.shk-gallery-card.shk-gallery-card:focus-visible {
	outline: 2px solid var(--color-accent, #f28c28);
	outline-offset: 4px;
	border-radius: var(--radius-sm, 4px);
}
.shk-gallery-card__media {
	position: relative;
	display: block;
	/* No fixed aspect-ratio here on purpose — client wants gallery photos
	 * shown at their own height, not force-cropped into a uniform box.
	 * (Cards in a row can end up different heights as a result; that's
	 * the intended trade-off.) overflow:hidden stays only to keep the
	 * border-radius corners clean, since there's nothing left to crop. */
	overflow: hidden;
	border-radius: var(--radius-sm, 4px);
	background: #e5e5e5;
}
/* Doubled class: same specificity fight as superior-homes-videos'
 * .shk-videos-card__image. Elementor's frontend.min.css ships ".elementor
 * img { height: auto; max-width: 100%; }" — one class + one element —
 * which outranks a plain ".shk-gallery-card__image" (one class). There
 * it was a bug to fix around; here height:auto is what we actually want
 * (full image, no crop), but it's pinned explicitly rather than left to
 * depend on winning that specificity fight by luck. */
.shk-gallery-card__image.shk-gallery-card__image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
	transition: transform 0.25s ease;
}
.shk-gallery-card:hover .shk-gallery-card__image {
	transform: scale(1.03);
}
.shk-gallery-card__zoom {
	position: absolute;
	inset: auto 10px 10px auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}
.shk-gallery-card:hover .shk-gallery-card__zoom,
.shk-gallery-card:focus-visible .shk-gallery-card__zoom {
	opacity: 1;
	transform: translateY(0);
}
.shk-gallery-card__title {
	display: block;
	margin-top: 12px;
	color: var(--color-text, #1f1f1f);
	font: var(--text-h5, 400 18px/22px var(--font-heading, "Oswald", sans-serif));
	font-family: var(--font-heading, "Oswald", sans-serif);
}

/* ---------- Empty state ---------- */
.shk-gallery-tabs-empty {
	padding: 16px 20px;
	border: 1px dashed rgba(31, 31, 31, 0.25);
	border-radius: var(--radius-sm, 4px);
	color: var(--color-muted, #777);
	font-family: var(--font-body, "Lato", sans-serif);
	font-size: 14px;
}

/* ---------- Modal ---------- */
html.shk-gallery-tabs-dialog-open {
	overflow: hidden;
}
.shk-gallery-tabs-modal {
	--shk-modal-radius: var(--radius-sm, 4px);
	--shk-modal-overlay: rgba(15, 15, 15, 0.9);
	--shk-modal-close-bg: rgba(0, 0, 0, 0.55);
	--shk-modal-close-border: rgba(255, 255, 255, 0.4);
	--shk-modal-close-color: var(--color-accent, #f28c28);
	box-sizing: border-box;
	/* Shrink-wraps to the image's own rendered size (see .shk-gallery-tabs-modal__frame
	 * img below) instead of a fixed width — a portrait photo no longer sits inside a
	 * wide landscape-shaped box with black bars down each side. */
	width: fit-content;
	max-width: 92vw;
	max-height: 90vh;
	padding: 0;
	border: 0;
	border-radius: var(--shk-modal-radius);
	background: #000;
	color: var(--color-white, #fff);
	overflow: visible;
}
.shk-gallery-tabs-modal::backdrop {
	background: var(--shk-modal-overlay, rgba(15, 15, 15, 0.9));
}
.shk-gallery-tabs-modal[open] {
	display: block;
}
.shk-gallery-tabs-modal__inner {
	position: relative;
}
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	appearance: none;
	background: var(--shk-modal-close-bg, rgba(0, 0, 0, 0.55));
	/* A plain dark circle was nearly invisible sitting on the modal's own
	 * black background (both landed at roughly the same near-black value).
	 * The border gives it a visible edge regardless of what's behind it —
	 * the black letterboxing this was mostly hiding against, or the image
	 * itself once the sizing fix above removes most of that black space. */
	border: 1px solid var(--shk-modal-close-border, rgba(255, 255, 255, 0.4));
	border-radius: 50%;
	color: var(--shk-modal-close-color, var(--color-accent, #f28c28));
	cursor: pointer;
}
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close:hover,
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close:focus,
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close:focus-visible {
	background-color: var(--shk-modal-close-bg, rgba(0, 0, 0, 0.55));
	color: var(--shk-modal-close-color, var(--color-accent, #f28c28));
	border-radius: 50%;
}
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close:focus {
	outline: none;
}
.shk-gallery-tabs-modal__close.shk-gallery-tabs-modal__close:focus-visible {
	outline: 2px solid var(--color-accent, #f28c28);
	outline-offset: 2px;
}
.shk-gallery-tabs-modal__frame {
	position: relative;
	max-width: 100%;
	max-height: 80vh;
	/* Keeps the frame from collapsing to a sliver while the full-size
	 * image is still loading (it has no intrinsic size until then) —
	 * settles back down to the image's own size once it paints. */
	min-width: 240px;
	min-height: 160px;
	background: #000;
	border-radius: var(--shk-modal-radius);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.shk-gallery-tabs-modal__frame img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
}
.shk-gallery-tabs-modal__caption {
	margin: 0;
	padding: 12px 16px;
	color: rgba(255, 255, 255, 0.85);
	font: var(--text-body, 300 15px/20px var(--font-body, "Lato", sans-serif));
	font-family: var(--font-body, "Lato", sans-serif);
	text-align: center;
}
.shk-gallery-tabs-modal__caption:empty {
	display: none;
}
