/**
 * Lookmedia Grouped Gallery — base styles.
 * Colors/spacing that are editable via Elementor controls are intentionally
 * left without hardcoded values here (or overridable) — this file only
 * covers structural layout that Elementor's inline selectors build on top of.
 */

.lmg-wrapper {
	width: 100%;
}

/* ---------------- Jenjang bar ---------------- */
.lmg-jenjang-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}

.lmg-jenjang-pill {
	appearance: none;
	border: none;
	cursor: pointer;
	padding: 10px 22px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	background: #EAF4EA;
	color: inherit;
	border-radius: 30px;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.lmg-jenjang-pill:hover {
	transform: translateY(-1px);
}

.lmg-jenjang-pill.is-active {
	background: #E8823C;
	color: #fff;
}

/* Remove the default browser focus outline (click/keyboard) on pills —
   replaced with a subtle box-shadow so keyboard users still get a visible
   focus indicator without the harsh default outline ring. */
.lmg-jenjang-pill,
.lmg-category-pill {
	outline: none;
}

.lmg-jenjang-pill:focus-visible,
.lmg-category-pill:focus-visible {
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

/* ---------------- Group panel ---------------- */
.lmg-group {
	width: 100%;
}

.lmg-group[hidden] {
	display: none;
}

.lmg-group-title {
	text-align: center;
	margin: 0 0 16px;
}

/* ---------------- Category filter bar ---------------- */
.lmg-category-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 20px;
}

.lmg-category-pill {
	appearance: none;
	border: none;
	cursor: pointer;
	padding: 8px 18px;
	font-size: 14px;
	font-weight: 500;
	background: #F1F1F1;
	color: #555;
	border-radius: 30px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lmg-category-pill.is-active {
	background: #D9713C;
	color: #fff;
}

/* =========================================================
 * Grid mode — fixed height cells, image cropped to fill
 * (object-fit: cover), columns via flexbox.
 * ========================================================= */
.lmg-grid--grid {
	--lmg-columns: 3;
	--lmg-gap: 10px;

	display: flex;
	flex-wrap: wrap;
	margin: calc(var(--lmg-gap) / -2);
}

.lmg-grid--grid .lmg-item {
	box-sizing: border-box;
	padding: calc(var(--lmg-gap) / 2);
	flex: 0 0 calc(100% / var(--lmg-columns));
	max-width: calc(100% / var(--lmg-columns));
}

.lmg-grid--grid .lmg-item__thumb {
	position: relative;
	width: 100%;
	height: 280px; /* overridden inline by the Image Height control */
	overflow: hidden;
	border-radius: 6px;
	background: #f2f2f2;
}

.lmg-grid--grid .lmg-item__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover; /* fills the box completely, no leftover grey space */
}

/* =========================================================
 * Masonry mode — CSS multi-column layout (no JS library
 * needed to compute positions). Images render at their
 * natural aspect ratio, so a tall/portrait photo shows in
 * full instead of being cropped to a fixed box.
 * ========================================================= */
.lmg-grid--masonry {
	--lmg-columns: 3;
	--lmg-gap: 10px;

	column-count: var(--lmg-columns);
	column-gap: var(--lmg-gap);
}

.lmg-grid--masonry .lmg-item {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	margin-bottom: var(--lmg-gap);
	display: inline-block;
	width: 100%;
}

.lmg-grid--masonry .lmg-item__thumb {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 6px;
	background: #f2f2f2;
}

.lmg-grid--masonry .lmg-item__img {
	display: block;
	width: 100%;
	height: auto; /* natural ratio — nothing cropped */
}

/* ---------------- Shared item behavior ---------------- */
.lmg-item {
	transition: opacity 0.2s ease;
}

.lmg-item--hidden {
	display: none;
}

.lmg-item__link {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}

/* ---------------- Hover overlay + icon ---------------- */
.lmg-item__hover-layer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.lmg-item__thumb:hover .lmg-item__hover-layer {
	opacity: 1;
}

.lmg-item__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.4);
}

.lmg-item__icon {
	position: relative;
	z-index: 1;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transform: scale(0.85);
	transition: transform 0.25s ease;
}

.lmg-item__thumb:hover .lmg-item__icon {
	transform: scale(1);
}

.lmg-item__icon i,
.lmg-item__icon svg {
	width: 1em;
	height: 1em;
	font-size: inherit;
}
