/* Global reset for html and body to eliminate white borders on mobile */
html {
  margin: 0;
  padding: 0;
  background-color: #fafafa; /* Light default background for article pages */
}

body {
  margin: 0;
  padding: 0;
  background-color: #fafafa; /* Light default background for article pages */
  min-height: 100vh; /* Ensure body covers full viewport height */
}

.header-logo {
    height: 56px; /* baseline for small screens */
    width: auto;
    display: inline-block;
    margin: 0;
}

/* Brand logo sizing — larger than an icon, responsive */
.brand-logo {
    height: 56px; /* baseline for small screens */
    width: auto;
    display: inline-block;
    margin: 0;
}

/* Medium screens */
@media (min-width: 768px) {
    .brand-logo {
        height: 120px; /* stepped up from 72px */
    }
}

/* Large screens (desktop) */
@media (min-width: 1024px) {
    .brand-logo {
        height: 282px; /* your target size for desktop */
    }
}

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

/* Dark background for home page only */
.home-page {
  background-color: #2a2a2a;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Hero background: dark blue-gray gradient for dark mode */
.hero {
  background: linear-gradient(135deg, #1a2332 0%, #2c3e50 40%, #34495e 100%);
  color: #f0f0f0;
  padding: 3.5rem 1rem;
  text-align: center;
}

/* Hero text styling */
.hero h1 {
  color: #f0f0f0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.hero .lead {
  color: #e0e0e0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero .lead {
    font-size: 1.1rem;
  }
}

.hero .hero-logo {
  max-width: 280px;
  margin-bottom: 1rem;
  height: 120px; /* Override brand-logo's 56px for mobile */
}

@media (min-width: 768px) {
  .hero .hero-logo {
    max-width: 320px;
    height: 120px; /* Keep at 120px for tablet */
  }
}

@media (min-width: 1024px) {
  .hero .hero-logo {
    height: 282px; /* Scale to 282px for desktop, matching brand-logo */
  }
}

/* Contain hero width */
.hero .container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Products section with horizontal whitespace */
.products {
  max-width: 1200px;
  margin: 2rem auto 0 auto;
  padding: 0 2rem 3rem 2rem;
}

.home-page .products h2 {
  color: #f0f0f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

@media (min-width: 768px) {
  .products {
    padding: 0 3rem 4rem 3rem;
  }
}

@media (min-width: 1024px) {
  .products {
    padding: 0 4rem 5rem 4rem;
  }
}

/* Product grid */
.product-grid {
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  margin-top:1rem;
}

.product-card {
  border:1px solid rgba(0,0,0,0.06);
  padding:1rem;
  border-radius:8px;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.product-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.product-title a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s ease;
}

.product-title a:hover {
  color: #2b6cb0;
  text-decoration: underline;
}

.product-description {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
}

.product-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-features {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.product-card-features ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.product-card-features li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
}

.product-card-features li::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: #2b6cb0;
  font-weight: bold;
}

.card-icon { font-size:28px; margin-bottom:.5rem; }
.card-actions { margin-top:0.75rem; display:flex; gap:.5rem; }
.product-actions { margin-top: auto; padding-top: 0.75rem; display: flex; gap: .5rem; }

/* Buttons */
.btn { 
  padding:.5rem .75rem; 
  border-radius:6px; 
  text-decoration:none; 
  display:inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
}
.btn-primary { background:#2b6cb0; color:#fff; }
.btn-outline { border:1px solid #2b6cb0; color:#2b6cb0; background:transparent; }

/* Badge preview */
.badge-preview { display:flex; gap:1rem; align-items:center; margin-top:1rem; }

/* Centered content container for articles */
.centered-content { text-align: center; }

/* Code block container with header and copy button */
.code-block-container {
  position: relative;
  margin: 1.5rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.code-language {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.05em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.code-block-container pre {
  margin: 0;
  padding: 1rem;
  background: #f5f5f5;
  border: none;
  border-radius: 0;
  overflow-x: auto;
}

.code-block-container pre code {
  background: transparent;
  padding: 0;
  font-size: 0.9em;
  line-height: 1.6;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.copy-button:hover {
  color: #2b6cb0;
}

.copy-button svg {
  width: 18px;
  height: 18px;
}

.copy-button.copied {
  color: #16a34a;
}

.copy-button.copied svg {
  stroke: #16a34a;
}

/* Article pages - Substack/Medium inspired styling */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #1a1a1a;
}

.article h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #111;
  letter-spacing: -0.02em;
}

.article h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #111;
  letter-spacing: -0.01em;
}

.article p {
  margin-bottom: 1.5rem;
  color: #333;
}

.article p strong {
  font-weight: 700;
  color: #111;
}

.article code {
  font-family: 'Consolas', 'Monaco', monospace;
  background: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.article p.explanatory-note {
    font-family: Tahoma, sans-serif;
    font-size: 0.94rem;
}

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

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

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.article table th {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  border-right: 1px solid #000;
  color: #212529;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article table th:last-child {
  border-right: none;
}

.article table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #000;
  color: #333;
  line-height: 1.6;
}

.article table td:last-child {
  border-right: none;
}

/* Alternating row colors for better readability */
.article table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* Hover effect on rows */
.article table tbody tr:hover {
  background-color: #f5f5f5;
  transition: background-color 0.2s ease;
}

/* Center alignment for checkmarks/symbols columns */
.article table td:nth-child(3),
.article table th:nth-child(3) {
  text-align: center;
}

/* Style for first row (typically the recommended option) */
.article table tbody tr:first-child {
  background-color: #fff9e6;
  border-left: 4px solid #f1d86e;
}

.article table tbody tr:first-child:hover {
  background-color: #fff5d6;
}

/* Responsive table wrapper for mobile */
@media (max-width: 767px) {
  .article table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .article table th,
  .article table td {
    padding: 10px 12px;
  }
  
  .article table th {
    font-size: 0.8rem;
  }
}

/* Responsive adjustments for articles */
@media (min-width: 768px) {
  .article {
    padding: 4rem 2rem;
  }
  
  .article h1 {
    font-size: 3rem;
  }
  
  .article h2 {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .article {
    font-size: 1.05rem;
  }
  
  .article h1 {
    font-size: 2rem;
  }
  
  .article h2 {
    font-size: 1.5rem;
  }
}

/* Footer styling - dark mode */
.site-footer {
  background-color: #2a2a2a;
  color: #e0e0e0;
  padding: 2rem 1rem;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
