/* ═══════════════════════════════════════════════════════════════
   a fueguito lento — components.css
   Sistema de componentes reutilizables para todo el sitio.
   Úsalos en cualquier página, post o template.
   ═══════════════════════════════════════════════════════════════ */


/* ── BOTONES ─────────────────────────────────────────────────────
   Uso:
     <a href="..." class="btn btn-primary">Texto</a>
     <a href="..." class="btn btn-secondary">Texto</a>
     <a href="..." class="btn btn-text">Texto →</a>
   ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  line-height: 1;
}

/* Primario — terracota sólido */
.btn-primary {
  background: var(--tc);
  color: var(--bl);
  padding: 16px 36px;
  font-size: 0.82rem;
}
.btn-primary:hover {
  background: var(--ng);
  transform: translateY(-2px);
}

/* Secundario — borde terracota */
.btn-secondary {
  background: transparent;
  color: var(--tc);
  padding: 14px 34px;
  font-size: 0.82rem;
  border: 1px solid rgba(193,122,92,0.5);
}
.btn-secondary:hover {
  background: var(--tc);
  color: var(--bl);
  border-color: var(--tc);
}

/* Texto-link — sin caja, con subrayado */
.btn-text {
  background: none;
  color: var(--tc);
  padding: 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(193,122,92,0.4);
  padding-bottom: 2px;
  letter-spacing: 0.06em;
}
.btn-text:hover {
  color: var(--ng);
  border-color: var(--ng);
}

/* Variante oscura — para usar sobre fondo negro */
.btn-primary.on-dark:hover {
  background: var(--bl);
  color: var(--ng);
}

/* Tamaños */
.btn-sm { padding: 10px 22px; font-size: 0.72rem; }
.btn-lg { padding: 20px 52px; font-size: 0.9rem; }


/* ── BLOCKQUOTE / CITA DESTACADA ─────────────────────────────────
   Uso en el editor de bloques: clase CSS personalizada "afl-quote"
   O directamente en HTML:
     <blockquote class="afl-quote">…</blockquote>
   ─────────────────────────────────────────────────────────────── */

.afl-quote {
  position: relative;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--ng);
  line-height: 1.5;
  padding: 32px 40px;
  margin: 40px 0;
  border-left: 3px solid var(--tc);
  background: var(--bl);
}
.afl-quote::before {
  content: '\201C';
  font-family: 'EB Garamond', serif;
  font-size: 5rem;
  color: rgba(193,122,92,0.15);
  position: absolute;
  top: -10px;
  left: 12px;
  line-height: 1;
}
.afl-quote cite {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gs);
  margin-top: 16px;
}

/* Cita centrada — para usar como separador editorial */
.afl-quote.centered {
  text-align: center;
  border-left: none;
  border-top: 1px solid rgba(193,122,92,0.2);
  border-bottom: 1px solid rgba(193,122,92,0.2);
  padding: 44px 60px;
}
.afl-quote.centered::before {
  left: 50%;
  transform: translateX(-50%);
}


/* ── FORMULARIO DE EMAIL (PACK GRATIS) ──────────────────────────
   Mismo formulario que la landing, reutilizable en cualquier página.
   Uso:
     <?php get_template_part('template-parts/form-freemium'); ?>
   O copiar el HTML del formulario y añadir clase .afl-form-wrap
   ─────────────────────────────────────────────────────────────── */

.afl-form-wrap {
  background: var(--bl);
  padding: 40px;
  position: relative;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.afl-form-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--vd);
}
.afl-form-wrap .fh {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ng);
  margin-bottom: 5px;
}
.afl-form-wrap .fsh {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--gs);
  margin-bottom: 24px;
  line-height: 1.6;
}
.afl-form-wrap .fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.afl-form-wrap .flbl {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ng);
  text-transform: uppercase;
}
.afl-form-wrap .finput {
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  color: var(--ng);
  background: var(--cr);
  border: 1px solid rgba(43,43,43,0.12);
  padding: 11px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}
.afl-form-wrap .finput::placeholder { color: rgba(138,133,120,0.4); }
.afl-form-wrap .finput:focus {
  border-color: var(--tc);
  box-shadow: 0 0 0 3px rgba(193,122,92,0.08);
}
.afl-form-wrap .fsel {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8578' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.afl-form-wrap .fsub {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ng);
  color: var(--cr);
  padding: 15px 24px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 6px;
  position: relative;
}
.afl-form-wrap .fsub::after {
  content: '→';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s;
}
.afl-form-wrap .fsub:hover { background: var(--tc); }
.afl-form-wrap .fsub:hover::after { transform: translateY(-50%) translateX(4px); }
.afl-form-wrap .fsub:disabled { opacity: 0.5; cursor: not-allowed; }
.afl-form-wrap .ferr {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #b94040;
  margin-top: 4px;
  display: none;
}
.afl-form-wrap .flegal {
  font-family: 'Inter', sans-serif;
  font-size: 0.67rem;
  color: var(--gs);
  margin-top: 12px;
  line-height: 1.6;
  opacity: 0.7;
}
.afl-form-wrap .flegal a { color: var(--tc); text-decoration: underline; }
.afl-form-wrap .fsuccess { display: none; text-align: center; padding: 28px 0; }
.afl-form-wrap .fsicon { font-size: 2.5rem; margin-bottom: 14px; display: block; }
.afl-form-wrap .fstitle { font-family: 'EB Garamond', serif; font-size: 1.5rem; color: var(--ng); margin-bottom: 8px; }
.afl-form-wrap .fstext { font-family: 'Inter', sans-serif; font-size: 0.82rem; color: var(--gs); line-height: 1.75; }


/* ── TARJETAS DE ACCIÓN INLINE ───────────────────────────────────
   Para insertar 1, 2 o 3 tarjetas dentro de un artículo.
   Uso:
     <div class="afl-cards-inline">
       <div class="afl-card-item" data-id="mezclar"></div>
       <div class="afl-card-item" data-id="tocar"></div>
     </div>
   El JS de blog.js rellena las imágenes automáticamente.
   ─────────────────────────────────────────────────────────────── */

.afl-cards-inline {
  display: flex;
  gap: 16px;
  margin: 40px 0;
  justify-content: center;
}
.afl-card-item {
  flex: 0 0 auto;
  width: 140px;
  cursor: pointer;
  perspective: 1000px;
}
.afl-card-inner {
  position: relative;
  width: 100%;
  padding-bottom: 142.7%;
  transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
  transform-style: preserve-3d;
}
.afl-card-item:hover .afl-card-inner,
.afl-card-item.flipped .afl-card-inner {
  transform: rotateY(180deg);
}
.afl-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(43,43,43,0.12);
}
.afl-card-face.back { transform: rotateY(180deg); }
.afl-card-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.afl-card-label {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
  color: var(--gs);
  margin-top: 8px;
}

/* 1 tarjeta centrada — más grande */
.afl-cards-inline.single .afl-card-item { width: 180px; }

/* 3+ tarjetas — más pequeñas */
.afl-cards-inline.compact .afl-card-item { width: 110px; }


/* ── SECCIÓN CTA ─────────────────────────────────────────────────
   Uso:
     <div class="afl-cta-block">
       <p class="afl-cta-tag">Preventa activa</p>
       <h3 class="afl-cta-title">12 tarjetas para cocinar con calma</h3>
       <div class="afl-cta-price">29€</div>
       <a href="STRIPE_LINK" class="btn btn-primary btn-lg on-dark">Reservar el kit</a>
       <p class="afl-cta-trust">✓ Pago seguro vía Stripe · ✓ Devolución garantizada</p>
     </div>
   ─────────────────────────────────────────────────────────────── */

.afl-cta-block {
  background: var(--ng);
  padding: 60px 48px;
  text-align: center;
  margin: 48px 0;
  position: relative;
  overflow: hidden;
}
.afl-cta-block::before {
  content: '';
  position: absolute;
  top: -60%; left: -30%;
  width: 160%; height: 160%;
  background: radial-gradient(ellipse at 60% 40%, rgba(193,122,92,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.afl-cta-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tcl);
  margin-bottom: 12px;
}
.afl-cta-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--cr);
  margin-bottom: 20px;
  line-height: 1.3;
}
.afl-cta-price {
  font-family: 'EB Garamond', serif;
  font-size: 2.8rem;
  color: var(--tcl);
  margin-bottom: 6px;
  line-height: 1;
}
.afl-cta-price-note {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(245,241,232,0.35);
  margin-bottom: 24px;
}
.afl-cta-price-note s { opacity: 0.5; }
.afl-cta-trust {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(245,241,232,0.3);
  margin-top: 16px;
}

/* Versión compacta — para insertar a mitad de un artículo */
.afl-cta-block.compact {
  padding: 44px 36px;
  margin: 40px -24px; /* sangra más allá del texto en móvil */
}
.afl-cta-block.compact .afl-cta-title { font-size: 1.3rem; }
.afl-cta-block.compact .afl-cta-price { font-size: 2.2rem; }


/* ── CAJA DESTACADA / TIP ────────────────────────────────────────
   Uso en el editor de bloques con clase CSS personalizada:
     "afl-tip"          → acento terracota (consejo)
     "afl-tip afl-tip--sage"  → acento verde (positivo)
     "afl-tip afl-tip--dark"  → fondo oscuro (importante)

   En HTML:
     <div class="afl-tip">
       <strong>Nota:</strong> Texto del consejo.
     </div>
   ─────────────────────────────────────────────────────────────── */

.afl-tip {
  background: var(--bl);
  border-left: 3px solid var(--tc);
  padding: 18px 22px;
  margin: 32px 0;
  font-size: 1rem;
  color: var(--ng);
  line-height: 1.75;
}
.afl-tip strong {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tc);
  display: block;
  margin-bottom: 6px;
}
.afl-tip--sage { border-color: var(--vd); }
.afl-tip--sage strong { color: var(--vd); }
.afl-tip--dark { background: var(--ng); color: var(--cr); border-color: var(--tc); }
.afl-tip--dark strong { color: var(--tcl); }


/* ── TABLA DE CONTENIDOS ─────────────────────────────────────────
   Se genera automáticamente desde blog.js si el post tiene
   2+ subtítulos h2. También se puede insertar manualmente.
   Uso manual:
     <nav class="afl-toc">
       <p class="afl-toc-title">En este artículo</p>
       <ol>
         <li><a href="#seccion-1">Sección 1</a></li>
       </ol>
     </nav>
   ─────────────────────────────────────────────────────────────── */

.afl-toc {
  background: var(--bl);
  border: 1px solid rgba(193,122,92,0.16);
  padding: 24px 28px;
  margin: 36px 0;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.afl-toc-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tc);
  margin-bottom: 14px;
}
.afl-toc ol {
  margin: 0;
  padding-left: 18px;
  counter-reset: toc;
  list-style: none;
}
.afl-toc li {
  counter-increment: toc;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--gs);
  padding-left: 6px;
}
.afl-toc li::before {
  content: counter(toc) '.';
  color: var(--tc);
  font-weight: 500;
  margin-right: 8px;
  font-size: 0.75rem;
}
.afl-toc a {
  color: var(--gs);
  text-decoration: none;
  transition: color 0.2s;
}
.afl-toc a:hover { color: var(--tc); }


/* ── BLOQUE DE RECETA ────────────────────────────────────────────
   Uso:
     <div class="afl-recipe">
       <div class="afl-recipe-header">
         <h3>Tostada de aguacate</h3>
         <div class="afl-recipe-meta">
           <span>3 pasos</span>
           <span>Desde 3 años</span>
           <span>Sin cocción</span>
         </div>
       </div>
       <div class="afl-recipe-cards">
         <!-- afl-card-item data-id="mezclar" etc. -->
       </div>
       <div class="afl-recipe-steps">
         <div class="afl-recipe-step">
           <span class="step-num">1</span>
           <p>Instrucción del paso.</p>
         </div>
       </div>
     </div>
   ─────────────────────────────────────────────────────────────── */

.afl-recipe {
  background: var(--bl);
  border: 1px solid rgba(193,122,92,0.16);
  margin: 40px 0;
  overflow: hidden;
}
.afl-recipe-header {
  background: var(--ng);
  padding: 24px 28px;
}
.afl-recipe-header h3 {
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
  color: var(--cr);
  margin-bottom: 8px !important;
  margin-top: 0 !important;
}
.afl-recipe-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.afl-recipe-meta span {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,241,232,0.5);
}
.afl-recipe-meta span::before {
  content: '·';
  margin-right: 8px;
  color: var(--tc);
}
.afl-recipe-meta span:first-child::before { display: none; }
.afl-recipe-cards {
  padding: 24px 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(193,122,92,0.12);
}
.afl-recipe-cards-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tc);
  width: 100%;
  margin-bottom: -4px;
}
/* Chips de tarjeta dentro de receta */
.afl-recipe-chip {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ng);
  background: var(--cr);
  border: 1px solid rgba(193,122,92,0.22);
  padding: 4px 12px;
}
.afl-recipe-steps { padding: 24px 28px; }
.afl-recipe-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.afl-recipe-step:last-child { margin-bottom: 0; }
.step-num {
  font-family: 'EB Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--tc);
  opacity: 0.5;
  line-height: 1.3;
  flex-shrink: 0;
  width: 24px;
}
.afl-recipe-step p {
  font-size: 1rem !important;
  color: var(--gs) !important;
  line-height: 1.7 !important;
  margin: 0 !important;
}


/* ── RESPONSIVE ──────────────────────────────────────────────────*/

/* ── Formulario novedades — variante oscura ── */
.afl-form-wrap--dark {
  background: var(--ng);
  max-width: 860px;
}
.afl-form-wrap--dark::before { background: var(--tc); }
.afl-form-wrap--dark .fh { color: var(--cr); }
.afl-form-wrap--dark .fsh { color: rgba(245,241,232,0.5); }
.afl-form-wrap--dark .flbl { color: rgba(245,241,232,0.5); }
.afl-form-wrap--dark .finput {
  background: rgba(245,241,232,0.06);
  border-color: rgba(245,241,232,0.15);
  color: var(--cr);
}
.afl-form-wrap--dark .finput::placeholder { color: rgba(245,241,232,0.25); }
.afl-form-wrap--dark .finput:focus { border-color: var(--tc); }
.afl-form-wrap--dark .fsub { background: var(--tc); color: var(--bl); }
.afl-form-wrap--dark .fsub:hover { background: var(--cr); color: var(--ng); }
.afl-form-wrap--dark .flegal { color: rgba(245,241,232,0.3); }
.afl-form-wrap--dark .flegal a { color: var(--tcl); }
.afl-form-wrap--dark .fstitle { color: var(--cr); }
.afl-form-wrap--dark .fstext { color: rgba(245,241,232,0.6); }

@media(max-width: 768px) {
  .afl-quote { padding: 24px 28px; }
  .afl-quote.centered { padding: 32px 24px; }
  .afl-cta-block { padding: 40px 24px; margin: 40px 0; }
  .afl-cta-block.compact { margin: 32px 0; }
  .afl-cards-inline { gap: 10px; }
  .afl-card-item { width: 110px; }
  .afl-cards-inline.single .afl-card-item { width: 140px; }
  .afl-form-wrap { padding: 28px 24px; }
  .afl-recipe-header,.afl-recipe-cards,.afl-recipe-steps { padding: 20px; }
}

.afl-toc a.is-active {
  color: var(--tc);
  font-weight: 500;
}

/* Sublistas del TOC (h3 bajo h2) */
.afl-toc ol ol {
  margin-top: 6px;
  margin-left: 16px;
  counter-reset: toc-sub;
}
.afl-toc ol ol li {
  font-size: 0.77rem;
  margin-bottom: 5px;
  counter-increment: toc-sub;
}
.afl-toc ol ol li::before {
  content: counter(toc) '.' counter(toc-sub);
  font-size: 0.68rem;
}
.afl-toc ol ol a { color: rgba(138,133,120,0.7); }
.afl-toc ol ol a:hover,
.afl-toc ol ol a.is-active { color: var(--tc); }







