/**
 * Shik Filterable Gallery — Frontend Styles
 *
 * Responsive logo/image grid with pill-style filter buttons.
 * Animation classes (is-visible / is-hidden) work with optional fade / scale-fade.
 * RTL is handled naturally by CSS logical properties (margin-inline, etc.).
 */

/* ---------- Wrapper ---------- */
.shik-filterable-gallery {
	box-sizing: border-box;
	width: 100%;
	display: flex;
	flex-direction: column;
}

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

/* ---------- Filter Buttons ---------- */
.shik-gallery-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 0 24px;
	padding: 0;
}

.shik-filter-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	margin: 0;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: #4b5563;
	background-color: #f3f4f6;
	border: 1px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.shik-filter-button:hover {
	background-color: #e5e7eb;
	color: #111827;
}

.shik-filter-button:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.shik-filter-button.active {
	background-color: #2563eb;
	color: #ffffff;
	border-color: #2563eb;
}

.shik-filter-button.active:hover {
	background-color: #1d4ed8;
	color: #ffffff;
}

/* ---------- Grid ---------- */
/*
 * Default 4 columns. Per-device column counts (tablet / mobile) are applied by
 * Elementor's responsive control system using whatever breakpoints are
 * configured site-wide, so we don't hardcode media queries here.
 */
.shik-gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: 20px;
	row-gap: 20px;
	width: 100%;
	margin-inline: auto;
}

/* ---------- Items ---------- */
.shik-gallery-item {
	min-width: 0;
	width: 100%;
	/* Explicit default — defends against animation fill-mode edge cases
	   where an interrupted animation could leave the item at opacity 0. */
	opacity: 1;
}

.shik-gallery-item-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	/*padding: 12px;*/
	background-color: #ffffff;
	border-radius: 8px;
	overflow: hidden;
}

/* Equal height boxes — gives every box the same min-height regardless of image. */
.shik-equal-height .shik-gallery-item-inner {
	min-height: 140px;
}

.shik-gallery-item img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

/*
 * Object-Fit: Cover mode.
 *
 * `object-fit` only operates when the <img> element has an explicit size to fit
 * its content inside. With width:auto/height:auto (the default — good for logos),
 * the <img> renders at its natural pixel size and `object-fit: cover` has no box
 * to crop into, so it appears identical to "contain". When the user selects Cover
 * we therefore stretch the img to fill the entire box (100% x 100%) so the
 * object-fit: cover declaration set by the control finally has dimensions to work
 * with — cropping and centering the image as expected.
 */
.shik-fit-cover .shik-gallery-item img {
	width: 100%;
	height: 100%;
}

/* Link wrapper inside item */
.shik-gallery-item a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 0;
	text-decoration: none;
}

/* ---------- Visibility / Filter States ---------- */
.shik-gallery-item.is-hidden {
	display: none !important;
}

.shik-gallery-item.is-visible {
	display: block;
}

/* ---------- Animations ---------- */
/*
 * Note: `animation-fill-mode` is intentionally NOT set to `both` (or `backwards`).
 * If we used `backwards`, an interrupted/never-started animation would leave the
 * element at opacity 0 — i.e. visually hidden — which matches the symptom of
 * "HTML present in DOM but nothing visible". Without fill-mode, the element
 * uses its declared default (opacity: 1) whenever the animation isn't actively
 * running, so the gallery is robust against any animation timing issue.
 */

/* "fade" — softly fade items in when they become visible. */
.shik-anim-fade .shik-gallery-item.is-visible {
	animation: shik-fade-in var(--shik-duration, 180ms) ease;
}

@keyframes shik-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* "scale-fade" — fade + slight scale up */
.shik-anim-scale-fade .shik-gallery-item.is-visible {
	animation: shik-scale-fade-in var(--shik-duration, 180ms) ease;
}

@keyframes shik-scale-fade-in {
	from { opacity: 0; transform: scale(0.96); }
	to   { opacity: 1; transform: scale(1); }
}

/* "none" — no animation, just show/hide */
.shik-anim-none .shik-gallery-item.is-visible {
	animation: none;
}

/* ---------- Editor Placeholder ---------- */
.shik-empty-notice {
	padding: 20px;
	text-align: center;
	color: #6b7280;
	background-color: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 6px;
}

/* ---------- RTL niceties ---------- */
/* Logical properties above handle most things; this is just a safety net. */
[dir="rtl"] .shik-gallery-filters {
	direction: rtl;
}

@media (min-width: 767px){ 
	.beforesanen{
		margin-left:2em!important;
	}
	.shik-filter-button[data-filter="floor0"]{
		margin-right:6em!important;
	}
	.shik-gallery-grid{
		margin-top:2em!important;
	}
}