/* ==========================================================================
   K04 Layout, Bento & App Shells — page styles (kit/layout.html)
   ========================================================================== */

/* Section headings: tighter bottom margins than the default .kit-h2 */
.layout-h2--grid {
  margin-bottom: 16px;
}

.kit-h2--tight {
  margin-bottom: 8px;
}

.layout-intro {
  max-width: 64ch;
  margin: 0 0 20px;
  color: var(--ink-2);
}

.layout-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* Grid demo -------------------------------------------------------------- */
.grid-demos {
  display: grid;
  gap: 14px;
}

.grid-demo {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.grid-demo__spec {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.grid-demo__spec b {
  color: var(--ink);
}

/* Column count comes from --cols on the element */
.grid-demo__cols {
  display: grid;
  grid-template-columns: repeat(var(--cols, 12), 1fr);
  align-items: stretch;
  gap: 8px;
  height: 56px;
  padding: 0 8px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
}

.grid-demo__cols span {
  border-right: 1px solid var(--action);
  border-left: 1px solid var(--action);
  background: var(--action-tint);
  opacity: .9;
}

/* Spacing scale (boxes drawn at half size via --size) -------------------- */
.space-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  margin-top: 24px;
}

.space-scale__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.space-scale__box {
  width: var(--size);
  height: var(--size);
  max-width: 80px;
  max-height: 80px;
  border-radius: 2px;
  background: var(--ink);
}

.space-scale__value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Bento ------------------------------------------------------------------ */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 120px;
  gap: 10px;
}

.bento__tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.bento__tile--hero {
  grid-column: span 2;
  grid-row: span 2;
  border: 0;
  background: var(--inverse);
  color: var(--on-inverse);
}

.bento__tile--wide {
  grid-column: span 2;
}

.bento__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.bento__tile--hero .bento__kicker {
  color: inherit;
  opacity: .75;
}

.bento__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.bento__metric {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
}

.bento__quote {
  font-size: 14px;
}

.bento__logos {
  display: flex;
  gap: 4px;
}

.bento__logos span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-3);
}

.bento__link {
  font-weight: 600;
}

.layout-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
}

.layout-rule {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* App shell wireframe (rendered in After Hours via data-theme) ----------- */
.app-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 240px;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--canvas);
  color: var(--ink);
  box-shadow: var(--shadow-frame);
  font-size: 13px;
}

.app-shell__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.app-shell__label--pad {
  padding: 4px 8px;
}

.app-shell__sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.app-shell__nav {
  padding: 6px 8px;
  border-radius: 6px;
}

.app-shell__nav--active {
  background: var(--surface-3);
}

.app-shell__main {
  display: flex;
  flex-direction: column;
}

.app-shell__topbar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.app-shell__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
}

.app-shell__inspector {
  padding: 14px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

/* Skeleton rows; bar width via --w */
.shell-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  border-bottom: 1px solid var(--line);
}

.shell-row__check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
}

.shell-row__bar {
  width: var(--w);
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
}

/* Other shell types */
.shell-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px;
  margin-top: 14px;
}

.shell-type {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 14px;
}
