/**
 * list.css — Signal Desk archive (typographic index table)
 */

:root {
  --sx-bg: #F0F7FF;
  --sx-surface: #FFFFFF;
  --sx-ink: #1E3A5F;
  --sx-muted: #64748B;
  --sx-accent: #0EA5E9;
  --sx-cobalt: #2563EB;
  --sx-yellow: #FDE047;
  --sx-highlight: #E0F2FE;
  --sx-mint: #CCFBF1;
  --sx-border: #BFDBFE;
  --sx-border-strong: #7DD3FC;
  --sx-max: 1280px;
  --sx-radius: 14px;
  --sx-shadow-sm: 0 4px 18px rgba(14, 116, 178, 0.08);
  --sx-font-ui: 'Outfit', system-ui, sans-serif;
  --sx-font-display: 'Libre Baskerville', Georgia, serif;
  --sx-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.sx-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

body.sx-body--archive {
  font-family: var(--sx-font-ui);
  background: var(--sx-bg);
  color: var(--sx-ink);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

.sx-card-link { text-decoration: none; color: inherit; display: block; }

/* Topbar (shared pattern) */
.sx-topbar {
  position: relative;
  z-index: 200;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  color: var(--sx-ink);
  border-bottom: 1px solid var(--sx-border);
  box-shadow: var(--sx-shadow-sm);
}

.sx-topbar__row {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sx-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  margin-right: auto;
}

.sx-brand__name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sx-cobalt);
}

.sx-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.sx-search-toggle,
.sx-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--sx-border-strong);
  border-radius: 10px;
  background: var(--sx-highlight);
  color: var(--sx-ink);
  cursor: pointer;
}

.sx-menu-btn { display: none; }

.sx-search-drawer {
  display: none;
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 0 1.25rem 0.6rem;
  border-top: 1px solid var(--sx-border);
  background: rgba(255, 255, 255, 0.95);
}

.sx-search-drawer.is-open { display: block; }

.sx-search-drawer .sx-search {
  width: 100%;
  min-width: 0;
}

.sx-search-drawer .sx-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.65rem;
}

.sx-menu-btn__lines {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--sx-ink);
  margin: 0 auto;
  box-shadow: 0 6px 0 var(--sx-ink), 0 -6px 0 var(--sx-ink);
}

.sx-nav a {
  text-decoration: none;
  color: var(--sx-muted);
}

.sx-nav a:hover,
.sx-nav a[aria-current="page"] {
  color: var(--sx-cobalt);
}

.sx-search {
  display: flex;
  background: var(--sx-surface);
  border: 1px solid var(--sx-border-strong);
  border-radius: 999px;
  min-width: 180px;
  overflow: hidden;
}

.sx-search input {
  border: none;
  background: transparent;
  color: var(--sx-ink);
  flex: 1;
  padding: 0.35rem 0.65rem;
  font-family: var(--sx-font-mono);
  font-size: 0.78rem;
  outline: none;
}

.sx-search button {
  border: none;
  background: linear-gradient(135deg, var(--sx-accent), var(--sx-cobalt));
  color: #fff;
  padding: 0 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* Archive hero — typographic + feature strip */
.sx-archive-hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  border-bottom: 1px solid var(--sx-border);
  background: linear-gradient(180deg, var(--sx-surface) 0%, #F0F9FF 100%);
}

.sx-archive-hero__inner {
  padding: 2.5rem 1.25rem 2.5rem max(1.25rem, calc((100vw - var(--sx-max)) / 2 + 1.25rem));
}

.sx-archive-hero__code {
  font-family: var(--sx-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--sx-accent);
  margin-bottom: 0.65rem;
}

.sx-archive-hero h1 {
  font-family: var(--sx-font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.sx-archive-hero__sub {
  font-size: 1rem;
  color: var(--sx-muted);
  max-width: 36em;
}

.sx-archive-hero__visual {
  border-left: 1px solid var(--sx-border);
  min-height: 220px;
  background: linear-gradient(180deg, #E0F2FE 0%, #BAE6FD 100%);
  overflow: hidden;
}

.sx-archive-hero__visual .sx-card-link {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
}

.sx-archive-hero__visual img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  filter: grayscale(20%);
}

.sx-archive-hero__visual__cap {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--sx-ink);
  font-size: 0.78rem;
  line-height: 1.35;
  border-top: 1px solid var(--sx-border);
}

.sx-archive-hero__visual__cap .sx-tag {
  color: var(--sx-cobalt);
  display: block;
  margin-bottom: 0.25rem;
}

/* Archive table */
.sx-archive-main {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.sx-archive-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--sx-border);
}

.sx-archive-toolbar__count {
  font-family: var(--sx-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-muted);
}

.sx-archive-table {
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
  background: var(--sx-surface);
}

.sx-archive-row {
  display: grid;
  grid-template-columns: 3.5rem 120px 1fr 140px;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(13, 13, 13, 0.1);
  transition: background 0.12s;
}

.sx-archive-row:last-child { border-bottom: none; }

.sx-archive-row:hover { background: var(--sx-highlight); }

.sx-archive-row__idx {
  font-family: var(--sx-font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sx-cobalt);
}

.sx-archive-row__thumb img {
  width: 120px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
}

.sx-archive-row__title h2 {
  font-family: var(--sx-font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0.2rem 0;
}

.sx-tag {
  font-family: var(--sx-font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sx-accent);
  text-transform: uppercase;
}

.sx-meta {
  font-family: var(--sx-font-mono);
  font-size: 0.65rem;
  color: var(--sx-muted);
}

.sx-archive-row__date {
  font-family: var(--sx-font-mono);
  font-size: 0.68rem;
  text-align: right;
  color: var(--sx-muted);
}

/* Search */
.sx-search-panel {
  max-width: var(--sx-max);
  margin: 1rem auto;
  padding: 0 1.25rem;
}

.sx-search-hit {
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
  background: var(--sx-surface);
  margin-bottom: 0.65rem;
}

.sx-search-hit .sx-card-link {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.85rem;
  padding: 0.65rem;
}

.sx-empty {
  text-align: center;
  padding: 2rem;
  font-family: var(--sx-font-mono);
  color: var(--sx-muted);
}

/* Footer */
.sx-footer {
  border-top: 1px solid var(--sx-border);
  background: linear-gradient(90deg, #E0F2FE 0%, #F0F9FF 50%, #E0F2FE 100%);
}

.sx-footer__legal {
  max-width: var(--sx-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 1.25rem;
  font-family: var(--sx-font-mono);
  font-size: 0.68rem;
  color: var(--sx-muted);
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sx-footer__legal a {
  color: var(--sx-ink);
  text-decoration: none;
  flex-shrink: 0;
}

.sx-footer__legal a:hover {
  color: var(--sx-accent);
  text-decoration: underline;
}

.sx-footer__sep {
  opacity: 0.45;
  flex-shrink: 0;
  user-select: none;
}

.sx-footer__note { opacity: 0.65; flex-shrink: 0; }

@media (max-width: 960px) {
  .sx-archive-hero { grid-template-columns: 1fr; }
  .sx-archive-hero__visual { border-left: none; border-top: 1px solid var(--sx-border); }
  .sx-archive-row { grid-template-columns: 3rem 90px 1fr; }
  .sx-archive-row__date { display: none; }
  .sx-archive-row__thumb img { width: 90px; height: 60px; }
}

@media (max-width: 768px) {
  .sx-topbar__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions";
    gap: 0.55rem;
  }

  .sx-brand { margin-right: 0; min-width: 0; }
  .sx-header-actions { grid-area: actions; }
  .sx-menu-btn { display: flex; }
  .sx-nav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: column;
  }
  .sx-nav.is-open { display: flex; }
  .sx-archive-row { grid-template-columns: 1fr; }
  .sx-archive-row__idx { display: none; }
  .sx-archive-row__thumb img { width: 100%; height: 160px; }
  .sx-footer__legal {
    padding: 0.55rem 1rem;
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sx-archive-row { transition: none; }
}
