/* ============================================
   µCSS Website — Custom Styles
   Uses µCSS (Fuchsia theme) as base
   ============================================ */

/* --- Hero Section --- */
.hero {
	margin-bottom: 2rem;
}
.hero h1 {
	font-size: 4rem;
	color: inherit;
	margin-bottom: 0.25rem;
	letter-spacing: -0.02em;
}
.hero .tagline {
	font-size: 1.5rem;
	opacity: 0.9;
	margin-bottom: 0.25rem;
}
.hero .subtitle {
	font-size: 1.1rem;
	opacity: 0.75;
	margin-bottom: 1.5rem;
}
.hero .badges {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}
.hero .badge {
	display: inline-block;
	padding: 0.35rem 0.85rem;
	border-radius: 2rem;
	background: rgba(255, 255, 255, 0.2);
	font-size: 0.85rem;
	font-weight: 600;
	backdrop-filter: blur(4px);
}
.hero .cta {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}
.hero .cta a {
	display: inline-block;
	padding: 0.65rem 1.5rem;
	border-radius: 0.375rem;
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
	transition: opacity 0.2s;
}
.hero .cta a:hover {
	opacity: 0.85;
}
.hero .cta .btn-primary {
	background: var(--mu-primary-inverse);
	color: var(--mu-primary);
}
.hero .cta .btn-secondary {
	background: rgba(255, 255, 255, 0.15);
	color: var(--mu-primary-inverse);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

/* --- Intro Section --- */
.intro p {
	font-size: 1.1rem;
	line-height: 1.7;
	color: var(--mu-muted-color);
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

/* --- Features Grid --- */
.features-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.feature-card {
	margin-bottom: 0;
}
.feature-card h3 {
	margin-top: 0;
	margin-bottom: 0.5rem;
	font-size: 1.1rem;
}
.feature-card p {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}
@media (max-width: 1024px) {
	.features-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 768px) {
	.features-grid {
		grid-template-columns: 1fr;
	}
}

/* --- Code Blocks --- */
pre {
	background: #1e1e2e;
	color: #cdd6f4;
	padding: 1.25rem 1.5rem;
	border-radius: 0.5rem;
	overflow-x: auto;
	font-size: 0.875rem;
	line-height: 1.6;
	margin: 1rem 0;
}
pre code {
	background: none;
	padding: 0;
	color: inherit;
	font-size: inherit;
}
code {
	background: var(--mu-code-background-color);
	color: var(--mu-code-color);
	padding: 0.15rem 0.4rem;
	border-radius: 0.25rem;
	font-size: 0.875em;
}

/* Syntax highlighting */
.hl-tag { color: #89b4fa; }
.hl-attr { color: #f9e2af; }
.hl-value { color: #a6e3a1; }
.hl-comment { color: #6c7086; font-style: italic; }
.hl-keyword { color: #cba6f7; }
.hl-string { color: #a6e3a1; }
.hl-function { color: #89dceb; }
.hl-number { color: #fab387; }

/* --- Documentation Layout --- */
.doc-layout {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}
.doc-content {
	min-width: 0;
}
.doc-content pre {
	overflow-x: auto;
}
.doc-content table {
	display: block;
	overflow-x: auto;
}
@media (max-width: 768px) {
	.doc-layout {
		grid-template-columns: 1fr;
	}
	.doc-sidebar {
		display: none;
	}
	.doc-mobile-nav {
		display: block !important;
	}
}

/* Sidebar */
.doc-sidebar {
	position: sticky;
	top: 1rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
}
.doc-sidebar .category-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--mu-muted-color);
	padding: 0.75rem 0.75rem 0.25rem;
	margin: 0;
}
.doc-sidebar .category-title:first-child {
	padding-top: 0;
}
.doc-sidebar ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.doc-sidebar li {
	margin: 0;
}
.doc-sidebar a {
	display: block;
	padding: 0.35rem 0.75rem;
	color: var(--mu-muted-color);
	text-decoration: none;
	font-size: 0.9rem;
	border-left: 2px solid transparent;
	border-radius: 0;
	transition: all 0.15s;
}
.doc-sidebar a:hover {
	color: var(--mu-primary);
	background: var(--mu-primary-focus);
}
.doc-sidebar a.active {
	color: var(--mu-primary);
	border-left-color: var(--mu-primary);
	background: var(--mu-primary-focus);
	font-weight: 600;
}

/* Mobile doc nav */
.doc-mobile-nav {
	display: none;
	margin-bottom: 1.5rem;
}
.doc-mobile-nav select {
	width: 100%;
	padding: 0.5rem;
	font-size: 1rem;
	border: 1px solid var(--mu-form-element-border-color);
	border-radius: 0.375rem;
}

/* --- Documentation Content --- */
.doc-content section {
	margin-bottom: 3rem;
}
.doc-content h2 {
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--mu-muted-border-color);
	margin-top: 0;
}
.doc-content h2:not(:first-child) {
	margin-top: 2rem;
}
.doc-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 0.9rem;
}
.doc-content th,
.doc-content td {
	padding: 0.6rem 0.8rem;
	text-align: left;
	border: 1px solid var(--mu-table-border-color);
}
.doc-content th {
	background: #1e1e2e;
	font-weight: 600;
}
.doc-content td code {
	white-space: nowrap;
}

/* --- Component Preview --- */
.component-preview {
	background: var(--mu-card-background-color);
	border: 1px solid var(--mu-muted-border-color);
	border-radius: 0.5rem;
	padding: 1.5rem;
	margin: 1rem 0;
}

/* --- Documentation Categories (index page) --- */
.doc-categories {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.doc-categories article {
	margin-bottom: 0;
}
.doc-categories article h3 {
	margin-top: 0;
	margin-bottom: 0.75rem;
}
.doc-categories article ul {
	margin: 0;
	padding-left: 1.25rem;
}
.doc-categories article ul li {
	margin-bottom: 0.3rem;
	font-size: 0.95rem;
}
.doc-categories article ul li a {
	text-decoration: none;
	color: var(--mu-primary);
}
.doc-categories article ul li a:hover {
	text-decoration: underline;
}
@media (max-width: 1024px) {
	.doc-categories {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 768px) {
	.doc-categories {
		grid-template-columns: 1fr;
	}
}

/* --- Themes Page --- */
.theme-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 1rem;
	margin: 2rem 0;
}
.theme-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem;
	border: 2px solid var(--mu-muted-border-color);
	border-radius: 0.5rem;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	text-align: center;
}
.theme-card:hover {
	border-color: var(--mu-primary);
}
.theme-card.active {
	border-color: var(--mu-primary);
	box-shadow: 0 0 0 2px var(--mu-primary-focus);
}
.theme-card .theme-swatch {
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.1);
}
.theme-card .theme-name {
	font-size: 0.85rem;
	font-weight: 600;
}
.theme-preview-zone {
	border: 1px solid var(--mu-muted-border-color);
	border-radius: 0.5rem;
	padding: 2rem;
	margin: 2rem 0;
	min-height: 300px;
}
.theme-controls {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1rem 0;
	flex-wrap: wrap;
}
.theme-controls label {
	font-weight: 600;
}

/* --- Steps --- */
.steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.step {
	text-align: center;
	padding: 1.5rem;
}
.step .step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--mu-primary);
	color: var(--mu-primary-inverse);
	font-weight: 700;
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
}
.step h3 {
	margin: 0 0 0.5rem;
}
.step p {
	margin: 0;
	color: var(--mu-muted-color);
	font-size: 0.95rem;
}
@media (max-width: 768px) {
	.steps {
		grid-template-columns: 1fr;
	}
}

/* --- Color Theme Showcase (Homepage) --- */
.theme-showcase {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.theme-showcase-card {
	text-align: center;
	padding: 1.5rem;
	border: 1px solid var(--mu-muted-border-color);
	border-radius: 0.5rem;
}
.theme-showcase-card .swatch-row {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.theme-showcase-card .swatch {
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.1);
}
.theme-showcase-card h3 {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}
@media (max-width: 768px) {
	.theme-showcase {
		grid-template-columns: 1fr;
	}
}

/* --- Component Showcase (Homepage) --- */
.component-showcase {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.component-showcase .showcase-item {
	border: 1px solid var(--mu-muted-border-color);
	border-radius: 0.5rem;
	padding: 1.5rem;
}
.component-showcase .showcase-item h3 {
	margin-top: 0;
	margin-bottom: 1rem;
	font-size: 1rem;
	color: var(--mu-muted-color);
}
@media (max-width: 768px) {
	.component-showcase {
		grid-template-columns: 1fr;
	}
}

/* --- Section Spacing --- */
.section {
	padding: 2rem 0;
}
.section h2 {
	margin-top: 0;
}

/* --- Related Projects --- */
.related-projects {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	margin: 2rem 0;
}
.related-projects article {
	margin-bottom: 0;
}
.related-projects h3 {
	margin-top: 0;
}
.related-projects p:last-child {
	margin-bottom: 0;
}
@media (max-width: 768px) {
	.related-projects {
		grid-template-columns: 1fr;
	}
}

/* --- Footer --- */
footer {
	text-align: center;
	padding: 2rem 0;
	margin-top: 3rem;
	border-top: 1px solid var(--mu-muted-border-color);
	color: var(--mu-muted-color);
	font-size: 0.9rem;
}
footer a {
	color: var(--mu-primary);
	text-decoration: none;
}
footer a:hover {
	text-decoration: underline;
}

/* --- Color Swatches (documentation) --- */
.swatch-table .swatch {
	display: inline-block;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.375rem;
	vertical-align: middle;
}
.swatch-row-cards {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin: 1rem 0;
}
.swatch-card {
	text-align: center;
	font-size: 0.75rem;
	color: var(--mu-muted-color);
}
.swatch-card .swatch {
	display: block;
	width: 5rem;
	height: 2.5rem;
	border-radius: 0.375rem;
	margin-bottom: 0.25rem;
}
.color-demo {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	margin: 0.15rem;
	border-radius: 0.25rem;
	font-size: 0.85rem;
}

/* --- Theme Mapping Table --- */
.theme-mapping {
	overflow-x: auto;
	margin: 1.5rem 0;
}
.theme-mapping table {
	font-size: 0.8rem;
	white-space: nowrap;
}
.theme-mapping th,
.theme-mapping td {
	padding: 0.4rem 0.6rem;
	text-align: center;
}
.theme-mapping td:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
	background-color: var(--mu-background-color);
	text-align: left;
}
.clr-red { background: #c52f21; color: #fff; }
.clr-pink { background: #c72259; color: #fff; }
.clr-fuchsia { background: #c1208b; color: #fff; }
.clr-purple { background: #aa40bf; color: #fff; }
.clr-violet { background: #8352c5; color: #fff; }
.clr-indigo { background: #655cd6; color: #fff; }
.clr-blue { background: #2060df; color: #fff; }
.clr-azure { background: #0172ad; color: #fff; }
.clr-cyan { background: #047878; color: #fff; }
.clr-jade { background: #007a50; color: #fff; }
.clr-green { background: #33790f; color: #fff; }
.clr-lime { background: #577400; color: #fff; }
.clr-yellow { background: #756b00; color: #fff; }
.clr-amber { background: #876400; color: #fff; }
.clr-pumpkin { background: #9c5900; color: #fff; }
.clr-orange { background: #bd3c13; color: #fff; }
.clr-sand { background: #6e6a60; color: #fff; }
.clr-grey { background: #6a6a6a; color: #fff; }
.clr-zinc { background: #646b79; color: #fff; }
.clr-slate { background: #5d6b89; color: #fff; }
.pop-red { background: #f17961; color: #fff; }
.pop-pink { background: #f7708e; color: #fff; }
.pop-fuchsia { background: #f869bf; color: #fff; }
.pop-purple { background: #d47de4; color: #fff; }
.pop-violet { background: #b290d9; color: #fff; }
.pop-indigo { background: #a294e5; color: #fff; }
.pop-blue { background: #8999f9; color: #fff; }
.pop-azure { background: #01aaff; color: #fff; }
.pop-cyan { background: #0ab1b1; color: #fff; }
.pop-jade { background: #00b478; color: #fff; }
.pop-green { background: #4eb31b; color: #fff; }
.pop-lime { background: #82ab00; color: #fff; }
.pop-yellow { background: #ad9f00; color: #fff; }
.pop-amber { background: #c79400; color: #fff; }
.pop-pumpkin { background: #e48500; color: #fff; }
.pop-orange { background: #f56b3d; color: #fff; }
.pop-sand { background: #a39e8f; color: #fff; }
.pop-grey { background: #9e9e9e; color: #fff; }
.pop-zinc { background: #969eaf; color: #fff; }
.pop-slate { background: #909ebe; color: #fff; }

/* --- General Utilities --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
	.hero h1 {
		font-size: 2.5rem;
	}
	.hero .tagline {
		font-size: 1.2rem;
	}
}
