/* ============================================================
   Coffee Nerds — Site-Wide Stylesheet
   Generated by site-factory
   ============================================================ */

/* --- CSS Variables / Theme --- */
:root {
  --primary: #c05621;
  --primary-light: #feebc8;
  --primary-dark: #55280e;
  --accent: #2f855a;
  --bg: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-card: #ffffff;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 6px;
  --max-width: 1100px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
figure { margin: 1.5rem 0; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.2rem; margin-top: 0; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.3rem; }

/* --- Header / Nav --- */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.nav-brand:hover { color: var(--primary); }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
}
.theme-toggle:hover { background: var(--bg-secondary); }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1rem; }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: block; }
}

/* --- Main Content --- */
main { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem; min-height: 60vh; }

/* --- Hero Section (Homepage) --- */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; color: #fff; margin-bottom: 0.75rem; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 650px; margin: 0 auto 1.5rem; }

/* --- Article Grid --- */
.section-title {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}
.article-card-body {
  padding: 1.25rem;
}
.article-card-body h3 {
  margin-top: 0;
  font-size: 1.1rem;
}
.article-card-body h3 a {
  color: var(--text);
  text-decoration: none;
}
.article-card-body h3 a:hover { color: var(--primary); }
.article-card-body .meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.article-card-body .excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.tag-new { background: #ffebee; color: #c62828; }

/* --- Article Page --- */
article { max-width: 780px; margin: 0 auto; }
article h1 { font-size: 2rem; margin-bottom: 0.5rem; }
article .byline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- TLDR / Key Takeaways --- */
.key-takeaways {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.key-takeaways h3 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.key-takeaways ul { margin-bottom: 0; }

/* --- Product Card (for roundups) --- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.product-card h3 { margin-top: 0; }
.product-card h3 a { color: var(--text); text-decoration: none; }
.product-card h3 a:hover { color: var(--primary); }

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
thead { background: var(--bg-secondary); }
th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { font-weight: 600; }

/* --- Author Bio --- */
.author-bio {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.author-info h4 { margin: 0 0 0.25rem; }
.author-info p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }

/* --- Related Articles --- */
.related-articles {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}
.related-articles h3 { margin-top: 0; }
.related-articles ul { margin: 0; }

/* --- Disclaimer --- */
.disclaimer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Footer --- */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
footer .footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
}
footer h4 { margin-top: 0; font-size: 0.95rem; margin-bottom: 0.75rem; }
footer a { color: var(--text-secondary); text-decoration: none; display: block; margin-bottom: 0.3rem; }
footer a:hover { color: var(--primary); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
}

/* --- Cookie Consent --- */
.cookie-consent {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 1rem 1.5rem;
  z-index: 1000;
}
.cookie-consent.show { display: block; }
.cookie-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.cookie-content p { margin: 0; font-size: 0.9rem; flex: 1; min-width: 250px; }
.cookie-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }

/* --- Share Buttons --- */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  max-width: 720px;
  margin: 2rem auto;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hero { padding: 2rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .article-grid { grid-template-columns: 1fr; }
  footer .footer-content { grid-template-columns: 1fr 1fr; }
  .share-buttons { justify-content: center; }
}
@media (max-width: 480px) {
  footer .footer-content { grid-template-columns: 1fr; }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
