/* room-sable.css — Sable room demonstrated using Sable's 8 components */

.sable-room {
  --accent:      #475569;
  --accent-soft: #E6E9ED;
  --accent-ink:  #1E2A38;
  background: var(--paper);
  min-height: 100vh;
}

[data-theme="dark"] .sable-room {
  --accent:      #94A3B8;
  --accent-soft: #1D232C;
  --accent-ink:  #CBD5E1;
}

.sb {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--s-5) var(--gutter);
}

.sb__head {
  margin-bottom: var(--s-5);
}
.sb__head h1 {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.sb__head .sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 6px;
  max-width: 56ch;
}

.sb__grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s-5);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--hairline);
  align-items: start;
}
.sb__grid--inline {
  grid-template-columns: 200px 1fr 1fr;
}
.sb__grid:last-child { border-bottom: 1px solid var(--hairline); }
.sb__grid .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sb__grid .meta .name { display: block; color: var(--ink); font-size: 12px; margin-bottom: 4px; font-weight: 600; }
.sb__grid .meta .props { color: var(--muted-2); font-size: 10px; line-height: 1.5; }

/* — Sable primitives — */

/* Button */
.sb-button {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--paper);
  border-radius: 4px;
  transition: opacity var(--ease);
}
.sb-button:hover { opacity: 0.88; }
.sb-button--ghost { background: transparent; color: var(--accent-ink); }
.sb-button--ghost:hover { background: var(--accent-soft); }

/* Input */
.sb-input {
  font-family: var(--mono);
  font-size: 12px;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color var(--ease);
}
.sb-input:focus { border-color: var(--accent); }

/* Select */
.sb-select {
  font-family: var(--mono);
  font-size: 12px;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  cursor: pointer;
}

/* FormField — label + input + error in one motion (the "phantom limb" the note mentions) */
.sb-formfield { display: grid; gap: 4px; }
.sb-formfield label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.sb-formfield .hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
}

/* Stack */
.sb-stack { display: grid; gap: var(--s-2); }
.sb-stack--row { grid-auto-flow: column; grid-auto-columns: min-content; gap: var(--s-2); }

/* Card */
.sb-card {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: var(--s-4);
  background: var(--paper);
  font-family: var(--mono);
}
.sb-card h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.sb-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Dialog (rendered inline as illustration) */
.sb-dialog {
  border: 1px solid var(--accent);
  background: var(--paper);
  border-radius: 6px;
  padding: var(--s-4);
  font-family: var(--mono);
  position: relative;
  box-shadow: 0 8px 24px -16px color-mix(in oklch, var(--accent) 50%, transparent);
}
.sb-dialog::before {
  content: 'dialog · open';
  position: absolute;
  top: -9px;
  left: 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper);
  padding: 0 6px;
  color: var(--accent-ink);
}
.sb-dialog h3 { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.sb-dialog p { font-size: 12px; color: var(--ink-soft); line-height: 1.55; margin-bottom: var(--s-3); }
.sb-dialog .row { display: flex; gap: 8px; justify-content: flex-end; }

/* Tabs */
.sb-tabs__bar {
  display: flex;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 0;
}
.sb-tabs__tab {
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  background: transparent;
}
.sb-tabs__tab[aria-selected="true"] {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}
.sb-tabs__panel {
  padding: var(--s-3) 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Table */
.sb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.sb-table th, .sb-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
}
.sb-table th {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--paper-2);
}

.sb__below {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-small);
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3);
  align-items: baseline;
}
.sb__below a { color: var(--ink-soft); border-bottom: 1px solid var(--hairline); }
.sb__below a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .sb__grid, .sb__grid--inline { grid-template-columns: 1fr; gap: var(--s-2); }
}
