/* Professional Typography & Layout Overrides */

/* Import professional font stack */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@400;700&display=swap');

/* Root typography — modern, professional */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
  font-size: 16px;
  line-height: 1.6;
  color: #2c3e50;
  background: #fafbfc;
}

/* Headings — professional serif-inspired via Merriweather */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #1a2332;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 16px;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  line-height: 1.3;
  margin-top: 32px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e8ebf0;
  padding-bottom: 8px;
}

h3 {
  font-size: 1.5rem;
  margin-top: 24px;
  margin-bottom: 12px;
}

h4 {
  font-size: 1.2rem;
  color: #3a4556;
}

h5, h6 {
  font-size: 1rem;
  color: #3a4556;
}

/* Page header styling */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 0;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header h1 {
  color: white;
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
}

header h2 {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  font-weight: 400;
  border: none;
  padding: 0;
  margin: 8px 0 0 0;
}

header #a-title {
  color: white;
  text-decoration: none;
}

header #a-title:hover {
  color: rgba(255,255,255,0.9);
}

/* Container layout — responsive max-width with padding */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 8px;
  }
}

/* Container layout with sidebar + content */
#main_content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  flex-shrink: 0;
}

.main-content {
  min-width: 0;
}

/* Navigation styling */
.site-nav {
  background: white;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: sticky;
  top: 20px;
}

.site-nav h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
  font-family: 'Merriweather', Georgia, serif;
  color: #1a2332;
}

.site-nav h4 {
  margin-top: 16px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #3a4556;
  font-family: 'Merriweather', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav > ul > li {
  margin-bottom: 6px;
}

.site-nav ul ul {
  margin-left: 16px;
  margin-top: 6px;
  padding-left: 0;
  border-left: 2px solid #e1e4e8;
  padding-left: 12px;
  margin-left: 0;
}

.site-nav ul ul li {
  margin-bottom: 4px;
  font-size: 13px;
}

.site-nav a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

.site-nav a:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Main content lists: explicit indentation so nested lists render with expected margin */
.main-content ul,
.main-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  list-style-position: outside;
}

.main-content ul ul,
.main-content ul ol,
.main-content ol ul,
.main-content ol ol {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

/* Code blocks */
code {
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  color: #d63384;
}

pre {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  color: #24292e;
  padding: 0;
  border-radius: 0;
}

/* Links */
a {
  color: #667eea;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #764ba2;
}

/* Footer */
footer {
  background: #f6f8fa;
  border-top: 1px solid #e1e4e8;
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
  #main_content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    order: 2;
  }

  .main-content {
    order: 1;
  }

  .site-nav {
    position: static;
    margin-bottom: 32px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  header {
    padding: 24px 0;
  }

  header h1 {
    font-size: 1.6rem;
  }

  pre {
    overflow-x: auto;
    font-size: 13px;
  }

  table {
    font-size: 14px;
  }

  table th, table td {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  header {
    padding: 16px 0;
    margin-bottom: 24px;
  }

  header h1 {
    font-size: 1.3rem;
  }

  header h2 {
    font-size: 0.95rem;
  }

  #main_content {
    gap: 16px;
  }

  .site-nav {
    padding: 16px;
    margin-bottom: 24px;
    font-size: 13px;
  }

  .site-nav h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .site-nav h4 {
    font-size: 0.85rem;
  }

  .site-nav ul ul {
    margin-left: 12px;
    padding-left: 8px;
  }

  footer {
    padding: 24px 0;
    margin-top: 40px;
    font-size: 12px;
  }

  code {
    font-size: 0.85em;
  }

  pre {
    padding: 12px;
    font-size: 12px;
  }

  blockquote {
    padding: 8px 12px;
    margin: 12px 0;
  }

  table {
    font-size: 12px;
    margin: 12px 0;
  }

  table th, table td {
    padding: 6px;
  }
}

/* Blockquotes */
blockquote {
  background: #f6f8fa;
  border-left: 4px solid #667eea;
  padding: 12px 16px;
  margin: 16px 0;
  font-style: italic;
  color: #3a4556;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

table th {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

table td {
  border: 1px solid #e1e4e8;
  padding: 12px;
}

table tr:nth-child(even) {
  background: #fafbfc;
}
