/* Lab theme — مكونات المختبر */
:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-elevated: #232f3f;
  --text: #e6edf3;
  --text-muted: #8b9cb6;
  --accent: #3eb489;
  --accent-hover: #52c49a;
  --border: #2d3d52;
  --radius: 8px;
  --font-sans: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --max-width: 52rem;
  --header-h: 3.5rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Home */
.home {
  padding-top: 0.5rem;
}

.hero {
  text-align: center;
  padding: 2.5rem 0 3rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-print {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-print:hover {
  background: var(--border);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.component-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.component-list a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0;
  display: block;
  border-bottom: 1px solid var(--border);
}

.component-list a:hover {
  color: var(--accent);
}

.home-content {
  margin-bottom: 2rem;
}

/* List (components index) */
.list-page {
  padding-top: 0.5rem;
}

.list-header {
  margin-bottom: 2rem;
}

.list-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.list-intro {
  color: var(--text-muted);
  font-size: 1rem;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.card-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-title,
.card-desc {
  padding: 0 1.25rem;
}

.card-title {
  font-weight: 600;
  font-size: 1.05rem;
  padding-top: 1rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-bottom: 1.25rem;
}

.card:not(.card--with-image) {
  padding: 1.25rem;
}

.card:not(.card--with-image) .card-title {
  padding: 0;
}

.card:not(.card--with-image) .card-desc {
  padding: 0.35rem 0 0;
}

/* Single (component page) */
.content-header {
  margin-bottom: 1.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  color: var(--border);
  margin: 0 0.35rem;
}

.content-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.content-image-wrap {
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.content-image {
  width: 100%;
  max-height: 20rem;
  object-fit: contain;
  display: block;
}

.content-body {
  margin-bottom: 1.5rem;
}

.content-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Prose (markdown content) */
.prose {
  font-size: 1rem;
}

.prose h1 { font-size: 1.5rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin: 1.35rem 0 0.6rem; }
.prose h3 { font-size: 1.1rem; font-weight: 600; margin: 1.2rem 0 0.5rem; }

.prose p {
  margin: 0 0 1rem;
}

.prose ul, .prose ol {
  margin: 0 0 1rem;
  padding-right: 1.5rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: right;
}

.prose th {
  background: var(--bg-elevated);
  font-weight: 600;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0.75rem 0;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose strong {
  font-weight: 600;
}
