/* Vísindi — Icelandic Science News */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap');

:root {
  --bg: #0c0c0f;
  --bg-card: #15151a;
  --bg-hover: #1c1c24;
  --border: #2a2a35;
  --text: #e0e0e6;
  --text-muted: #888894;
  --accent-longlifi: #00d68f;
  --accent-laekni: #4ea8de;
  --accent-geim: #c084fc;
  --accent-default: #f59e0b;
  --max-width: 1200px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: rgba(12, 12, 15, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent-default); }

nav { display: flex; gap: 8px; }
nav a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  color: var(--text);
  background: var(--bg-hover);
}

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -1px;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Category tabs */
.category-tabs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 32px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
}
.tab:hover { border-color: var(--text-muted); color: var(--text); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab[data-cat="langlifi"].active { background: var(--accent-longlifi); border-color: var(--accent-longlifi); }
.tab[data-cat="laeknivisindi"].active { background: var(--accent-laekni); border-color: var(--accent-laekni); }
.tab[data-cat="geimvisindi"].active { background: var(--accent-geim); border-color: var(--accent-geim); }
.tab[data-cat="tolvur"].active { background: var(--accent-default); border-color: var(--accent-default); }
.tab[data-cat="gervigreind"].active { background: #ec4899; border-color: #ec4899; }

/* Article grid */
.articles-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
}
.article-card:hover {
  border-color: #444;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.article-card .card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.article-card .card-body { padding: 20px; }
.article-card .card-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.card-cat.langlifi { background: rgba(0,214,143,0.15); color: var(--accent-longlifi); }
.card-cat.laeknivisindi { background: rgba(78,168,222,0.15); color: var(--accent-laekni); }
.card-cat.geimvisindi { background: rgba(192,132,252,0.15); color: var(--accent-geim); }
.card-cat.tolvur { background: rgba(245,158,11,0.15); color: var(--accent-default); }
.card-cat.gervigreind { background: rgba(236,72,153,0.15); color: #ec4899; }

.article-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.article-card .card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .card-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }

/* Article page */
.article-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.article-page .article-cat {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.article-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.article-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.article-hero-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 32px;
  max-height: 420px;
  object-fit: cover;
}
.article-content {
  font-size: 17px;
  line-height: 1.85;
}
.article-content p { margin-bottom: 20px; }
.article-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 16px;
}
.article-content strong { color: #fff; }
.article-source {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.article-source a { color: var(--accent-default); }
.article-source a:hover { text-decoration: underline; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
  }
  nav.open { display: flex; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-page h1 { font-size: 26px; }
  .article-content { font-size: 16px; }
}
