/* Examples-only CSS: tweaks for the demo chrome itself. Not part of dist/. */

.ex-page {
  min-height: 100dvh;
  background-color: var(--bf-color-canvas-bg);
}

.ex-shell-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}
.ex-side {
  background-color: var(--bf-color-bg-base);
  border-right: 1px solid var(--bf-color-border-base);
  padding: var(--bf-space-3);
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.ex-side h2 {
  font-size: var(--bf-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--bf-tracking-wide);
  color: var(--bf-color-text-muted);
  margin: var(--bf-space-3) var(--bf-space-2) var(--bf-space-1_5);
}
.ex-side h2:first-child { margin-top: 0; }
.ex-side a {
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
  padding: var(--bf-space-1_5) var(--bf-space-2);
  border-radius: var(--bf-radius-md);
  color: var(--bf-color-text-base);
  font-size: var(--bf-text-sm);
  text-decoration: none;
}
.ex-side a:hover { background-color: var(--bf-color-surface-hover); text-decoration: none; }
.ex-side a.is-active {
  background-color: var(--bf-color-surface-selected);
  color: var(--bf-color-shell-active-fg);
  font-weight: var(--bf-weight-medium);
}
.ex-side a .ex-side__todo {
  margin-left: auto;
  font-size: var(--bf-text-2xs);
  color: var(--bf-color-warning-fg);
  background-color: var(--bf-color-warning-bg);
  padding: 1px var(--bf-space-1_5);
  border-radius: var(--bf-radius-pill);
}
.ex-side__brand {
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
  padding: var(--bf-space-2);
  margin-bottom: var(--bf-space-3);
  font-weight: var(--bf-weight-semibold);
  color: var(--bf-color-text-strong);
}
.ex-main {
  padding: var(--bf-space-6) var(--bf-space-8);
  max-width: 1200px;
  width: 100%;
}
.ex-main h1 {
  font-size: var(--bf-text-3xl);
  font-weight: var(--bf-weight-semibold);
  color: var(--bf-color-text-strong);
  margin-bottom: var(--bf-space-2);
}
.ex-main h2 {
  font-size: var(--bf-text-xl);
  font-weight: var(--bf-weight-semibold);
  color: var(--bf-color-text-strong);
  margin-top: var(--bf-space-8);
  margin-bottom: var(--bf-space-3);
}
.ex-main h3 {
  font-size: var(--bf-text-base);
  font-weight: var(--bf-weight-semibold);
  color: var(--bf-color-text-strong);
  margin-top: var(--bf-space-5);
  margin-bottom: var(--bf-space-2);
}
.ex-main p { color: var(--bf-color-text-muted); }

.ex-demo {
  padding: var(--bf-space-5);
  background-color: var(--bf-color-bg-base);
  border: 1px solid var(--bf-color-border-base);
  border-radius: var(--bf-radius-lg);
  margin: var(--bf-space-3) 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-3);
  align-items: center;
}
.ex-demo--column { flex-direction: column; align-items: stretch; }

.ex-code {
  background-color: #0f172a;
  color: #e2e8f0;
  padding: var(--bf-space-3) var(--bf-space-4);
  border-radius: var(--bf-radius-md);
  font-size: var(--bf-text-xs);
  font-family: var(--bf-font-mono);
  overflow-x: auto;
  margin: var(--bf-space-2) 0 var(--bf-space-5);
  position: relative;
}
.ex-code__copy {
  position: absolute;
  top: var(--bf-space-2);
  right: var(--bf-space-2);
  font-size: var(--bf-text-xs);
  background-color: rgb(255 255 255 / 0.1);
  color: white;
  border: 0;
  padding: var(--bf-space-1) var(--bf-space-2);
  border-radius: var(--bf-radius-sm);
  cursor: pointer;
}
.ex-code__copy:hover { background-color: rgb(255 255 255 / 0.2); }

.ex-toolbar {
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
  margin-bottom: var(--bf-space-4);
  flex-wrap: wrap;
}
.ex-toolbar__label {
  font-size: var(--bf-text-xs);
  color: var(--bf-color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--bf-tracking-wide);
  font-weight: var(--bf-weight-medium);
}
.ex-swatch-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: var(--bf-space-1);
}
.ex-swatch {
  aspect-ratio: 1;
  border-radius: var(--bf-radius-md);
  border: 1px solid var(--bf-color-border-muted);
  position: relative;
  display: grid;
  place-items: end center;
  padding: var(--bf-space-1);
  font-size: 10px;
  font-weight: var(--bf-weight-medium);
  color: var(--bf-color-text-muted);
}

.ex-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--bf-space-3);
}
.ex-grid-cards a {
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-2);
  padding: var(--bf-space-4);
  background-color: var(--bf-color-bg-base);
  border: 1px solid var(--bf-color-border-base);
  border-radius: var(--bf-radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--bf-duration-fast), box-shadow var(--bf-duration-fast);
}
.ex-grid-cards a:hover {
  border-color: var(--bf-color-primary-500);
  box-shadow: var(--bf-shadow-sm);
  text-decoration: none;
}
.ex-grid-cards a strong { color: var(--bf-color-text-strong); font-weight: var(--bf-weight-semibold); }
.ex-grid-cards a small  { color: var(--bf-color-text-muted); }

/* Sidebar collapse toggle. The button is fixed-positioned so it can sit on
 * the boundary between sidebar and main, and `left` flips between the two
 * states so it always rides the edge of the visible area. */
.ex-side__toggle {
  position: fixed;
  top: 76px;
  left: calc(240px - 12px);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bf-color-bg-base);
  border: 1px solid var(--bf-color-border-base);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--bf-color-text-muted);
  font-size: 10px;
  z-index: 50;
  padding: 0;
  box-shadow: var(--bf-shadow-xs, 0 1px 2px rgba(0,0,0,0.06));
  transition: left 0.15s ease, background-color 0.15s ease;
}
.ex-side__toggle:hover {
  background: var(--bf-color-surface-hover);
  color: var(--bf-color-text-strong);
}
.ex-side__toggle > i { transition: transform 0.15s ease; }

/* Collapsed (rail) state — sidebar shrinks to an icon-only column. Section
 * headings, link labels, and the brand text are hidden; icons stay centered.
 * The toggle slides to sit on the rail's right edge. */
[data-ex-collapsed="true"] .ex-shell-grid { grid-template-columns: 56px 1fr; }
[data-ex-collapsed="true"] .ex-side       { padding: var(--bf-space-2); overflow-x: hidden; }
[data-ex-collapsed="true"] .ex-side h2,
[data-ex-collapsed="true"] .ex-side a span,
[data-ex-collapsed="true"] .ex-side .ex-side__todo,
[data-ex-collapsed="true"] .ex-side__brand span { display: none; }
[data-ex-collapsed="true"] .ex-side a {
  justify-content: center;
  padding: var(--bf-space-2);
  font-size: var(--bf-text-base);
}
[data-ex-collapsed="true"] .ex-side__brand { justify-content: center; padding: var(--bf-space-2); }
[data-ex-collapsed="true"] .ex-side__toggle { left: calc(56px - 12px); }
[data-ex-collapsed="true"] .ex-side__toggle > i { transform: rotate(180deg); }

@media (max-width: 800px) {
  .ex-shell-grid { grid-template-columns: 1fr; }
  .ex-side { position: static; height: auto; }
  .ex-main { padding: var(--bf-space-4); }
  .ex-side__toggle { display: none; }
}
