/* ========================================
   Evipedia — Clean, minimal typography
   Wikipedia-inspired evidence review site
   ======================================== */

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text: #202122;
  --text-light: #54595d;
  --bg: #ffffff;
  --bg-muted: #f8f9fa;
  --border: #a2a9b1;
  --border-light: #e0e0e0;
  --link: #2563eb;
  --link-visited: #2563eb;
  --link-hover: #3b82f6;
  --accent: #1a73e8;
  --max-width: 960px;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 0;
  margin-bottom: 2.5rem;
}

.site-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  color: #000;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline;
}

.site-logo {
  height: 1.8rem;
  width: auto;
}

.site-title:visited {
  color: #000;
}

.site-title:hover {
  color: #000;
}

.site-version {
  font-size: 0.875rem;
  color: #c0c0c0;
  font-style: italic;
  margin-left: 0.15rem;
}

.site-tagline {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Homepage hero header */
.site-header-home {
  padding: 3rem 0 2rem;
  margin-bottom: 2rem;
}

.site-header-home .container {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.site-header-home .site-title {
  font-size: 3rem;
}

.site-header-home .site-tagline {
  font-size: 1.1rem;
}

/* Search */
.search-box {
  width: 100%;
  max-width: 400px;
  margin-top: 0.75rem;
}

.search-box-inline {
  margin: 0 auto 1.5rem;
  text-align: center;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--link);
}

.search-box input::placeholder {
  color: #999;
}

.search-results {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.search-results li {
  padding: 0.5rem 0;
}

.search-results a {
  font-size: 1.1rem;
  font-weight: 500;
}

.search-no-results {
  color: var(--text-light);
  font-style: italic;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 0;
  margin-top: 4rem;
  color: var(--text-light);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
}

.footer-links a:visited {
  color: var(--text-light);
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* Typography */
h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 1rem;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.75rem;
}

li {
  margin-bottom: 0.35rem;
}

li > ul, li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Bold & emphasis */
strong {
  font-weight: 600;
}

/* Blockquotes */
blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--text-light);
  background: var(--bg-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-muted);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.925rem;
}

th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-muted);
  font-weight: 600;
}

tr:hover {
  background: #fafbfc;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2rem 0;
}

/* ========================================
   Table of Contents
   ======================================== */
.toc {
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  max-width: 400px;
}

.toc h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  padding: 0;
  border: none;
}

.toc ol {
  margin: 0;
  padding-left: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.toc li {
  margin-bottom: 0.15rem;
}

.toc a {
  color: var(--link);
}

.toc a:visited {
  color: var(--link);
}

/* ========================================
   Review article
   ======================================== */
.review-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.review-body h1 + p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.review-body {
  line-height: 1.75;
}

.review-nav {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
}

/* ========================================
   Index page — review list
   ======================================== */
.page-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.letter-directory {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.letter-directory a {
  text-decoration: none;
}

.letter-directory a:hover {
  text-decoration: underline;
}

.review-letter {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.review-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 2rem;
}

@media (max-width: 640px) {
  .review-list {
    grid-template-columns: 1fr;
  }
}

.review-list li {
  padding: 0.4rem 0;
}

.review-list a {
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
}

.review-list a:hover {
  text-decoration: underline;
}

.review-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.25rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .toc {
    max-width: 100%;
  }
}
