/* =========================
   blog.css
   Estilos específicos para el blog
   Óptica Olivares
   ========================= */

/* ── Blog Hero ───────────────────────────────── */
.blog-hero {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 8px;
}

.blog-hero p {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Blog Grid (Índice) ───────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.blog-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}

.blog-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Pill de categoría */
.blog-card-category-pill {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.55);
}

.blog-card--categoria-salud-visual .blog-card-category-pill {
  color: #85B7EB;
}

.blog-card--categoria-guias .blog-card-category-pill {
  color: #97C459;
}

:root[data-theme="light"] .blog-card-category-pill {
  background: rgba(255, 255, 255, 0.92);
}

:root[data-theme="light"] .blog-card--categoria-salud-visual .blog-card-category-pill {
  color: #185FA5;
}

:root[data-theme="light"] .blog-card--categoria-guias .blog-card-category-pill {
  color: #3B6D11;
}

/* Badge "Nuevo" */
.blog-card-badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  background: #EF9F27;
  color: #412402;
}

/* ── Footer (meta + link) ────────────────────────── */
.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.blog-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.blog-card-readtime::before {
  content: "·";
  margin-right: 12px;
}

/* ── Text Link ───────────────────────────────────── */
.blog-card-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--hero-wa-bg);
  color: var(--hero-wa-bg);
  transition: background 0.15s ease, color 0.15s ease;
}

.blog-card-link:hover {
  background: var(--hero-wa-bg);
  color: var(--bg);
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .blog-card:hover .blog-card-image img {
    transform: scale(1.05);
  }
}

.blog-card-content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.blog-card-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hero-wa-bg);
  background: var(--chip);
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

.blog-card h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0;
}

.blog-card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.blog-card h2 a:hover {
  color: var(--hero-wa-bg);
}

.blog-card-excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.blog-card-readtime::before {
  content: "·";
  margin-right: 12px;
}

.blog-card .btn {
  margin-top: 8px;
  width: fit-content;
}

/* ── Article (Artículo Individual) ────────────── */
.blog-article {
  padding: 32px 0 48px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--hero-wa-bg);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.2;
  margin: 12px 0;
}

.article-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
}

.article-content p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: var(--text);
}

.article-content h2 {
  font-size: 24px;
  margin: 36px 0 16px;
  padding-top: 20px;
}

.article-content h3 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 20px;
  padding-left: 24px;
}

.article-content li {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--text);
}

/* ── Article Image ─────────────────────────────── */
.article-image {
  margin: 24px 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-image img {
  width: 100%;
  height: auto;
  display: block;
}

.article-image figcaption {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  background: var(--panel);
  font-style: italic;
}

.article-content h3 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 20px;
  padding-left: 24px;
}

.article-content li {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--text);
}

/* ── Article CTA ─────────────────────────────── */
.article-cta {
  max-width: 720px;
  margin: 48px auto 0;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.article-cta h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.article-cta p {
  color: var(--muted);
  margin-bottom: 20px;
}

.article-cta .btn {
  display: inline-flex;
  margin-bottom: 16px;
}

.article-backlink {
  display: block;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.article-backlink:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .blog-hero {
    padding: 32px 0;
  }

  .blog-hero h1 {
    font-size: 28px;
  }

  .blog-hero p {
    font-size: 16px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-card {
    padding: 0;
  }

  .blog-card .blog-card-content {
    padding: 16px 20px;
  }

  .blog-card h2 {
    font-size: 20px;
  }

  .article-header h1 {
    font-size: 26px;
  }

  .article-content p {
    font-size: 16px;
  }

  .article-content h2 {
    font-size: 22px;
  }

  .article-cta {
    padding: 24px 20px;
  }
}

/* ── Light mode link overrides ───────────────────── */
:root[data-theme="light"] .blog-card-link { color: var(--link-color); border-color: var(--link-color); }
:root[data-theme="light"] .blog-card-link:hover { background: var(--link-color); color: white; }
:root[data-theme="light"] .blog-card h2 a:hover { color: var(--link-color); }
:root[data-theme="light"] .blog-card-category { color: var(--link-color); }
