/**
 * detail.css — Signal Desk article (split rail + left-aligned prose)
 */

: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-rail: 280px;
  --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--article {
  font-family: var(--sx-font-ui);
  background: var(--sx-bg);
  color: var(--sx-ink);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

.sx-card-link { text-decoration: none; color: inherit; display: block; }

/* Shared chrome */
.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.02em;
  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);
  border-bottom: 2px solid transparent;
}

.sx-nav a:hover { color: var(--sx-cobalt); border-bottom-color: var(--sx-accent); }

.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.4rem 0.85rem;
  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.85rem;
  font-weight: 700;
  cursor: pointer;
}

.sx-read-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--sx-accent), var(--sx-cobalt));
  z-index: 300;
  transition: width 0.08s linear;
}

.sx-crumb {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  font-family: var(--sx-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--sx-border);
  background: linear-gradient(90deg, #E0F2FE, #F0F9FF);
}

.sx-crumb a {
  color: var(--sx-cobalt);
  text-decoration: none;
  font-weight: 600;
}

.sx-crumb a:hover { text-decoration: underline; }

.sx-crumb span:last-child {
  color: var(--sx-muted);
  max-width: 50ch;
  display: inline-block;
  vertical-align: bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Split layout */
.sx-article-layout {
  max-width: var(--sx-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: var(--sx-rail) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.sx-article-rail {
  position: sticky;
  top: 1rem;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
  background: var(--sx-surface);
  padding: 1.15rem;
}

.sx-rail-tag {
  display: inline-block;
  font-family: var(--sx-font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sx-accent);
  border: 1px solid var(--sx-accent);
  padding: 0.2rem 0.45rem;
  margin-bottom: 0.75rem;
}

.sx-rail-title {
  font-family: var(--sx-font-display);
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--sx-border-strong);
}

.sx-rail-meta {
  list-style: none;
  font-family: var(--sx-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.sx-rail-meta li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(13, 13, 13, 0.08);
}

.sx-rail-meta li:last-child { border-bottom: none; }

.sx-rail-meta strong {
  display: block;
  color: var(--sx-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.sx-article-main { min-width: 0; }

.sx-article-head {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--sx-border);
}

.sx-article-head h1 {
  font-family: var(--sx-font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  font-weight: 700;
  text-align: left;
  margin-bottom: 0;
}

.sx-article-figure {
  margin: 0 0 1.75rem;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #ddd;
}

.sx-article-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sx-article-body {
  font-family: var(--sx-font-display);
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--sx-ink);
}

.sx-article-body p { margin-bottom: 1.25rem; }

.sx-lede-mark::first-line {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sx-lede-mark::before {
  content: '▌';
  color: var(--sx-accent);
  font-family: var(--sx-font-mono);
  margin-right: 0.35rem;
}

.sx-article-foot {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
  background: linear-gradient(135deg, #FEF9C3 0%, #E0F2FE 100%);
  font-family: var(--sx-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.sx-tag {
  font-family: var(--sx-font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--sx-cobalt);
  text-transform: uppercase;
}

.sx-meta {
  font-family: var(--sx-font-mono);
  font-size: 0.68rem;
  color: var(--sx-muted);
}

/* More block */
.sx-more-block {
  border-top: 1px solid var(--sx-border);
  background: linear-gradient(180deg, #F0F9FF 0%, var(--sx-surface) 100%);
  padding: 2rem 1.25rem 2.5rem;
}

.sx-more-block__head {
  max-width: var(--sx-max);
  margin: 0 auto 1.25rem;
}

.sx-more-block__head h2 {
  font-family: var(--sx-font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sx-more-list {
  max-width: var(--sx-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius);
  box-shadow: var(--sx-shadow-sm);
}

.sx-more-item {
  border-right: 1px solid var(--sx-border);
  padding: 1rem;
}

.sx-more-item:last-child { border-right: none; }

.sx-more-item:hover { background: var(--sx-bg); }

.sx-more-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border: 1px solid var(--sx-border);
  margin-bottom: 0.65rem;
}

.sx-more-item h3 {
  font-family: var(--sx-font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0.25rem 0;
}

/* Search + footer (shared) */
.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);
}

.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: 900px) {
  .sx-article-layout { grid-template-columns: 1fr; }
  .sx-article-rail { position: static; }
  .sx-more-list { grid-template-columns: 1fr; }
  .sx-more-item { border-right: none; border-bottom: 1px solid var(--sx-border); }
  .sx-more-item:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  body.sx-body--article {
    --sx-mobile-screen: min(100dvh, 100vh);
  }

  .sx-article-main > .sx-ad-slot {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .sx-article-body .sx-ad-slot {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .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;
    padding: 0.75rem 0;
  }
  .sx-nav.is-open { display: flex; }
  .sx-footer__legal {
    padding: 0.55rem 1rem;
    font-size: 0.62rem;
  }
}
