/* ============================================================
   Nahnu Snippet Library, nsl.css v1.0.0
   ============================================================ */

/* ── HERO, white with purple gradient ── */
.nsl-hero {
	background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 40%, #8b5cf6 70%, #a78bfa 100%);
	position: relative;
	overflow: hidden;
}

/* Subtle grid overlay */
.nsl-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
	background-size: 36px 36px;
	pointer-events: none;
}

/* Bottom fade to body */
.nsl-hero::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 80px;
	background: linear-gradient(to bottom, transparent, #f8fafc);
	pointer-events: none;
}

.nsl-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 1100px;
	margin: 0 auto;
	padding: 64px 32px 80px;
}

.nsl-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 20px;
	padding: 4px 14px;
	font-size: 12px;
	font-family: 'JetBrains Mono', 'Fira Code', monospace;
	color: rgba(255,255,255,0.9);
	margin-bottom: 22px;
}

.nsl-hero__eyebrow::before { content: '▸ '; }

.nsl-hero__title {
	font-size: clamp(28px, 4.5vw, 50px);
	font-weight: 800;
	letter-spacing: -1.5px;
	line-height: 1.1;
	margin: 0 0 16px;
	color: #ffffff;
}

.nsl-hero__desc {
	color: rgba(255,255,255,0.75);
	font-size: 17px;
	max-width: 480px;
	line-height: 1.65;
	margin: 0 0 36px;
}

.nsl-hero__desc code {
	font-family: 'JetBrains Mono', monospace;
	background: rgba(255,255,255,0.15);
	padding: 1px 7px;
	border-radius: 4px;
	font-size: 14px;
	color: #fff;
}

/* Search */
.nsl-search-wrap {
	position: relative;
	max-width: 420px;
}

.nsl-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 15px;
	height: 15px;
	color: rgba(255,255,255,0.5);
	pointer-events: none;
}

.nsl-search {
	width: 100%;
	padding: 13px 40px 13px 42px;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 10px;
	color: #fff;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: background 0.2s, border-color 0.2s;
}

.nsl-search::placeholder { color: rgba(255,255,255,0.5); }

.nsl-search:focus {
	background: rgba(255,255,255,0.22);
	border-color: rgba(255,255,255,0.5);
}

.nsl-search-clear {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: rgba(255,255,255,0.6);
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	padding: 4px;
}

/* ── SINGLE HERO VARIANTS ── */
.nsl-hero--single::after { display: none; }

.nsl-hero__inner--single {
	padding: 52px 32px 60px;
}

.nsl-breadcrumb {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: rgba(255,255,255,0.6);
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.nsl-breadcrumb a {
	color: rgba(255,255,255,0.8);
	text-decoration: none;
	transition: color 0.15s;
}

.nsl-breadcrumb a:hover { color: #fff; }

.nsl-badge-row {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.nsl-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 6px;
	letter-spacing: 0.02em;
}

.nsl-badge--cat {
	background: rgba(255,255,255,0.2);
	color: #fff;
	border: 1px solid rgba(255,255,255,0.3);
}

.nsl-badge--lang {
	background: rgba(255,255,255,0.12);
	color: rgba(255,255,255,0.9);
	border: 1px solid rgba(255,255,255,0.2);
	font-family: 'JetBrains Mono', monospace;
}

.nsl-badge--green     { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.nsl-badge--amber     { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.nsl-badge--red       { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.nsl-hero__title--single {
	font-size: clamp(22px, 3.5vw, 40px);
}

.nsl-hero__meta {
	color: rgba(255,255,255,0.5);
	font-size: 13px;
	margin: 10px 0 0;
}

/* ── BODY ── */
.nsl-body {
	background: #f8fafc;
}

.nsl-body__inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 40px 32px 80px;
}

.nsl-body__inner--single {
	max-width: 860px;
}

/* ── FILTERS ── */
.nsl-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 32px;
	align-items: center;
}

.nsl-filter-btn {
	padding: 7px 16px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 400;
	border: 1.5px solid #e2e8f0;
	background: #fff;
	color: #64748b;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.nsl-filter-btn:hover {
	border-color: #c4b5fd;
	color: #7c3aed;
}

.nsl-filter-btn.is-active {
	border-color: #7c3aed;
	background: #f5f3ff;
	color: #6d28d9;
	font-weight: 600;
	box-shadow: none;
}

.nsl-count {
	margin-left: auto;
	font-size: 13px;
	color: #94a3b8;
}

/* ── CARD GRID ── */
.nsl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
}

/* Cards are built by JS, see nsl-archive.js */
.nsl-card {
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
	display: block;
	text-decoration: none;
	color: inherit;
}

.nsl-card:hover {
	border-color: #7c3aed;
	transform: translateY(-3px);
	box-shadow: 0 8px 32px rgba(124,58,237,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

.nsl-card__body {
	padding: 22px 22px 24px;
}

.nsl-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.nsl-card__cat {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 5px;
	background: #f1f5f9;
	color: #475569;
}

.nsl-card__diff {
	font-size: 11px;
	font-weight: 500;
	padding: 3px 9px;
	border-radius: 5px;
	margin-left: auto;
}

.nsl-card__diff--beginner     { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.nsl-card__diff--intermediate { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.nsl-card__diff--advanced     { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.nsl-card__title {
	margin: 0 0 10px;
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.2px;
	color: #0f172a;
	transition: color 0.15s;
}

.nsl-card:hover .nsl-card__title { color: #6d28d9; }

.nsl-card__excerpt {
	margin: 0 0 18px;
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.65;
}

.nsl-card__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #94a3b8;
	transition: color 0.15s;
}

.nsl-card:hover .nsl-card__link { color: #6d28d9; }

/* ── NO RESULTS ── */
.nsl-empty {
	text-align: center;
	padding: 80px 20px;
	color: #94a3b8;
	font-size: 15px;
}

.nsl-reset-link {
	background: none;
	border: none;
	color: #7c3aed;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	text-decoration: underline;
	padding: 0;
}

/* ── SINGLE ARTICLE ── */
.nsl-article {
	margin-bottom: 56px;
}

.nsl-content {
	font-size: 16.5px;
	line-height: 1.8;
	color: #334155;
}

.nsl-content p  { margin: 0 0 20px; }
.nsl-content h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; color: #0f172a; margin: 44px 0 16px; }
.nsl-content h3 { font-size: 18px; font-weight: 700; color: #0f172a; margin: 32px 0 12px; }
.nsl-content ul { padding-left: 20px; margin: 0 0 20px; }
.nsl-content li { margin-bottom: 8px; }

.nsl-content code {
	background: #f1f5f9;
	padding: 2px 7px;
	border-radius: 5px;
	font-size: 14px;
	font-family: 'JetBrains Mono', 'Fira Code', monospace;
	color: #6d28d9;
}

/* ── CODE BLOCK ── */
.nsl-code-block {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #1e293b;
	margin: 32px 0 40px;
}

.nsl-code-block__bar {
	background: #1a2234;
	padding: 10px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.nsl-code-block__dots {
	display: flex;
	gap: 6px;
}

.nsl-code-block__dots span {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	display: inline-block;
}

.nsl-code-block__dots span:nth-child(1) { background: #ff5f57; }
.nsl-code-block__dots span:nth-child(2) { background: #febc2e; }
.nsl-code-block__dots span:nth-child(3) { background: #28c840; }

.nsl-code-block__file {
	font-size: 12px;
	color: #475569;
	font-family: 'JetBrains Mono', monospace;
	flex: 1;
	text-align: center;
}

.nsl-copy-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 6px;
	padding: 5px 12px;
	color: #94a3b8;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
	white-space: nowrap;
}

.nsl-copy-btn:hover {
	background: rgba(255,255,255,0.1);
	color: #e2e8f0;
}

.nsl-copy-btn.is-copied {
	background: rgba(80,250,123,0.12);
	border-color: rgba(80,250,123,0.3);
	color: #50fa7b;
}

.nsl-pre {
	margin: 0 !important;
	background: #282c34; /* matches atom-one-dark */
	padding: 20px 0 !important;
	overflow-x: auto;
	border-radius: 0 !important;
}

/* Let highlight.js theme control all code colours */
.nsl-pre code.hljs {
	background: transparent;
	padding: 0 24px 0 20px;
	font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
	font-size: 13.5px;
	line-height: 1.85;
}


/* ── CTA ── */
.nsl-cta {
	background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
	border-radius: 20px;
	padding: 52px;
	margin-top: 64px;
	position: relative;
	overflow: hidden;
}

.nsl-cta::before {
	content: '';
	position: absolute;
	top: -60px;
	right: 60px;
	width: 360px;
	height: 360px;
	background: radial-gradient(circle, rgba(124,58,237,0.18) 0%, transparent 70%);
	pointer-events: none;
}

.nsl-cta__content { position: relative; z-index: 1; }

.nsl-cta__eyebrow {
	margin: 0 0 8px;
	font-size: 11px;
	color: #a78bfa;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.nsl-cta__title {
	margin: 0 0 12px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.6px;
	color: #f1f5f9;
	max-width: 480px;
	line-height: 1.25;
}

.nsl-cta__desc {
	margin: 0 0 32px;
	color: #94a3b8;
	font-size: 15px;
	max-width: 440px;
	line-height: 1.65;
}

.nsl-cta__btn {
	display: inline-block;
	padding: 13px 28px;
	background: linear-gradient(135deg, #7c3aed, #6d28d9);
	border-radius: 10px;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	font-family: inherit;
	text-decoration: none;
	box-shadow: 0 4px 20px rgba(124,58,237,0.4);
	transition: box-shadow 0.2s, transform 0.2s;
}

.nsl-cta__btn:hover {
	box-shadow: 0 6px 28px rgba(124,58,237,0.55);
	transform: translateY(-1px);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
	.nsl-hero__inner { padding: 40px 20px 56px; }
	.nsl-body__inner { padding: 32px 20px 60px; }
	.nsl-cta         { padding: 36px 28px; }
	.nsl-cta__title  { font-size: 20px; }
	.nsl-grid        { grid-template-columns: 1fr; }
}
