/* ========================================
   Web3 News Wire - Minimal / Modern / Avant-garde
   ======================================== */

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

/* --- Theme --- */
:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --text: #0A0A0A;
  --text-2: #525252;
  --text-3: #A3A3A3;
  --accent: #0000FF;
  --accent-hover: #4D4DFF;
  --border: #E5E5E5;
  --tag-bg: #F3F4F6;
  --tag-text: #374151;
  --code-bg: #F5F5F4;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
  --max-w: 740px;
  --transition: 0.25s ease;
}

[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #171717;
  --text: #EDEDED;
  --text-2: #A3A3A3;
  --text-3: #6B6B6B;
  --accent: #4D4DFF;
  --accent-hover: #6B6BFF;
  --border: #262626;
  --tag-bg: #1E1E1E;
  --tag-text: #D4D4D4;
  --code-bg: #1E1E1E;
}

/* --- Base --- */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* --- Accent bar (top) --- */
.accent-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
}

/* --- Header --- */
.site-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.site-title {
  display: flex;
  align-items: center;
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-decoration: none;
  color: var(--text);
  transition: color var(--transition);
  gap: 0;
}

.site-logo {
  width: 0.9em;
  height: 0.9em;
  position: relative;
  top: 0;
  margin-left: -12px;
  margin-right: -0.1em;
  flex-shrink: 0;
}

.site-title:hover {
  color: var(--text);
}

.site-tagline {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 1.0rem;
  letter-spacing: 0.02em;
}

.site-tagline a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}

.site-tagline a:hover {
  color: var(--accent-hover);
}

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Main container --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* --- Date group --- */
.date-group {
  margin-bottom: 4rem;
}

.date-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 2rem;
}

.date-group--latest .date-label {
  border-bottom-color: var(--accent);
}

.date-text {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.date-count {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
}

/* --- Article card --- */
.article-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.article-card.has-thumbnail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.article-thumbnail {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 16 / 9;
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-thumbnail:hover img {
  transform: scale(1.03);
}

.article-card:last-child {
  border-bottom: none;
}

.article-card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.article-card h2 a {
  text-decoration: none;
  transition: color var(--transition);
}

.article-card h2 a:hover {
  color: var(--accent);
}

.article-meta, .article-meta-full {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.35rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.meta-sep { opacity: 0.5; }

.article-summary {
  margin-top: 0.6rem;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all var(--transition);
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* --- Article page --- */
.article-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-date-back {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.article-date-back a {
  text-decoration: none;
  transition: color var(--transition);
}

.article-date-back a:hover {
  color: var(--accent);
}

.article-hero {
  margin: 1.25rem 0 0;
  border-radius: 6px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.article-content h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.article-header .article-tags {
  margin-top: 1rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* --- Article body (prose) --- */
.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-body a:hover {
  color: var(--accent-hover);
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.35rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-2);
  font-style: italic;
  background: var(--code-bg);
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.article-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.article-body pre code {
  background: none;
  padding: 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.article-body hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5rem 0;
}

/* --- Footer --- */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-sep { opacity: 0.4; }

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.empty-state a {
  color: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .site-header { padding: 4rem 1.25rem 2rem; }
  .container { padding: 0 1.25rem 3rem; }
  .article-page { padding: 0 1.25rem 3rem; }
  .article-card h2 { font-size: 1.15rem; }
  .article-card.has-thumbnail {
    grid-template-columns: 1fr;
  }
  .article-thumbnail {
    aspect-ratio: 16 / 9;
  }
  .date-label { flex-direction: column; gap: 0.25rem; }
  .header-row { position: relative; }
  .theme-toggle { position: absolute; top: 0; right: 0; }
  .tagline-sep { display: none; }
  .tagline-author { display: block; margin-top: 0.25rem; }
}
