/* ============================================================================
   LATICON — Blog (listado + artículos)
   Requiere styles.css (variables y componentes base)
   ========================================================================== */

/* Switch de idioma como enlaces (artículos ES↔EN) */
.lang a {
  font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .04em;
  padding: 6px 12px; border-radius: 100px; color: var(--ink-3); transition: all .25s var(--ease);
}
.lang a.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }

/* ------------------------------- Listado --------------------------------- */
.blog-hero {
  position: relative; isolation: isolate; color: #fff; overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding-block: clamp(160px, 20vw, 220px) clamp(50px, 7vw, 80px);
  background:
    linear-gradient(180deg, rgba(6,36,23,.72) 0%, rgba(10,61,37,.62) 55%, rgba(6,36,23,.86) 100%),
    linear-gradient(115deg, rgba(16,103,53,.35) 0%, rgba(6,36,23,.15) 55%, rgba(10,61,37,.4) 100%),
    url("../img/blog/blog-hero-bg.jpg") center/cover no-repeat;
  background-color: var(--brand-900);
}
.blog-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.blog-hero .eyebrow { color: var(--brand-300); }
.blog-hero h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 3.2rem); max-width: 800px; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.blog-hero .lead { color: rgba(255,255,255,.9); margin-top: 16px; max-width: 640px; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-block: clamp(40px, 6vw, 72px); }
.post-card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.post-card__media { aspect-ratio: 16/9; overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-card__body { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card__tag { font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.post-card h3 { font-size: 1.18rem; line-height: 1.25; }
.post-card p { font-size: .92rem; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--ink-3); }
.post-card__meta::before { content: ""; width: 18px; height: 2px; background: var(--brand-bright); border-radius: 2px; }

/* ------------------------------- Artículo -------------------------------- */
.article-hero { position: relative; isolation: isolate; color: #fff; display: flex; align-items: flex-end; min-height: clamp(420px, 58vh, 560px); }
.article-hero__media { position: absolute; inset: 0; z-index: -2; }
.article-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.article-hero__overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6,36,23,.55) 0%, rgba(6,36,23,.25) 40%, rgba(6,36,23,.88) 100%); }
.article-hero__inner { width: 100%; max-width: 900px; margin-inline: auto; padding: 150px var(--gutter) 46px; }
.article-hero .post-card__tag { color: var(--brand-300); }
.article-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.7rem); margin-top: 12px; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.article-hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: .82rem; color: rgba(255,255,255,.75); }
.article-hero__meta b { color: #fff; font-weight: 600; }

.article { max-width: 760px; margin-inline: auto; padding: clamp(40px, 6vw, 64px) var(--gutter) 20px; }
.article > p, .article li { font-size: 1.02rem; line-height: 1.75; color: var(--ink-2); }
.article > p + p { margin-top: 18px; }
.article h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin: 44px 0 14px; }
.article h3 { font-size: 1.12rem; margin: 30px 0 10px; }
.article ul, .article ol { margin: 16px 0 16px 22px; display: grid; gap: 9px; }
.article ul { list-style: none; margin-left: 0; }
.article ul li { padding-left: 26px; position: relative; }
.article ul li::before { content: ""; position: absolute; left: 0; top: .58em; width: 14px; height: 2px; background: var(--brand-bright); border-radius: 2px; }
.article ol { list-style: decimal; margin-left: 24px; }
.article ol li::marker { color: var(--brand); font-weight: 700; font-family: var(--font-display); }
.article strong { color: var(--ink); }
.article a { color: var(--brand); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(16,103,53,.3); text-underline-offset: 3px; transition: text-decoration-color .3s; }
.article a:hover { text-decoration-color: var(--brand); }

.article figure { margin: 34px 0; }
.article figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.article figcaption { font-size: .8rem; color: var(--ink-3); margin-top: 10px; text-align: center; }

.article blockquote {
  margin: 30px 0; padding: 22px 26px; background: var(--mint-2); border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 1.02rem; color: var(--ink);
}

.keybox { margin: 30px 0; padding: 24px 26px; background: var(--brand-900); color: #fff; border-radius: var(--radius); }
.keybox h3 { color: var(--brand-300); margin: 0 0 10px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.keybox p, .keybox li { color: rgba(255,255,255,.85); font-size: .96rem; }
.keybox ul li::before { background: var(--brand-300); }

/* FAQ */
.faq { margin: 40px 0 10px; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 20px; font-family: var(--font-display); font-weight: 600; font-size: .98rem; color: var(--ink); list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brand); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 20px 18px; font-size: .95rem; }

/* CTA final */
.article-cta {
  margin: 44px 0 0; padding: clamp(28px, 4vw, 40px);
  background: radial-gradient(120% 200% at 100% 0%, rgba(34,168,95,.25), transparent 55%), linear-gradient(120deg, var(--brand-900), var(--brand-800));
  border-radius: var(--radius-lg); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
}
.article-cta h3 { color: #fff; font-size: 1.3rem; margin-bottom: 6px; }
.article-cta p { color: rgba(255,255,255,.8); font-size: .94rem; max-width: 460px; }

/* Botones dentro de artículos: gana la especificidad del enlace del contenido, así que forzamos blanco */
.article .btn-primary, .article-cta .btn-primary { color: #fff; text-decoration: none; }
.article .btn-primary:hover, .article-cta .btn-primary:hover { color: #fff; text-decoration: none; }
.article .btn-ghost, .article-cta .btn-ghost { text-decoration: none; }

/* Relacionados / navegación de artículo */
.article-nav { max-width: 760px; margin: 0 auto; padding: 30px var(--gutter) clamp(56px, 8vw, 90px); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.article-nav a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--brand); }
.article-nav a:hover { color: var(--brand-bright); }
.article-nav svg { width: 16px; height: 16px; stroke: currentColor; }

/* Responsive */
@media (max-width: 1080px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .post-grid { grid-template-columns: 1fr; } .article-cta { flex-direction: column; align-items: flex-start; } }
