/* ==========================================================================
   Themes page
   ========================================================================== */

.themes-intro {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.themes-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0.5rem auto 1.5rem;
  max-width: 20ch;
}
.themes-intro p.lead {
  margin: 0 auto;
  font-size: 1.2rem;
}

/* Section dividers — "Dark" / "Light" */
.theme-group {
  margin-bottom: clamp(4rem, 8vw, 6rem);
}
.theme-group-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.theme-group-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  margin: 0;
}
.theme-group-header .count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.theme-group-header .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Grid of theme cards */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.theme-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform var(--d-mid) var(--ease-out), border-color var(--d-mid) var(--ease-out);
  position: relative;
}
.theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
}

/* Theme preview window */
.theme-preview {
  height: 200px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* The preview mimics a tiny editor with header + sidebar + code */
.theme-preview-bar {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
}
.theme-preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  opacity: 0.6;
}
.theme-preview-body {
  display: grid;
  grid-template-columns: 60px 1fr;
  height: calc(100% - 22px);
}
.theme-preview-sidebar {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.theme-preview-sidebar-item {
  height: 5px;
  border-radius: 2px;
  opacity: 0.55;
}
.theme-preview-sidebar-item.active { opacity: 1; }
.theme-preview-code {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
}

.theme-meta {
  padding: 1.25rem 1.5rem 1.5rem;
}
.theme-meta h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.3rem;
  letter-spacing: -0.015em;
}
.theme-meta p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.theme-swatches {
  display: flex;
  gap: 4px;
  margin-top: 0.85rem;
}
.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Default-theme tag */
.theme-default-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(94, 234, 212, 0.15);
  color: var(--accent-teal);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(94, 234, 212, 0.3);
  font-weight: 600;
  z-index: 2;
}

/* Custom theme block */
.custom-theme-block {
  margin-top: clamp(4rem, 6vw, 6rem);
  padding: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.03), rgba(34, 197, 94, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
}
.custom-theme-block h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}
.custom-theme-block p {
  max-width: 56ch;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}
.custom-theme-block pre {
  text-align: left;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-surface);
}

/* Font zones table */
.fonts-table {
  margin-top: clamp(3rem, 5vw, 4.5rem);
}
.fonts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.font-zone {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.font-zone-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.font-zone-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
}
.font-zone-var {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-teal);
  margin-top: 0.3rem;
}
