/* =========================================
   Design Tokens (example — now using YOUR colors)
   ========================================= */
:root {
  /* Colors */
  --color-primary: darkblue;
  --color-primary-hover: #581c87; /* darker blue for hover */
  --color-secondary: lightblue;
  --color-accent: #7b8000;
  --color-bg: #ffffff;
  --color-surface: darkblue;
  --color-surface-elevated: #f5f5ff;
  --color-border-subtle: #581c87;
  --color-text: #ffffff;
  --color-text-muted: #4b5563;
  --color-purple-500: #581c87;

  /* Semantic tokens for buttons */
  --color-btn-primary-bg: var(--color-primary);
  --color-btn-primary-bg-hover: var(--color-primary-hover);
  --color-btn-primary-text: #ffffff;
  --color-btn-secondary-bg: var(--color-secondary);
  --color-btn-secondary-text: #003366;
  --color-btn-ghost-bg: transparent;
  --color-btn-ghost-border: var(--color-border-subtle);
  --color-btn-accent-bg: var(--color-accent);
  --color-btn-disabled-bg: #e5e7eb;
  --color-btn-disabled-text: #9ca3af;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-size-body: 16px;
  --font-size-h1: 32px;
  --font-size-h2: 20px;
  --font-size-h3: 16px;
  --font-weight-bold: 600;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Layout */
  --sidebar-width: 260px;
  --content-max-width: 1120px;

  /* Radius & borders */
  --radius-md: 6px;
  --radius-lg: 10px;
  --border-subtle: 1px solid var(--color-border-subtle);

  /* Divider tokens (for <hr>) — using your purple */
  --divider-color: var(--color-purple-500);
  --divider-thickness: 2px;
  --divider-style: solid;
  --divider-space-y: var(--space-6);
}

/* =========================================
   Global / Layout
   ========================================= */
.ds-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  background: radial-gradient(
    circle at top,
    var(--color-secondary),
    var(--color-bg)
  );
  color: var(--color-text);
  display: flex;
}

/* 2-column layout: sidebar + main content */
.ds-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* =========================================
   Navigation (reusable)
   ========================================= */
.ds-nav {
  border-right: var(--border-subtle);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  background-color: var(--color-surface-elevated);
}

.ds-logo {
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  color: var(--color-primary);
}

.ds-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ds-nav__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 14px;
}

.ds-nav__link:hover {
  background-color: #e0f2ff;
  color: var(--color-text);
}

.ds-nav__link--active {
  background-color: var(--color-primary);
  color: var(--color-bg);
  border: 1px solid var(--color-primary);
}

.ds-nav__meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--color-text-muted);
}

.ds-nav__meta-link {
  color: inherit;
  text-decoration: none;
}

/* =========================================
   Main content & sections (reusable)
   ========================================= */
.ds-main {
  padding: var(--space-6) var(--space-8);
  max-width: var(--content-max-width);
}

.ds-breadcrumb {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.ds-page-header {
  margin-bottom: var(--space-6);
}

.ds-page-title {
  font-size: var(--font-size-h1);
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
}

.ds-page-lead {
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* Reusable grid for all component pages */
.ds-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.ds-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  padding: var(--space-5);
}

.ds-section__title {
  font-size: var(--font-size-h2);
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

.ds-section__body {
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.ds-subheading {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

.ds-list {
  padding-left: 1.2rem;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}

/* Example block (reusable) */
.ds-example {
  border-radius: var(--radius-md);
  border: var(--border-subtle);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  background-color: var(--color-surface-elevated);
}

/* Divider using tokens */
.ds-divider {
  border: 0;
  margin: var(--divider-space-y) 0;
  border-top: var(--divider-thickness) var(--divider-style) var(--divider-color);
}

/* Code blocks */
.ds-code-block {
  background-color: #f3f4ff;
  border-radius: var(--radius-md);
  border: var(--border-subtle);
  padding: var(--space-3);
  font-size: 13px;
  overflow-x: auto;
  color: var(--color-text-muted);
}

/* =========================================
   Buttons (component styles)
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease,
    transform 80ms ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

/* Sizes */
.btn--sm {
  padding: 4px 12px;
  font-size: 13px;
}

.btn--lg {
  padding: 10px 20px;
  font-size: 15px;
}

/* Variants */
.btn--primary {
  background-color: var(--color-btn-primary-bg);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-btn-primary-bg-hover);
}

.btn--secondary {
  background-color: var(--color-btn-secondary-bg);
  color: var(--color-btn-secondary-text);
  border-color: var(--color-border-subtle);
}

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

.btn:disabled,
.btn[disabled] {
  background-color: var(--color-btn-disabled-bg);
  color: var(--color-btn-disabled-text);
  cursor: not-allowed;
}

/* Layout helpers for examples */
.ds-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* =========================================
   Responsive tweaks
   ========================================= */
@media (max-width: 960px) {
  .ds-shell {
    grid-template-columns: 1fr;
  }

  .ds-nav {
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    gap: var(--space-4);
    border-right: none;
    border-bottom: var(--border-subtle);
  }

  .ds-nav__list {
    flex-direction: row;
    gap: var(--space-2);
  }

  .ds-main {
    padding: var(--space-4);
  }

  .ds-grid {
    grid-template-columns: 1fr;
  }
}
/* Blueberry CTA button using your tokens */
.blueberry-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start; /* was center */
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  /* add left padding so there’s room for the icon */
  padding-left: calc(var(--space-6) + var(--space-3));
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;

  /* Colors from tokens */
  background: var(--color-bg);
  color: var(--color-purple-500);

  /* Type from tokens */
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: 600;

  /* Shadows from tokens */
  box-shadow: var(--shadow-md);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.blueberry-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.05);
}

.blueberry-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* Icons use spacing tokens for size */
.blueberry-btn__icon {
  width: var(--space-6); /* 32px */
  height: var(--space-6);
  object-fit: contain;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

/* Default: intact berry visible, positioned at left inside the padding */
.blueberry-btn__icon--whole {
  position: absolute;
  left: var(--space-2);
  opacity: 1;
}

/* Smashed berry sits on top, hidden by default */
.blueberry-btn__icon--smashed {
  position: absolute;
  left: var(--space-2); /* same spot as whole icon */
  opacity: 0;
}

/* On active/pressed state, swap icons */
.blueberry-btn:active .blueberry-btn__icon--whole {
  opacity: 0;
  transform: scale(0.9);
}

.blueberry-btn:active .blueberry-btn__icon--smashed {
  opacity: 1;
  transform: scale(1.05);
}

/* Label now has its own space, no overlap */
.blueberry-btn__label {
  white-space: nowrap; /* or normal if you want wrapping */
}
