/* Floating filter button */
.floating-filter-btn {
	position: fixed;
	bottom: 32px;
	right: 32px;
	z-index: 1200;
	background: #4db852;
	color: #222;
	border: none;
	border-radius: 50%;
	width: 60px;
	height: 60px;
	font-size: 2em;
	box-shadow: 0 4px 16px #0005;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.floating-filter-btn:hover, .floating-filter-btn:focus {
	background: #7be87a;
	color: #222;
	box-shadow: 0 6px 24px #0007;
}
/* Modal filter card */
.filter-modal {

	padding: 0;
	border: none;
	border-radius: 16px;
	max-width: 700px;
	width: 98vw;
	background: transparent;
	box-shadow: 0 8px 48px #000a;
	margin: auto;
	top: 10vh;
	left: 0;
	right: 0;
	position: fixed;
	z-index: 2000;
}
.filter-modal[open] {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	background: rgba(24,25,28,0.85);
}
.filter-modal form {
	margin: 0;
}
.filter-card {
	background: #20232a;
	border-radius: 12px;
	box-shadow: 0 2px 16px #0003;
	margin: 0;
	padding: 1.2em 1.5em 1.2em 1.5em;
	max-width: 700px;
	width: 100%;
	transition: box-shadow 0.2s, background 0.2s;
}
.filter-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.7em;
	font-size: 1.1em;
	font-weight: 600;
	color: #4db852;
}
#close-filter-modal {
	background: #222;
	color: #4db852;
	border: 1.5px solid #4db85299;
	border-radius: 6px;
	padding: 0.3em 1.1em;
	font-size: 1.2em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s, color 0.18s, border 0.18s;
	outline: none;
}
#close-filter-modal:hover, #close-filter-modal:focus {
	background: #4db852;
	color: #222;
	border-color: #4db852;
}
/* Collapsible filter card */
.filter-card {
	background: #20232a;
	border-radius: 12px;
	box-shadow: 0 2px 16px #0003;
	margin-bottom: 1.5em;
	padding: 1.2em 1.5em 1.2em 1.5em;
	max-width: 1200px;
	width: 100%;
	transition: box-shadow 0.2s, background 0.2s;
}
.filter-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.7em;
	font-size: 1.1em;
	font-weight: 600;
	color: #4db852;
}
#toggle-filter-card {
	background: #222;
	color: #4db852;
	border: 1.5px solid #4db85299;
	border-radius: 6px;
	padding: 0.3em 1.1em;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s, color 0.18s, border 0.18s;
	outline: none;
}
#toggle-filter-card:hover, #toggle-filter-card:focus {
	background: #4db852;
	color: #222;
	border-color: #4db852;
}
.filter-summary {
	color: #eee;
	background: #232325;
	border-radius: 7px;
	padding: 0.7em 1em;
	margin-top: 0.5em;
	font-size: 1em;
	box-shadow: 0 1px 6px #0002;
}
/* Sticky, wrapping top category bar */
.category-bar {
	position: sticky;
	top: 0;
	z-index: 1000;

	display: flex;
	flex-wrap: wrap;
	gap: 0.7em;
	background: var(--bg, #18191c);
	padding: 0.7em 0.5em 0.7em 0.5em;
	border-bottom: 1.5px solid #222;
	box-shadow: 0 2px 8px #0002;
	margin-bottom: 1.2em;
}
.category-bar button {
	background: #222;
	color: #4db852;
	border: 2px solid #4db85299;
	border-radius: 7px;
	padding: 0.5em 1.2em;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s, color 0.18s, border 0.18s, box-shadow 0.18s;
	outline: none;
	margin-bottom: 0.2em;
}
.category-bar button.active,
.category-bar button:focus {
	background: #4db852;
	color: #222;
	border-color: #4db852;
	box-shadow: 0 0 0 2px #4db85255;
}
.category-bar button:hover {
	background: #7be87a;
	color: #222;
}
/* Layout for sidebar navigation */
.materials-layout {
	display: flex;
	flex-direction: row;
}
.main-content {
	flex: 1;
	padding-left: 2em;
}
/* Responsive grid for material tiles */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2.2em 1.5em;
	margin-bottom: 2.5em;
}
.tile {
	background: #181818;
 
	border-radius: 14px;
	box-shadow: 0 2px 16px #000a;
	padding: 1.1em 1.1em 0.7em 1.1em;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: box-shadow 0.2s, transform 0.2s;
	max-width: 340px;
	margin: 0 auto;
}

.tile img {
	width: 100%;
	height: auto;
	max-width: 260px;
	border-radius: 10px;
	background: #222;
	margin-bottom: 0.7em;
	box-shadow: 0 1px 8px #0007;
}

/* Style for placeholder images */
.tile img[src$='placeholder.svg'],
#lightbox-img[src$='placeholder.svg'] {
	object-fit: contain;
	background: #222;
	border: 2px dashed #444;
	filter: grayscale(0.2) brightness(0.9);
}
/* Clear Filters button: more distinct and accessible */
#clear-filters {
	background: linear-gradient(90deg, #444 60%, #222 100%);
	color: #ffd700;
	border: 2px solid #ffd700;
	font-weight: bold;
	letter-spacing: 0.03em;
	transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
	outline: none;
}
#clear-filters:hover, #clear-filters:focus {
	background: #ffd700;
	color: #222;
	border-color: #ffd700;
	box-shadow: 0 0 0 2px #ffd70055;
}

/* Lightbox modal: fade-in and close button */
#lightbox-modal {
	animation: fadeInModal 0.25s;
}
@keyframes fadeInModal {
	from { opacity: 0; }
	to { opacity: 1; }
}
#lightbox-close {
	position: absolute;
	top: 2.5vh;
	right: 3vw;
	background: #222;
	color: #ffd700;
	border: none;
	font-size: 2.2em;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	cursor: pointer;
	z-index: 10001;
	box-shadow: 0 2px 8px #000a;
	transition: background 0.2s, color 0.2s;
}
#lightbox-close:hover, #lightbox-close:focus {
	background: #ffd700;
	color: #222;
	outline: none;
}
}

.tile-footer {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.3em;
}

@media (max-width: 900px) {
	.facet-bar { flex-direction: column; gap: 0.7em; }
	.facet-bar .facet-group { margin-right: 0; }
	.grid { gap: 1.2em 0.7em; }
	.tile { max-width: 98vw; padding: 0.7em 0.7em 0.5em 0.7em; }
	.tile img { max-width: 90vw; }
}

@media (max-width: 600px) {
	.grid { grid-template-columns: 1fr; }
	.tile { padding: 0.5em 0.2em 0.3em 0.2em; }
	.tile img { max-width: 98vw; }
	.facet-bar { gap: 0.3em; }
}
/* Sidebar base */
body {
	background-color: #050505;  /* dark charcoal */
	color: #d0d0d0;             /* soft white, not harsh */
	font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", sans-serif;
	margin: 24px;
}

/* Headings */
h1 {
	font-size: 1.6rem;
	margin-bottom: 0.75rem;
	color: #d0d0d0;
}

h2 {
	font-size: 1.2rem;
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
	color: #d0d0d0;
}

/* Lists */
ul {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

li {
	margin: 0.25rem 0;
}

/* Links: same color for normal/visited/active */
a,
a:visited,
a:active {
	color: #4db852;
	text-decoration: none;
}

a:hover,
a:focus {
	color: #9cd7ff;
	text-decoration: underline;
}

/* Forced black background for tutorial pages */
.sidebar-dark {
	background-color: #000000;
/* ===================================================== */
/* Quiet Refinements — appended overrides only            */
/* ===================================================== */

/* Improve overall text rendering */
.materials-reference,
body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Sidebar: slightly calmer separation */
.category-sidebar {
	border-right: 1px solid rgba(255,255,255,0.06);
}

/* Sidebar links: reduce emphasis without losing clarity */
.category-sidebar a:hover,
.category-sidebar a.active,
.category-sidebar a:focus {
	color: #e6d27a;              /* softer gold */
	font-weight: 600;
}

/* Grid rhythm: a touch more air vertically */
.grid {
	row-gap: 2.6em;
}

/* Tiles: less “card”, more “specimen” */
.tile {
	background: #151515;
	border: 1px solid rgba(255,255,255,0.06);
	box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}

/* Hover should feel physical, not interactive */
.tile:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 44px rgba(0,0,0,0.55);
}

/* Images: slightly calmer contrast response */
.tile img {
	transition: filter 160ms ease, transform 160ms ease;
}

.tile:hover img {
	filter: contrast(1.03);
	transform: scale(1.01);
}

/* Tile footer: reduce visual weight */
.tile-footer {
	font-size: 0.92em;
	color: #bdbdbd;
}

/* Copy button: make it feel like a tool, not a CTA */
.copy-btn {
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.14);
	color: #d0d0d0;
}

.copy-btn:hover {
	background: rgba(255,255,255,0.09);
	border-color: rgba(255,255,255,0.22);
}

/* Facet inputs: quieter presence */
.facet-bar input,
#sort-select {
	background: rgba(255,255,255,0.035);
	border-color: rgba(255,255,255,0.12);
}

.facet-bar input::placeholder {
	color: rgba(208,208,208,0.55);
}

/* Section titles: more catalog, less web */
.section-title {
	letter-spacing: 0.03em;
	border-bottom-color: rgba(255,255,255,0.08);
	color: #d4d4d4;
}

/* Lightbox backdrop: slightly more absorptive */
#lightbox-modal {
	backdrop-filter: blur(4px);
	background-color: rgba(0,0,0,0.78);
}
