/* ─────────────────────────────────────────────────────────────────────────
   IngePresupuestos — Blog
   Hereda los tokens y el header/footer de ../style.css.
   Aquí solo van los estilos propios del listado y del artículo.
   ──────────────────────────────────────────────────────────────────────── */

/* ============ Cabecera del blog ============ */
.blog-head {
  background: var(--silver-100);
  border-bottom: 1px solid var(--silver-300);
  padding: 56px 0 48px;
  text-align: center;
}
.blog-head h1 {
  font-size: 2.2rem;
  line-height: 1.15;
  color: var(--slate-900);
  margin-bottom: 12px;
}
.blog-head p {
  color: var(--slate-500);
  max-width: 620px;
  margin: 0 auto;
}

/* Migas de pan */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--slate-300);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--slate-500); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span { margin: 0 6px; }

/* ============ Listado de artículos ============ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  padding: 56px 0 72px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--silver-300);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-img);
}
.post-card a { color: inherit; }
.post-card-img {
  aspect-ratio: 16 / 9;
  background: var(--silver-100);
  object-fit: cover;
  width: 100%;
}
.post-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card .tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--orange-dk);
  background: var(--orange-soft);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.post-card h2 {
  font-size: 1.18rem;
  line-height: 1.3;
  color: var(--slate-900);
  margin-bottom: 10px;
}
.post-card:hover h2 { color: var(--orange-dk); }
.post-card p { color: var(--slate-500); font-size: 0.95rem; margin-bottom: 16px; }
.post-card .post-meta { margin-top: auto; font-size: 0.82rem; color: var(--slate-300); }

.blog-empty {
  text-align: center;
  color: var(--slate-300);
  padding: 40px 0;
}

/* ============ Artículo ============ */
.article {
  padding: 48px 0 64px;
}
.article-header { margin-bottom: 36px; }
.article-header .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--orange-dk);
  background: var(--orange-soft);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.article-header h1 {
  font-size: 2.3rem;
  line-height: 1.18;
  color: var(--slate-900);
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--slate-300);
}
.article-meta strong { color: var(--slate-500); font-weight: 600; }

.article-cover {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-img);
  margin: 8px 0 40px;
}
.article-cover-fig { margin: 8px 0 40px; }
.article-cover-fig .article-cover { margin: 0; }
.article-cover-fig figcaption {
  font-size: 0.85rem;
  color: var(--slate-300);
  text-align: center;
  margin-top: 0.6em;
}

/* Cuerpo del artículo: tipografía legible */
.article-body { font-size: 1.06rem; line-height: 1.75; color: var(--slate-700); }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--slate-900);
  margin-top: 2em;
  padding-top: 0.2em;
}
.article-body h3 {
  font-size: 1.25rem;
  color: var(--slate-900);
  margin-top: 1.6em;
}
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-top: 0.4em; }
.article-body a { color: var(--orange); text-decoration: underline; }
.article-body a:hover { color: var(--orange-dk); }
.article-body strong { color: var(--slate-900); }
.article-body img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-img);
  margin: 1.6em 0 0.6em;
}
.article-body figure { margin: 1.8em 0 0.6em; }
.article-body figure img { margin: 0; }
.article-body figcaption {
  font-size: 0.85rem;
  color: var(--slate-300);
  text-align: center;
  margin-top: 0.5em;
}
.figure-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.figure-compare > div { display: flex; flex-direction: column; }
.figure-compare img { width: 100%; height: auto; }
.figure-compare figcaption { margin-top: 0.5em; }
@media (max-width: 640px) {
  .figure-compare { grid-template-columns: 1fr; }
}

/* Lightbox / zoom de imágenes */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 32px;
  background: rgba(15, 23, 32, 0.92);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 95vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lightbox-cap {
  color: #e8edf2;
  font-size: 0.9rem;
  text-align: center;
  max-width: 720px;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }

/* Barra de compartir */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 36px 0;
  padding-top: 24px;
  border-top: 1px solid var(--silver-300);
}
.share-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  width: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  text-decoration: none;
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.92; }
.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-x  { background: #000; }
.share-in { background: #0A66C2; }
.share-copy {
  width: auto;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--slate-700);
  font-size: 0.9rem;
  font-weight: 600;
}
.share-copy.copiado { background: #25A55B; }
@media (max-width: 480px) {
  .share-label { width: 100%; margin-bottom: 4px; }
}
.article-body blockquote {
  border-left: 4px solid var(--orange);
  background: var(--orange-soft);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--slate-700);
  font-style: italic;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  border: 1px solid var(--silver-300);
  padding: 8px 12px;
  text-align: left;
}
.article-body th { background: var(--silver-100); color: var(--slate-900); }

/* Caja CTA dentro/al final del artículo */
.article-cta {
  margin: 48px 0 8px;
  background: var(--slate-900);
  color: var(--white);
  border-radius: var(--radius);
  padding: 36px 40px;
  text-align: center;
}
.article-cta h3 { color: var(--white); font-size: 1.4rem; margin-bottom: 10px; }
.article-cta p { color: #C7D2DD; margin-bottom: 22px; max-width: 540px; margin-left: auto; margin-right: auto; }

/* Caja de autor */
.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--silver-300);
}
.author-box img { width: 56px; height: 56px; border-radius: 50%; }
.author-box .author-name { font-weight: 700; color: var(--slate-900); }
.author-box .author-role { font-size: 0.9rem; color: var(--slate-300); }

/* FAQ del artículo */
.article-faq { margin-top: 48px; }
.article-faq h2 { font-size: 1.6rem; color: var(--slate-900); margin-bottom: 16px; }
.article-faq details {
  border: 1px solid var(--silver-300);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 10px;
}
.article-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--slate-900);
}
.article-faq details[open] summary { margin-bottom: 8px; }
.article-faq p { color: var(--slate-500); }

.article-back { margin-top: 40px; }

@media (max-width: 640px) {
  .article-header h1 { font-size: 1.7rem; }
  .article-body h2 { font-size: 1.35rem; }
  .article-cta { padding: 28px 22px; }
  .blog-head h1 { font-size: 1.7rem; }
}

/* Video embebido responsivo 16:9 */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  margin: 1.6rem 0 1rem;
  background: #101922;
  box-shadow: 0 8px 28px rgba(16, 25, 34, .28);
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
