/* Tech News JP — ミニマル＆高速 CSS */

:root {
  --primary: #0066cc;
  --primary-dark: #004499;
  --text: #1a1a1a;
  --text-muted: #666;
  --bg: #fff;
  --bg-alt: #f8f9fa;
  --border: #e0e0e0;
  --radius: 6px;
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e0e0e0;
    --text-muted: #999;
    --bg: #1a1a1a;
    --bg-alt: #252525;
    --border: #333;
    --primary: #4da3ff;
    --primary-dark: #80bdff;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* ── Header ── */
.site-header {
  border-bottom: 2px solid var(--primary);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav-link {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-link:hover, .nav-link.active { background: var(--bg-alt); color: var(--primary); }

/* ── Main ── */
main { padding: 1.5rem 0 3rem; }

.page-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
.category-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Category Section (Top page) ── */
.category-section { margin-bottom: 2.5rem; }
.category-heading {
  font-size: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.category-heading a { color: var(--text); text-decoration: none; }
.category-heading a:hover { color: var(--primary); }

/* ── Article Cards ── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.article-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.15s;
}
.article-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.article-card--list {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem 0;
}

.article-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.article-title { font-size: 1rem; line-height: 1.4; margin-bottom: 0.5rem; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--primary); }
.article-summary { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.5rem; }
.article-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 1rem; }
.article-date, .article-source { color: var(--text-muted); }

.more-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ── Article Full ── */
.article-full { max-width: 740px; }
.article-header { margin-bottom: 2rem; }
.article-category-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.article-title--full { font-size: 1.6rem; line-height: 1.35; margin-bottom: 0.75rem; }

.article-body { font-size: 1rem; line-height: 1.8; }
.article-body h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.article-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin: 0.5rem 0 1rem 1.5rem; }
.article-body pre { background: var(--bg-alt); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin: 1rem 0; font-size: 0.85rem; }
.article-body code { background: var(--bg-alt); padding: 0.15em 0.35em; border-radius: 3px; font-size: 0.9em; }
.article-body pre code { background: none; padding: 0; }
.article-body blockquote { border-left: 3px solid var(--primary); padding-left: 1rem; color: var(--text-muted); margin: 1rem 0; }
.article-body a { color: var(--primary); }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); }

.article-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
.source-link a { color: var(--primary); }
.disclaimer { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; font-style: italic; }

.article-nav { margin-top: 1.5rem; }
.back-link { color: var(--primary); text-decoration: none; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.page-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.page-info { color: var(--text-muted); font-size: 0.9rem; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
.footer-note { font-size: 0.75rem; margin-top: 0.25rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .article-title--full { font-size: 1.3rem; }
  .site-header .container { gap: 0.75rem; }
}
