/* 自治体新着情報ダッシュボード — Transparently デザイン準拠
   トークンは quake.transparently.jp / portal.css と共通 */

:root {
  --brand: #f04e4b;
  --brand-dark: #d43c39;
  --ink: #222;
  --ink-soft: #555;
  --ink-faint: #888;
  --line: #e3e3e3;
  --line-soft: #ececec;
  --paper: #ffffff;
  --paper-tint: #faf9f8;
  --paper-deep: #f4f3f2;
  --radius: 6px;
  --maxw: 1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper-tint);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: "JetBrains Mono", monospace; }

/* ================= ヘッダー ================= */
.site-header {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}
.brand img { height: 26px; width: auto; display: block; }
.site-catch {
  flex: 1 1 auto;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions { flex: 0 0 auto; }
.update-note { font-size: 12px; color: var(--ink-faint); white-space: nowrap; }

/* ================= レイアウト ================= */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* ================= フィルタバー ================= */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.filter-label { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
#source-select,
#category-select {
  font-family: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  max-width: 200px;
}
#source-select:hover,
#category-select:hover { border-color: var(--ink-faint); }
#search-input {
  font-family: inherit;
  font-size: 13px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  width: 240px;
}
#search-input:focus { outline: none; border-color: var(--brand); }
.unread-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.unread-toggle input { accent-color: var(--brand); margin: 0; }
.ghost-btn {
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper); color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ================= タイル ================= */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.tile-label { font-size: 12px; color: var(--ink-faint); margin-bottom: 2px; }
.tile-value { font-size: 24px; font-weight: 500; line-height: 1.4; }

/* ================= メイン2カラム ================= */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand);
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.side-col { display: flex; flex-direction: column; gap: 14px; }

/* ================= 新着リスト ================= */
.list-box { padding: 14px 16px; }
.list-note { font-size: 12px; color: var(--ink-faint); }
.item-list { display: flex; flex-direction: column; }
.empty-state {
  color: var(--ink-faint);
  text-align: center;
  padding: 40px 0;
  margin: 0;
}
.item-card {
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.item-card:last-child { border-bottom: none; }
/* 既読でも見た目は変えない（NEWバッジと未読フィルタだけで区別する） */
.item-meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.item-date { font-family: "JetBrains Mono", monospace; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}
.badge.new {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.badge.category { background: var(--paper-deep); border-color: var(--paper-deep); }
.item-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}
.item-title a:hover { color: var(--brand); }
.item-summary {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================= 収集状況 ================= */
.status-box { padding: 14px 16px; }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.status-list li:last-child { border-bottom: none; }
.status-list li.group-end { border-bottom: none; }
.status-list li.group-gap {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dotted var(--ink-faint);
}
.status-list li.no-feed .status-name,
.status-list li.no-feed .status-time { color: #bbb; }
.status-dot.none { background: #d5d5d5; }
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  flex: 0 0 auto;
}
.status-dot.ok { background: #3d9e60; }
.status-dot.ng { background: var(--brand); }
.status-name { flex: 1 1 auto; }
.status-time { font-size: 12px; color: var(--ink-faint); font-family: "JetBrains Mono", monospace; }

/* ================= ノート ================= */
.note-box { padding: 14px 16px; }
.note-box p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.9;
}
.note-box .note-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ================= フッター ================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 16px 0;
  margin-top: 8px;
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 20px;
  font-size: 13px; color: var(--ink-faint);
}
.footer-copy { font-family: "JetBrains Mono", monospace; }

/* ================= レスポンシブ ================= */
@media (max-width: 960px) {
  .site-catch { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  #search-input { width: 100%; }
}
