/* Ittela - Main Stylesheet */
/* Based on Our World in Data style with Pakistan Green accent */

:root {
  /* Colors from CLAUDE.md */
  --pakistan-green: #01411C;
  --blue: #2563EB;
  --red: #DC2626;
  --amber: #F59E0B;
  --gray-400: #9CA3AF;
  --gray-200: #E5E7EB;
  --white: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --background: #FAFAFA;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--background);
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pakistan-green);
  text-decoration: none;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.site-nav a:hover {
  color: var(--pakistan-green);
}

/* Article Header */
.article-header {
  padding: 3rem 0 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.article-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.article-byline {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Key Takeaways Box */
.key-takeaways {
  background: #F0FDF4;
  border-left: 4px solid var(--pakistan-green);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.key-takeaways h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pakistan-green);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-takeaways ul {
  list-style: none;
  padding: 0;
}

.key-takeaways li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.key-takeaways li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  background: var(--pakistan-green);
  border-radius: 50%;
}

/* Article Content */
.article-content {
  padding: 2rem 0;
  background: var(--white);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

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

.article-content li {
  margin-bottom: 0.5rem;
}

/* Source References */
.source-ref {
  color: var(--blue);
  cursor: pointer;
  font-size: 0.75rem;
  vertical-align: super;
  text-decoration: none;
}

.source-ref:hover {
  text-decoration: underline;
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.article-content th {
  background: var(--gray-200);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--gray-400);
}

.article-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.article-content tr:hover {
  background: #F9FAFB;
}

/* Charts */
.chart-container {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.chart-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.chart-source {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
}

/* What the Data Cannot Tell Us */
.data-limitations {
  background: #FFFBEB;
  border-left: 4px solid var(--amber);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.data-limitations h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.data-limitations h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #92400E;
  margin: 1rem 0 0.5rem;
}

.data-limitations p {
  font-size: 0.95rem;
  color: #78350F;
}

/* Data Notes */
.data-notes {
  background: #F9FAFB;
  padding: 2rem;
  margin-top: 3rem;
  border-radius: 8px;
}

.data-notes h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.data-notes ol {
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.data-notes li {
  margin-bottom: 0.75rem;
}

.data-notes a {
  color: var(--blue);
  text-decoration: none;
}

.data-notes a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: var(--text-primary);
  color: var(--white);
  padding: 3rem 0;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--gray-200);
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  color: var(--gray-400);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 640px) {
  .article-header h1 {
    font-size: 1.75rem;
  }

  .container {
    padding: 0 1rem;
  }

  .chart-container {
    padding: 1rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}
