/* =============================================================
   SyncDiet Blog — CSS global
   Colores y tipografías alineados con landing index.html
   ============================================================= */

:root {
  --primary:        #10b981;
  --primary-d:      #059669;
  --primary-x:      #047857;
  --primary-dark:   #064e3b;
  --ink:            #0f172a;
  --ink-soft:       #334155;
  --muted:          #64748b;
  --line:           #e2e8f0;
  --paper:          #f1f5f9;
  --surface:        #ffffff;
  --accent:         #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* A11y skip link */
.skip-link { position:absolute; left:-9999px; }
.skip-link:focus {
  position:fixed; left:1rem; top:1rem; padding:.75rem 1.25rem;
  background: var(--primary-d); color:#fff; font-weight:700;
  border-radius:10px; z-index:99999; box-shadow:0 8px 24px rgba(0,0,0,.25);
}

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; line-height: 1; }
.brand img { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: 'Manrope', sans-serif; font-weight: 900; font-size: 18px;
  color: var(--ink); letter-spacing: -0.02em;
}
.brand-tagline {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 10px;
  color: var(--primary-d); letter-spacing: 0.18em; text-transform: uppercase;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px;
  color: var(--ink-soft);
}
.nav-link:hover { color: var(--primary-d); }
.nav-cta {
  display: inline-flex; align-items: center;
  background: var(--primary-d); color: #fff !important;
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14px;
  padding: 9px 18px; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(5,150,105,0.25);
  transition: all .2s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(5,150,105,0.35); }

/* Mini toggle ES/EN del header (entre los nav-links y el CTA) */
.lang-toggle-header {
  display: inline-flex;
  background: var(--paper);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.lang-btn-header {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  transition: all .15s ease;
}
.lang-btn-header:hover { color: var(--ink); }
.lang-btn-header.active {
  background: var(--primary-d);
  color: #fff;
}

@media (max-width: 640px) {
  .nav-link { display: none; }
  /* En pantallas estrechas, el toggle también se oculta para no apretar el header.
     Los usuarios mobile pueden cambiar idioma desde el toggle del listado /blog. */
  .lang-toggle-header { display: none; }
}

/* ── Footer ── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px 40px; text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;       /* alinea verticalmente logo+texto */
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  line-height: 1;            /* evita desfase por baseline del texto */
}
.footer-logo-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: #fff;          /* círculo blanco contenedor (igual que en los emails) */
  border-radius: 50%;
  padding: 6px;
  flex-shrink: 0;
}
.footer-logo-circle img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.footer-brand-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.footer-tagline {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.32em; color: #a7f3d0; margin-bottom: 24px;
}

/* Social icons (Facebook, Instagram, TikTok) */
.footer-follow {
  font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); margin-bottom: 14px;
}
.footer-social {
  display: flex; gap: 12px; justify-content: center; margin-bottom: 28px;
}
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.10); color: #a7f3d0;
  transition: all .2s ease;
}
.social-btn:hover {
  transform: translateY(-2px) scale(1.05);
  color: #fff;
}
.social-fb:hover { background: #1877F2; }
.social-ig:hover { background: linear-gradient(135deg, #833AB4 0%, #E4405F 50%, #FCAF45 100%); }
.social-tt:hover { background: #000; }

.footer-links {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-links a {
  color: rgba(255,255,255,0.7); font-size: 14px;
  transition: color .2s ease;
}
.footer-links a:hover { color: #fff; }
.footer-copy {
  font-size: 12px; color: rgba(255,255,255,0.45);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px; margin-top: 8px;
}

/* ── Article list (blog index) ── */
.blog-hero {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 24px 40px; text-align: center;
}
.blog-hero h1 {
  font-family: 'Manrope', sans-serif; font-weight: 900; font-size: 48px;
  color: var(--ink); letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 16px;
}
.blog-hero p {
  font-size: 18px; color: var(--muted); max-width: 600px; margin: 0 auto;
}
.eyebrow {
  display: inline-block; padding: 6px 14px;
  background: rgba(16,185,129,0.1); border-radius: 999px;
  font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-x);
  margin-bottom: 20px;
}

/* Selector ES/EN debajo del hero */
.lang-toggle {
  display: inline-flex; gap: 0; margin-top: 28px;
  background: #fff; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px;
}
.lang-btn {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 18px; border-radius: 8px;
  font-family: 'Inter', sans-serif; font-weight: 700; font-size: 13px;
  color: var(--muted); transition: all .2s ease;
  letter-spacing: 0.05em;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--primary-d); color: #fff; }

/* Empty state (cuando no hay posts en idioma seleccionado) */
.empty-state {
  grid-column: 1/-1; text-align: center;
  color: var(--muted); padding: 60px 20px;
  font-size: 16px;
}
.empty-state.hidden { display: none; }

.post-grid {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px 80px;
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.post-card {
  background: var(--surface); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(15,23,42,0.04);
  transition: all .3s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15,23,42,0.10);
  border-color: var(--primary);
}
.post-card a { color: inherit; display: block; }
.post-cover {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
  background: linear-gradient(135deg, #d1fae5, #6ee7b7);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 22px 24px 26px; }
.post-category {
  display: inline-block;
  font-family: 'Manrope', sans-serif; font-size: 10px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-d);
  margin-bottom: 10px;
}
.post-title {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 20px;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1.3;
  margin-bottom: 10px;
}
.post-desc {
  font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 14px;
}
.post-meta {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 12px; align-items: center;
}
.post-meta time { display: inline-flex; align-items: center; gap: 4px; }

/* ── Single article ── */
.article-hero {
  max-width: 800px; margin: 0 auto;
  padding: 60px 24px 32px; text-align: center;
}
.article-hero .post-category { margin-bottom: 14px; }
.article-hero h1 {
  font-family: 'Manrope', sans-serif; font-weight: 900; font-size: 44px;
  color: var(--ink); letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 18px;
}
.article-hero .lead {
  font-size: 18px; color: var(--muted); line-height: 1.55;
  max-width: 640px; margin: 0 auto 24px;
}
.article-meta {
  display: flex; gap: 16px; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.article-cover {
  max-width: 1000px; margin: 0 auto 40px;
  padding: 0 24px;
}
.article-cover img {
  width: 100%; max-height: 520px; object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15,23,42,0.10);
}

/* Tipografía contenido markdown */
.prose {
  max-width: 720px; margin: 0 auto; padding: 0 24px;
  font-size: 17px; line-height: 1.75; color: var(--ink-soft);
}
.prose > * + * { margin-top: 24px; }
.prose h2 {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 30px;
  color: var(--ink); letter-spacing: -0.02em; margin-top: 48px !important; margin-bottom: 12px !important;
  line-height: 1.25;
}
.prose h3 {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 22px;
  color: var(--ink); margin-top: 32px !important; margin-bottom: 8px !important;
}
.prose p { font-size: 17px; line-height: 1.75; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul li, .prose ol li { margin-bottom: 8px; line-height: 1.7; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a {
  color: var(--primary-d); text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.prose a:hover { color: var(--primary-x); }
.prose blockquote {
  border-left: 4px solid var(--primary); padding: 16px 24px;
  background: rgba(16,185,129,0.06); border-radius: 0 12px 12px 0;
  font-style: italic; color: var(--ink-soft);
}
.prose code {
  background: rgba(15,23,42,0.06); padding: 2px 8px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px;
}
.prose pre {
  background: var(--ink); color: #e2e8f0; padding: 20px 24px;
  border-radius: 14px; overflow-x: auto;
}
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose img {
  border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,0.08);
  margin: 32px auto;
}

/* Tablas dentro del cuerpo del artículo (Markdown) */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15,23,42,0.05);
  border: 1px solid var(--line);
}
.prose thead { background: linear-gradient(180deg, #f8fafc, #f1f5f9); }
.prose th {
  padding: 14px 20px;
  text-align: left;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.prose td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  line-height: 1.5;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: rgba(16,185,129,0.04); }
/* Primera columna (días/labels) en negrita */
.prose tbody td:first-child {
  font-weight: 700;
  color: var(--ink);
}
/* Responsive: scroll horizontal en pantallas pequeñas */
@media (max-width: 640px) {
  .prose table { font-size: 14px; }
  .prose th, .prose td { padding: 10px 14px; }
}

/* CTA al final del artículo */
.article-cta {
  max-width: 720px; margin: 64px auto 0;
  padding: 36px 32px; border-radius: 24px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-x) 60%, var(--primary-d) 100%);
  color: #fff; text-align: center;
}
.article-cta h3 {
  font-family: 'Manrope', sans-serif; font-weight: 900; font-size: 26px;
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.article-cta p {
  color: #d1fae5; font-size: 16px; margin-bottom: 22px;
}
.article-cta a {
  display: inline-block; padding: 16px 36px;
  background: #fff; color: var(--primary-x) !important;
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 16px;
  border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.20);
  transition: all .2s ease;
  text-decoration: none;
}
.article-cta a:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.30); }

/* Lista relacionada (al final del post) */
.related {
  max-width: 1200px; margin: 80px auto 0; padding: 0 24px;
}
.related h2 {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 28px;
  color: var(--ink); margin-bottom: 24px; text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-hero h1 { font-size: 36px; }
  .article-hero h1 { font-size: 32px; }
  .prose h2 { font-size: 24px; }
  .article-cta { padding: 28px 24px; }
}
