/* GeoNovus tootekataloog – [gn_tooted]. Colours and font follow the site. */

.gn-catalog {
	--gn-ink: var(--e-global-color-primary, #22222F);
	--gn-text: var(--e-global-color-secondary, #54595F);
	--gn-yellow: var(--e-global-color-accent, #FFD049);
	--gn-line: #E4E4E4;
	--gn-line-strong: #C9C9C9;
	--gn-soft: #F6F6F4;
	--gn-media: #7A7A7A1A; /* the site's light grey */
	font-family: inherit;
	color: var(--gn-ink);
	width: 100%;
}
.gn-catalog *,
.gn-catalog *::before,
.gn-catalog *::after { box-sizing: border-box; }

/* Filter chips */
.gn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; }
.gn-catalog .gn-chip,
.gn-catalog .gn-chip:hover,
.gn-catalog .gn-chip:focus,
.gn-catalog .gn-chip:active {
	height: 40px;
	padding: 0 18px;
	border: 1px solid var(--gn-line);
	border-radius: 100px;
	background: #fff;
	color: var(--gn-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .14s ease, background-color .14s ease;
}
.gn-catalog .gn-chip:hover { border-color: var(--gn-line-strong); }
.gn-catalog .gn-chip[aria-pressed="true"] { background: var(--gn-yellow); border-color: var(--gn-yellow); font-weight: 600; }
.gn-catalog .gn-chip:focus-visible { outline: 2px solid var(--gn-ink); outline-offset: 2px; }

/* Sections */
.gn-cat-section + .gn-cat-section { margin-top: 56px; }
.gn-cat-section[hidden] { display: none; }
.gn-catalog .gn-cat-heading {
	margin: 0 0 20px;
	font-family: inherit;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gn-ink);
}

/* Grid */
.gn-catalog .gn-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	/* Up to --gn-cols columns; fewer when a card would get narrower than 200px. */
	grid-template-columns: repeat(auto-fill, minmax(max(200px, (100% - (var(--gn-cols, 4) - 1) * 24px) / var(--gn-cols, 4)), 1fr));
	gap: 24px;
}
.gn-catalog .gn-cards > li { margin: 0; padding: 0; line-height: 1.4; }
.gn-catalog .gn-cards > li::before { content: none; }

/* Card */
.gn-catalog .gn-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid var(--gn-line);
	border-radius: 0 16px 16px 16px; /* square top-left corner */
	overflow: hidden;
	color: var(--gn-ink);
	text-decoration: none;
	box-shadow: none;
	transition: border-color .14s ease;
}
.gn-catalog .gn-card:hover { border-color: var(--gn-line-strong); color: var(--gn-ink); }
.gn-catalog .gn-card:hover .gn-card-title { text-decoration: underline; text-underline-offset: 3px; }
.gn-catalog .gn-card:focus-visible { outline: 2px solid var(--gn-ink); outline-offset: 2px; }

.gn-card-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: 16px;
	background: var(--gn-media);
}
.gn-catalog .gn-card-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply; /* white photo backgrounds blend into the light panel */
	border-radius: 0;
	box-shadow: none;
}
.gn-catalog .gn-card-img--norm { object-fit: cover; }
.gn-card-media:has(.gn-card-img--norm) { padding: 0; }
.gn-card-noimg { width: 100%; height: 100%; }

.gn-catalog .gn-catalog-title {
	margin: 0 0 24px;
	font-family: inherit;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--gn-ink);
}

.gn-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 100px;
	background: var(--gn-yellow);
	color: var(--gn-ink);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.gn-card-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px 20px; }
.gn-card-title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--gn-ink); }
.gn-card-desc { font-size: 14px; line-height: 1.45; color: var(--gn-text); }

/* Phone: two per row, chips scroll sideways */
@media (max-width: 767px) {
	.gn-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin: 0 -16px 32px;
		padding: 0 16px 4px;
		scrollbar-width: none;
	}
	.gn-chips::-webkit-scrollbar { display: none; }
	.gn-catalog .gn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.gn-cat-section + .gn-cat-section { margin-top: 40px; }
	.gn-catalog .gn-cat-heading { font-size: 19px; margin-bottom: 14px; }
	.gn-card-media { padding: 10px; }
	.gn-badge { top: 8px; left: 8px; padding: 3px 8px; font-size: 11px; }
	.gn-card-body { padding: 12px 14px 16px; }
	.gn-card-title { font-size: 15px; }
	.gn-card-desc { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.gn-catalog * { transition: none !important; }
}
