/* ====================================================
   ALFAMETABOLICO V15.4 — ULTRA PREMIUM EDITION
   Zero-CLS Engine — UX Boost — AdSense Optimized
==================================================== */

/* ----------------------------------------------
   GOOGLE FONTS 
---------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Literata:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');


/* ----------------------------------------------
   VARIABLES
---------------------------------------------- */
:root {
  --sans: Inter, system-ui, sans-serif;
  --serif: "Literata", Georgia, serif;

  --text: #111;
  --text-light: #666;
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --border: #e1e1e1;

  --radius: 14px;
  --radius-small: 10px;
  --shadow-soft: 0 2px 10px rgba(0,0,0,0.06);
}

/* DARK MODE — Less dark, premium, smoother */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f5;
    --text-light: #d0d0d0;
    --bg: #1f1f22;
    --bg-soft: #2a2a2d;
    --border: #3a3a3d;
    --shadow-soft: 0 4px 14px rgba(0,0,0,0.30);
  }
}


/* ----------------------------------------------
   GLOBAL
---------------------------------------------- */
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
}

/* Anti-CLS fix for titles */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.25px;
  line-height: 1.15;
  min-height: 1.15em;
}

.container {
  width: 92%;
  max-width: 860px;
  margin: auto;
}

* a {
  color: var(--text-light);
}


/* ----------------------------------------------
   NAVBAR STICKY + SHRINK
---------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 18px 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
  backdrop-filter: blur(12px);
}

.header.shrink {
  padding: 10px 0;
  box-shadow: var(--shadow-soft);
}

/* Si hay admin bar, baja el header un poco */
body.admin-bar .header { top: 32px; }

@media (max-width: 782px) {
  body.admin-bar .header { top: 46px; }
}

.logo {
  font-size: 27px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--serif);
}

/* Estructura interna del header */
.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Menú base */
.main-nav {
  width: 100%;
}

.nav-menu {
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
}

/* Links del menú */
.nav-menu a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 15px;
}

.nav-menu a:hover {
  opacity: .55;
}

/* Botón hamburguesa (oculto por defecto, solo mobile) */
.nav-toggle {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  margin-left: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  z-index: 1200;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 10px;
}

.nav-toggle span + span {
  margin-top: 4px;
}

/* Estado "X" al abrir menú */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}


/* -------- Desktop ≥ 769px -------- */
@media (min-width: 769px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .header {
    text-align: center;
  }

  .nav-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    width: auto;
  }

  .nav-menu {
    display: flex;
    gap: 18px;
    justify-content: center;
    position: static;
  }
}


/* -------- Mobile ≤ 768px -------- */
@media (max-width: 768px) {

  .header {
    text-align: left;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .logo {
    font-size: 22px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* Menú desplegable bajo el header */
  .header .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
  }

  .nav-menu {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    list-style: none;

    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);

    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .nav-menu li {
    width: 100%;
    text-align: left;
  }

  .nav-menu a {
    display: inline-block;
    padding: 4px 0;
    font-size: 15px;
  }

  .nav-menu.nav-menu--open {
    display: flex !important;
  }
}


/* ----------------------------------------------
   HERO
---------------------------------------------- */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 38px;
}

.hero p {
  font-size: 17px;
  color: var(--text-light);
  max-width: 580px;
  margin: 10px auto 0;
}


/* ----------------------------------------------
   POSTS LIST
---------------------------------------------- */
.post {
  padding-bottom: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.post h2 a {
  font-size: 23px;
  text-decoration: none;
  color: var(--text);
}

.post h2 a:hover { opacity: .65; }

.post p {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text-light);
}

.post a { text-decoration: none; }

.a_posts { color: var(--text-light); }


/* ----------------------------------------------
   TOC (NOTION STYLE)
---------------------------------------------- */
#toc-container {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 28px 0 30px;

  position: relative !important;
  right: unset !important;
  top: unset !important;
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  box-shadow: none !important;

  box-sizing: border-box;
}

#toc-container strong {
  font-size: 17px;
  display: block;
  margin-bottom: 10px;
}

#toc-container ul { margin: 0; padding: 0; list-style: none; }

#toc-container li {
  padding: 6px 0;
  cursor: pointer;
}

#toc-container li[data-level="H3"] { padding-left: 16px; opacity: 0.85; }

#toc-container a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 15px;
}

/* Floating TOC en desktop */
@media (min-width: 1080px) {
  #toc-container {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;

    position: fixed;
    right: 40px;
    top: 140px;
    width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
    z-index: 50;
  }
}


/* ----------------------------------------------
   POST CONTENT
---------------------------------------------- */
#post-content {
  margin-top: 24px;
  padding-left: 4px;
  padding-right: 4px;
}

#post-content p {
  margin: 14px 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.86;
}

#post-content h2 {
  font-size: 28px;
  margin: 28px 0 16px;
}

#post-content h3 {
  font-size: 22px;
  margin: 20px 0 12px;
}

/* Links */
#post-content a {
  color: var(--text);
  background-image: linear-gradient(transparent 70%, var(--text-light) 70%);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  text-decoration: none;
}

#post-content a:hover { background-size: 100% 2px; opacity: .75; }

/* Images */
#post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 18px 0;
  cursor: zoom-in;
}

#post-content img:hover { transform: scale(1.01); }

blockquote {
  border-left: 4px solid var(--border);
  padding-left: 12px;
  margin: 18px 0;
  font-style: italic;
  color: var(--text-light);
}


/* ----------------------------------------------
   FLOATING BUTTON
---------------------------------------------- */
#reading-floating-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 24px;
  z-index: 99999;
}


/* ----------------------------------------------
   READING MODE
---------------------------------------------- */
body.reading-mode .header,
body.reading-mode .footer,
body.reading-mode #toc-container {
  display: none !important;
}

body.reading-mode #post-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 20px 0 40px;
}

body.reading-mode #post-content p { font-size: 21px; line-height: 1.95; }
body.reading-mode #post-content h2 { font-size: 34px; }
body.reading-mode #post-content h3 { font-size: 26px; }


/* ----------------------------------------------
   FOOTER
---------------------------------------------- */
.footer {
  text-align: center;
  padding: 30px 0;
  color: var(--text-light);
  border-top: 1px solid var(--border);
}


/* ----------------------------------------------
   MOBILE POST LAYOUT
---------------------------------------------- */
@media (max-width: 600px) {

  #post-content {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  #post-content p { margin: 12px 0 !important; }
  #post-content h2 { margin: 22px 0 12px !important; }
  #post-content h3 { margin: 18px 0 10px !important; }

  #post-content img { margin: 14px 0; }

  #toc-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 16px;
    margin: 24px 0 26px;
    overflow-x: hidden;
  }
}


/* ----------------------------------------------
   TABLET
---------------------------------------------- */
@media (min-width: 601px) and (max-width: 900px) {
  #post-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* ============================================================
   ALFA BOXES — Style for SILO + Popular Posts
============================================================ */
.alfa-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 40px 0;
  box-shadow: var(--shadow-soft);
}

.alfa-box strong {
  font-size: 17px;
  color: var(--text);
  display: block;
  margin-bottom: 10px;
}

.alfa-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.alfa-box li {
  padding: 6px 0;
}

.alfa-box a {
  color: var(--text-light);
  font-size: 15px;
  text-decoration: none;
  background-image: linear-gradient(transparent 70%, var(--text-light) 70%);
  background-size: 100% 1px;
  background-repeat: no-repeat;
}

.alfa-box a:hover {
  opacity: .75;
  background-size: 100% 2px;
}


/* ============================================================
   FIX: Eliminar subrayado doble del theme en enlaces automáticos
============================================================ */
.auto-link,
.alfa-silo-box a, .alfa-silo a, .alfa-box a,
.alfa-popular-box a {
  background-image: none !important;
  text-decoration: none !important;
  border-bottom: 1px solid var(--text-light);
  padding-bottom: 1px;
  color: var(--text);
}

.auto-link:hover,
.alfa-silo-box a:hover,
.alfa-popular-box a:hover {
  border-bottom-color: var(--text);
  opacity: 0.85;
}

/* Dark mode premium */
@media (prefers-color-scheme: dark) {
  .auto-link,
  .alfa-silo-box a,
  .alfa-popular-box a, .alfa-silo a, .alfa-box a {
    border-bottom-color: #999;
  }
  .auto-link:hover,
  .alfa-silo-box a:hover,
  .alfa-popular-box a:hover {
    border-bottom-color: #fff;
  }
}


/* Móvil pequeño refinado */
@media (max-width: 480px) {
  .hero {
    padding: 26px 0 20px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 15px;
  }

  #reading-floating-btn {
    bottom: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    font-size: 22px;
  }
}


/* ====================================================
   HOME ALFA METABÓLICO — SECCIÓN SILOS + FAQ
==================================================== */

/* Hero home */
.hero.hero-home {
  padding: 3rem 1.5rem 2.25rem;
  text-align: center;
  background: radial-gradient(circle at top, #111 0, #000 55%, #000 100%);
  color: #fff;
  margin-bottom: 2rem;
}

.hero-home .hero-inner {
  max-width: 780px;
  margin: 0 auto;
}

.hero-home h1 {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.9rem;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.hero-home p {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

/* Bloques generales de la home */
.home-intro,
.home-silos,
.home-latest,
.home-faq {
  margin: 2.5rem auto;
}

.home-intro p {
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-light, #555);
}

/* Títulos de sección */
.section-title {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  margin-top: 0.4rem;
  background: #111;
  opacity: 0.18;
}

/* Grid de silos */
.silos-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.silo-card {
  background: var(--bg-soft, #f6f6f6);
  border: 1px solid var(--border, #e1e1e1);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}

.silo-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.45rem;
}

.silo-card h3 a {
  text-decoration: none;
  color: var(--text, #111);
}

.silo-card p {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-light, #666);
}

.silo-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
  border-color: #ccc;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

/* Últimos artículos en home */
.home-latest .post {
  border-bottom: 1px solid var(--border, #e1e1e1);
  padding: 0.85rem 0;
}

.home-latest .post:last-of-type {
  border-bottom: none;
}

.home-latest .post-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.home-latest .post-title a {
  color: var(--text, #111);
  text-decoration: none;
}

.home-latest .post-title a:hover {
  text-decoration: underline;
}

.home-latest .post-excerpt {
  font-size: 0.9rem;
  color: var(--text-light, #666);
  line-height: 1.6;
}

.home-latest .post-cat a {
  color: var(--text-light);
  text-decoration: none;
}


/* FAQ home */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.faq-item {
  background: var(--bg-soft, #f6f6f6);
  border: 1px solid var(--border, #e1e1e1);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}

.faq-item h3 {
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
}

.faq-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-light, #666);
}

.faq-item a {
  color: var(--text-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}


/* ----------------------------------------------
   HOME RESPONSIVE
---------------------------------------------- */
@media (min-width: 768px) {
  .hero.hero-home {
    padding: 3.2rem 1.5rem 2.8rem;
  }

  .hero-home h1 {
    font-size: 2.1rem;
  }

  .hero-home p {
    font-size: 1.02rem;
  }

  .silos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-intro,
  .home-silos,
  .home-latest,
  .home-faq {
    margin: 3rem auto;
  }

  .faq-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
  }
}

@media (min-width: 1040px) {
  .hero-home h1 {
    font-size: 2.25rem;
  }

  .hero-home p {
    font-size: 1.05rem;
  }
}


/* -------------------------------------------------
   NEUTRALIZAR CLASES FADE-UP (sin animaciones)
------------------------------------------------- */
.fade-up,
.fade-up-visible {
  opacity: 1;
  transform: none;
}

/* Fix icono hamburguesa en móvil: 3 rayas apiladas */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;   /* apila las barras en columna */
    gap: 4px;                 /* separación vertical entre barras */
  }

  .nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--text);  /* en dark se verá blanco */
    border-radius: 10px;
  }

  /* anulamos el margin-top antiguo para que no se desplace raro */
  .nav-toggle span + span {
    margin-top: 0 !important;
  }
}

.alfa-adsense-box {
  min-height: 280px;
  width: 100%;
  display: block;
}

.footer-links a {
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  padding-bottom: 2px;
}

.footer-links a:hover {
  border-color: #000;
}

/* MÓVIL RESPONSIVO */
@media (max-width: 768px) {
  .footer-links {
    gap: 4px 10px;
  }

  .footer-links span {
    display: none; /* oculta | en móvil para que todo quede alineado */
  }

  .footer-links a {
    display: inline-block;
    width: 100%; /* cada enlace ocupa su propia línea */
    text-align: center;
	font-size:0.5rem;
  }
}
