/* ============================================ */
/* HOW TO CALCULATE CALORIES - BLOG CSS */
/* ============================================ */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #ea580c;
  --accent-light: #ffedd5;
  --accent-dark: #c2410c;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #fb923c;
  --accent-light: #7c2d12;
  --accent-dark: #fdba74;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* NAVBAR */
.navbar { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-size: 1.35rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger { display: block; width: 24px; height: 2px; background: var(--text); position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 24px; height: 2px; background: var(--text); left: 0; }
.hamburger::before { top: -8px; } .hamburger::after { top: 8px; }
.nav-menu { display: flex; list-style: none; gap: 8px; align-items: center; }
.nav-menu li { list-style: none; }
.nav-menu a { padding: 8px 14px; color: var(--text); font-weight: 500; font-size: 0.95rem; border-radius: var(--radius); transition: all 0.15s ease; text-decoration: none; display: inline-block; }
.nav-menu a:hover, .nav-menu a.active { background: var(--bg-secondary); color: var(--accent); text-decoration: none; }
.nav-dropdown { position: relative; } .dropdown-toggle { cursor: pointer; }
.dropdown-menu { position: absolute; top: 100%; left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-width: 260px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); display: none; z-index: 100; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-category { padding: 8px 0; }
.category-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 8px; margin-bottom: 4px; }
.dropdown-tools { list-style: none; } .dropdown-tools li { list-style: none; }
.dropdown-tools a { display: block; padding: 6px 12px; font-size: 0.9rem; color: var(--text-secondary); }
.dropdown-tools a:hover { background: var(--bg-secondary); color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.view-all { display: block; padding: 8px 12px; font-weight: 600; color: var(--accent); text-align: center; }
.theme-toggle { background: none; border: none; cursor: pointer; padding: 8px; font-size: 1.1rem; border-radius: var(--radius); }
.nav-theme-item { list-style: none; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu { position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 20px; border-top: 1px solid var(--border); display: none; align-items: stretch; gap: 4px; }
  .nav-menu.active { display: flex; }
  .nav-dropdown:hover .dropdown-menu { position: static; display: block; box-shadow: none; border: none; padding-left: 16px; }
  .nav-menu a { display: block; width: 100%; }
}

/* ARTICLE */
.blog-article { padding: 40px 0 60px; }
.article-header { max-width: 800px; margin: 0 auto 40px; text-align: center; }
.article-category { display: inline-block; padding: 6px 14px; background: var(--accent-light); color: var(--accent); font-weight: 600; font-size: 0.85rem; border-radius: 20px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.article-header h1 { font-size: 2.3rem; line-height: 1.3; margin-bottom: 20px; color: var(--text); font-weight: 800; }
.article-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 24px; }
.article-intro { font-size: 1.1rem; line-height: 1.75; color: var(--text-secondary); text-align: left; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* TOC */
.article-toc { max-width: 800px; margin: 0 auto 48px; padding: 24px 28px; background: var(--bg-secondary); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.article-toc h2 { font-size: 1.15rem; margin-bottom: 12px; color: var(--text); font-weight: 700; }
.article-toc ol { margin-left: 20px; line-height: 2; color: var(--text-secondary); }
.article-toc li { padding: 2px 0; }
.article-toc a { color: var(--accent); text-decoration: none; font-weight: 500; }
.article-toc a:hover { text-decoration: underline; }

/* SECTIONS */
.article-section { max-width: 800px; margin: 0 auto 48px; }
.article-section h2 { font-size: 1.8rem; margin-bottom: 20px; color: var(--text); padding-bottom: 12px; border-bottom: 2px solid var(--border); font-weight: 700; }
.article-section h3 { font-size: 1.3rem; margin: 28px 0 12px; color: var(--text); font-weight: 700; }
.article-section p { font-size: 1.05rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 16px; }
.article-section ul, .article-section ol { margin-left: 24px; line-height: 1.9; color: var(--text-secondary); margin-bottom: 16px; }
.article-section li { padding: 4px 0; }
.article-section strong { color: var(--text); font-weight: 700; }
.article-section code { background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* IMAGES */
.article-image { margin: 32px 0; text-align: center; }
.article-image img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); display: block; }
.article-image figcaption { font-size: 0.88rem; color: var(--text-muted); margin-top: 10px; font-style: italic; }

/* CALLOUT */
.article-callout { padding: 20px 24px; background: var(--bg-secondary); border-left: 4px solid var(--accent); border-radius: var(--radius); margin: 24px 0; }
.article-callout h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); margin-top: 0; }
.article-callout p { margin: 0; font-size: 1rem; }

/* TABLES */
.article-table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.article-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.article-table th { background: var(--bg-secondary); padding: 14px 16px; text-align: left; font-weight: 700; color: var(--text); border-bottom: 2px solid var(--border); white-space: nowrap; }
.article-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.article-table tr:last-child td { border-bottom: none; }
.article-table tr:hover { background: var(--bg-secondary); }

/* FORMULA BOXES */
.formula-box-large { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 20px 0; font-family: 'Courier New', monospace; text-align: center; overflow-x: auto; border-left: 4px solid var(--accent); }
.formula-box-large code { font-size: 1rem; font-weight: 700; color: var(--accent); display: block; margin: 4px 0; line-height: 1.8; }

/* CTA */
.article-cta { margin: 32px 0; padding: 24px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); border-radius: var(--radius); text-align: center; color: white; }
.article-cta p { color: white; font-size: 1.05rem; margin-bottom: 16px; font-weight: 600; }
.cta-button, .cta-button-large { display: inline-block; padding: 14px 28px; background: white; color: var(--accent); font-weight: 700; text-decoration: none; border-radius: var(--radius); transition: transform 0.15s ease; border: none; cursor: pointer; }
.cta-button:hover, .cta-button-large:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); }
.cta-button-large { padding: 18px 36px; font-size: 1.1rem; }
.article-cta-final { text-align: center; margin: 32px 0; }

/* FAQ */
.article-section .faq-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.article-section .faq-item:last-child { border-bottom: none; }
.article-section .faq-item h3 { font-size: 1.15rem; margin-bottom: 8px; margin-top: 0; color: var(--text); font-weight: 700; }
.article-section .faq-item p { margin: 0; font-size: 1rem; color: var(--text-secondary); line-height: 1.7; }

/* CONCLUSION */
.article-conclusion { max-width: 800px; margin: 48px auto; padding: 32px; background: var(--bg-secondary); border-radius: var(--radius); border: 1px solid var(--border); }
.article-conclusion h2 { font-size: 1.8rem; margin-bottom: 20px; font-weight: 700; }
.article-conclusion p { font-size: 1.05rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 16px; }

/* RELATED */
.article-related { max-width: 800px; margin: 48px auto 0; padding: 24px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.article-related h2 { font-size: 1.4rem; margin-bottom: 16px; font-weight: 700; }
.article-related ul { list-style: none; padding: 0; }
.article-related li { padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.article-related li:last-child { border-bottom: none; }
.article-related a { color: var(--accent); font-weight: 600; }

/* FOOTER */
.footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand p { color: var(--text-secondary); margin-top: 12px; font-size: 0.95rem; line-height: 1.6; }
.footer-logo { font-size: 1.35rem; font-weight: 800; color: var(--accent); }
.footer-tagline { font-weight: 600; color: var(--accent); margin-top: 8px; }
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 8px; list-style: none; }
.footer-nav a { color: var(--text-secondary); font-size: 0.92rem; text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }
.footer-privacy { margin-top: 6px; font-size: 0.82rem; }

/* RESPONSIVE */
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
@media (max-width: 768px) {
  .blog-article { padding: 20px 0 40px; }
  .article-header h1 { font-size: 1.85rem; }
  .article-section h2 { font-size: 1.5rem; }
  .article-section h3 { font-size: 1.15rem; }
  .article-meta { flex-direction: column; gap: 8px; }
  .article-toc { padding: 18px 20px; }
  .article-conclusion { padding: 24px 20px; }
  .article-callout { padding: 16px 18px; }
  .formula-box-large { padding: 20px 16px; }
  .formula-box-large code { font-size: 0.9rem; }
  .article-table th, .article-table td { padding: 10px 12px; font-size: 0.88rem; }
  .cta-button, .cta-button-large { display: block; width: 100%; text-align: center; padding: 14px 20px; }
  .article-image img { border-radius: 4px; }
}
@media (max-width: 480px) {
  .article-header h1 { font-size: 1.55rem; }
  .article-section h2 { font-size: 1.35rem; }
  .article-intro { font-size: 1rem; }
}