/* ---------------------------------------------------------
   AI WIRE — design tokens
   Concept: 社内向けの「ニュース・ワイヤー(電信線)」
   夜間の管制室のような落ち着いたグラファイト系背景に、
   信号を示すブルーのパルスと、時系列をつなぐ縦のワイヤーライン。
--------------------------------------------------------- */
:root {
  --bg: #12151b;
  --panel: #1b2029;
  --panel-hover: #212733;
  --border: #262c38;
  --line: #2a3140;
  --text: #e7e9ee;
  --text-muted: #c9cede;
  --text-faint: #b3b9cc;
  --tag-color: #a3acc0;
  --accent: #4f7cff;
  --accent-soft: rgba(79, 124, 255, 0.14);
  --alert: #ffb347;
  --alert-soft: rgba(255, 179, 71, 0.16);

  --font-display: "Space Grotesk", "Hiragino Sans", sans-serif;
  --font-body: "Inter", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button { font-family: inherit; }

.app {
  display: grid;
  grid-template-columns: 272px 1fr;
  min-height: 100vh;
}

/* ---------------- Rail (left sidebar) ---------------- */

.rail {
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.wordmark span { color: var(--accent); }

.tagline {
  margin: 8px 0 28px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.meta {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.filters {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  flex: 1;
  overflow-y: auto;
}

.filter-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--tag-color);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.rail-bottom {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ---------------- Feed (main column) ---------------- */

.feed-wrap {
  padding: 40px 48px 80px;
  max-width: 760px;
}

.loading { color: var(--text-muted); font-size: 14px; }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.date-group {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--line);
  margin-bottom: 8px;
}
.date-group:last-child { border-left-color: transparent; }

.date-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 16px;
  padding-top: 2px;
  position: relative;
}
.date-heading::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line);
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover { background: var(--panel-hover); border-color: var(--accent); }

.card::before {
  content: "";
  position: absolute;
  left: -32.5px;
  top: 24px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.card.is-new::before { background: var(--accent); }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.badge-new {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--alert);
  background: var(--alert-soft);
  border-radius: 3px;
  padding: 2px 6px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 8px;
}

.card-summary {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.card-body {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
  white-space: pre-line;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--tag-color);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
}

.card-source {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
}
.card-source:hover { text-decoration: underline; }

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 16px;
  }
  .rail-top { display: flex; align-items: baseline; gap: 12px; }
  .tagline { display: none; }
  .filters { margin-top: 0; flex: none; width: 100%; }
  .rail-bottom { display: none; }
  .feed-wrap { padding: 28px 20px 60px; }
}

