/* preview-hub.css — neutral chrome for the multi-site hub.
 *
 * Safe default: the frame and bar are HIDDEN until JS opts in. The frame
 * needs .ssh-app (a site is open); the bar needs .ssh-ready (JS is on) —
 * it persists across list and view modes so the controls never relocate.
 * Without JS, the <noscript> link list is all that exists.
 * No transitions or animations anywhere: a site swap is a load, not a
 * flourish, and it must never be animated (test_hub.py greps for it).
 */

:root {
  --ssh-bg: #0d0f12;
  --ssh-panel: #15181d;
  --ssh-line: #262b33;
  --ssh-text: #e8eaed;
  --ssh-muted: #9aa3af;
  --ssh-accent: #f5a623;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ssh-bg);
  color: var(--ssh-text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

body.ssh-ready { padding-bottom: 60px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.ssh-head {
  padding: 28px 20px 18px;
  border-bottom: 1px solid var(--ssh-line);
}

.ssh-head__eyebrow {
  margin: 0 0 6px;
  font: 600 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.14em;
  color: var(--ssh-accent);
}

.ssh-head__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Site list ──────────────────────────────────────────────────────── */
.ssh-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ssh-list ul { margin: 0; padding-left: 20px; }
.ssh-list a { color: var(--ssh-accent); }

.ssh-site {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--ssh-panel);
  border: 1px solid var(--ssh-line);
  border-radius: 10px;
  overflow: hidden;
  min-height: 72px;
}

.ssh-site__open {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--ssh-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ssh-site__open:hover { background: rgba(255, 255, 255, 0.04); }

.ssh-site__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ssh-site__name { font-weight: 600; }

.ssh-site__note {
  color: var(--ssh-muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ssh-site__thumb {
  width: 96px;
  align-self: center;
  object-fit: cover;
  display: block;
  border-left: 1px solid var(--ssh-line);
}

.ssh-site__visit {
  align-self: center;
  margin-right: 14px;
  padding: 8px 12px;
  border: 1px solid var(--ssh-line);
  border-radius: 8px;
  color: var(--ssh-accent);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.ssh-site__visit:hover { border-color: var(--ssh-accent); }

/* ── Frame (only in app mode) ───────────────────────────────────────── */
.ssh-frame {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px;
  width: 100%;
  /* An iframe is a replaced element: with height:auto it falls back to its
     intrinsic 150px and `bottom` is ignored, leaving the site list showing
     through. The height has to be stated. 60px === .ssh-bar height. */
  height: calc(100vh - 60px);
  border: 0;
  background: #fff;
}

body.ssh-app .ssh-frame { display: block; }

/* ── Stepper bar (persists in list mode once JS is on) ────────────────
   3 columns (1fr auto 1fr): the design cluster sits in the exact middle,
   utilities hug the right, nothing on the left. */
.ssh-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  background: var(--ssh-panel);
  border-top: 1px solid var(--ssh-line);
}

body.ssh-ready .ssh-bar { display: grid; }

.ssh-bar__designs {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ssh-bar__side {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ssh-bar__step {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--ssh-line);
  border-radius: 8px;
  background: transparent;
  color: var(--ssh-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.ssh-bar__step:hover { border-color: var(--ssh-accent); }

/* One button per design, centered; the open design is highlighted. */
.ssh-bar__design {
  max-width: 180px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ssh-line);
  border-radius: 8px;
  background: transparent;
  color: var(--ssh-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ssh-bar__design:hover { border-color: var(--ssh-accent); }

.ssh-bar__design[aria-current="true"] {
  border-color: var(--ssh-accent);
  background: rgba(245, 166, 35, 0.12);
  color: var(--ssh-accent);
}

.ssh-bar__visit {
  padding: 8px 12px;
  border: 1px solid var(--ssh-line);
  border-radius: 8px;
  color: var(--ssh-accent);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.ssh-bar__visit:hover { border-color: var(--ssh-accent); }

@media (max-width: 640px) {
  .ssh-bar { padding: 0 8px; }
  .ssh-bar__designs, .ssh-bar__side { gap: 6px; }
  .ssh-bar__design { max-width: 96px; padding: 0 8px; font-size: 13px; }
  .ssh-bar__step { min-width: 36px; padding: 0 8px; }
}