/* Shared article page styles — practical, high-contrast, readable */
@import url('fonts/fonts.css');

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

:root {
  --bg: #111113;
  --bg-raised: #1a1a1d;
  --bg-hover: #222225;
  --text: #ededef;
  --text-body: #cdcdcf;
  --text-dim: #9a9a9e;
  --text-muted: #6a6a6e;
  --accent: #c8b8a2;
  --accent-dim: #a69882;
  --border: #2a2a2e;
  --border-light: #3a3a3e;
}

html { scroll-behavior: smooth; font-size: 17px; }

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

::selection { background: var(--accent); color: var(--bg); }

/* --- NAV --- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.2rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(17, 17, 19, 0.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--border); }
.nav-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.nav-logo .logo-dots { flex-shrink: 0; }
.nav-logo .logo-text { font-size: 0.95rem; font-weight: 500; letter-spacing: 0.08em; }
.nav-logo .logo-varjo { color: var(--text); }
.nav-logo .logo-soft { color: var(--text-muted); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.82rem; color: var(--text-dim); text-decoration: none; letter-spacing: 0.04em; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: none; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; padding: 0.25rem; }

/* --- LAYOUT --- */
.container { max-width: 680px; margin: 0 auto; padding: 0 2rem; }

/* --- ARTICLE HEADER --- */
.article-header {
  padding: 9rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.article-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.article-header h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 1rem;
}
.article-header .lede {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* --- ARTICLE BODY --- */
article { padding: 3rem 0 4rem; }

article p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
article strong { color: var(--text); font-weight: 500; }
article a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  transition: border-color 0.2s;
}
article a:hover { border-color: var(--accent); }

/* Headings: clear hierarchy, not decorative */
article h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 3rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
article h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.8rem;
}

article ol, article ul {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
article li { margin-bottom: 0.4rem; }

article code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  background: var(--bg-raised);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}
article pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}
article pre code { background: none; padding: 0; color: var(--text-body); }

article table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 1.5rem; font-size: 0.9rem;
}
article th {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
  text-align: left; padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border-light);
}
article td {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.95rem; color: var(--text-body);
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border);
}
article td strong { color: var(--text); }
article tr:last-child td { border-bottom: none; }

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

/* --- RELATED LINKS --- */
.article-links {
  padding: 2rem 0 4rem; border-top: 1px solid var(--border);
  display: flex; gap: 1.2rem; flex-wrap: wrap;
}
.article-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.2rem; border: 1px solid var(--border-light); border-radius: 4px;
  text-decoration: none; color: var(--text-dim); font-size: 0.88rem; transition: all 0.2s;
}
.article-link:hover { border-color: var(--text-dim); color: var(--text); }

/* --- FOOTER --- */
footer { border-top: 1px solid var(--border); padding: 2.5rem 2rem; text-align: center; }
footer p { font-size: 0.78rem; color: var(--text-muted); }
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text-dim); }

/* --- COMMENTS --- */
.comments-heading { font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin: 3rem 0 1.2rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.comments-list { margin-bottom: 2rem; }
.comments-empty { color: var(--text-muted); font-size: 0.88rem; }
.comment-card { background: var(--bg-raised); border: 1px solid var(--border); padding: 1rem 1.2rem; margin-bottom: 0.5rem; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; }
.comment-author { font-size: 0.82rem; color: var(--text); font-weight: 500; }
.comment-date { font-size: 0.72rem; color: var(--text-muted); }
.comment-body { font-size: 0.88rem; color: var(--text-body); line-height: 1.6; white-space: pre-wrap; }
.comment-form { margin-top: 1.5rem; }
.comment-input, .comment-textarea { width: 100%; padding: 0.6rem 0.8rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: 'Inter', sans-serif; font-size: 0.88rem; margin-bottom: 0.5rem; outline: none; }
.comment-input:focus, .comment-textarea:focus { border-color: var(--border-light); }
.comment-textarea { resize: vertical; min-height: 80px; }
.comment-form-footer { display: flex; justify-content: space-between; align-items: center; }
.comment-note { font-size: 0.72rem; color: var(--text-muted); }
.comment-submit { padding: 0.5rem 1.2rem; background: var(--bg-raised); border: 1px solid var(--border-light); color: var(--text-dim); font-family: 'Inter', sans-serif; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.comment-submit:hover { border-color: var(--text-dim); color: var(--text); }
.comment-submit:disabled { opacity: 0.4; cursor: default; }
.comment-status { font-size: 0.78rem; margin-top: 0.5rem; }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; right: 1rem; background: var(--bg-raised); border: 1px solid var(--border); padding: 1rem 1.5rem; flex-direction: column; gap: 0.8rem; }
  .nav-links.open { display: flex; }
  .container { padding: 0 1.25rem; }
  .article-links { flex-direction: column; }
  article table { font-size: 0.82rem; }
  article th, article td { padding: 0.45rem 0.5rem; }
}
