/* Blog público MGID News */
:root {
    --bg: #f8fafc;
    --card: #fff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header { background: #0f172a; color: #fff; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 16px; flex-wrap: wrap; }
.brand { font-size: 1.25rem; font-weight: 800; color: #fff; text-decoration: none; }
.brand span { color: #38bdf8; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a { color: #94a3b8; padding: 6px 10px; border-radius: 6px; font-size: 0.9rem; text-decoration: none; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-cta { background: #3b82f6 !important; color: #fff !important; }

.hero { padding: 36px 0 20px; }
.hero h1 { font-size: 1.85rem; margin-bottom: 6px; }
.hero p { color: var(--muted); }

.layout-blog, .article-page {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    padding-bottom: 48px;
}
.posts-grid { display: flex; flex-direction: column; gap: 24px; }
.post-card {
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 240px 1fr;
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.post-thumb img { width: 100%; height: 100%; min-height: 160px; object-fit: cover; display: block; }
.post-body { padding: 18px 20px; }
.post-body h2 { font-size: 1.15rem; margin: 6px 0 8px; line-height: 1.35; }
.post-body h2 a { color: var(--text); text-decoration: none; }
.post-body h2 a:hover { color: var(--primary); }
.excerpt { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 0.8rem; color: var(--muted); }
.cat { display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); font-weight: 600; text-decoration: none; }

.sidebar-blog { display: flex; flex-direction: column; gap: 16px; }
.widget-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.widget-box h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px; }
.cat-list { list-style: none; }
.cat-list li { margin-bottom: 6px; }
.cat-list a { color: var(--text); font-size: 0.92rem; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 20px 0 40px; }
.pagination a {
    padding: 8px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--border);
    color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Artículo */
.article { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; }
.article h1 { font-size: 1.9rem; line-height: 1.25; margin: 8px 0 12px; }
.article .featured { width: 100%; border-radius: 12px; margin: 20px 0; max-height: 420px; object-fit: cover; }
.article .content { font-size: 1.05rem; line-height: 1.75; }
.article .content p { margin-bottom: 1.1em; }
.article .content h2 { font-size: 1.3rem; margin: 1.4em 0 0.6em; }
.article .content ul, .article .content ol { margin: 0 0 1.1em 1.3em; }
.section-label {
    margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border);
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px;
}
.related { margin-top: 36px; }
.related h3 { margin-bottom: 14px; font-size: 1.1rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card {
    border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text);
    font-size: 0.88rem; font-weight: 600; transition: box-shadow 0.2s;
}
.related-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-decoration: none; }
.related-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.related-card span { display: block; padding: 10px 12px; }

.site-footer { background: #0f172a; color: #94a3b8; padding: 28px 0; font-size: 0.88rem; text-align: center; }
.site-footer a { color: #38bdf8; }
.empty { color: var(--muted); padding: 40px; text-align: center; }

@media (max-width: 860px) {
    .layout-blog, .article-page { grid-template-columns: 1fr; }
    .post-card { grid-template-columns: 1fr; }
    .post-thumb img { min-height: 180px; max-height: 220px; }
    .related-grid { grid-template-columns: 1fr; }
    .article { padding: 20px; }
}

/* —— Single post abierto (sin cards) —— */
body.single-post { background: #fff; }
.post-open { padding: 28px 0 8px; }
.post-open-inner { max-width: 720px; margin: 0 auto; }
.post-cat {
  display: inline-block; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #2563eb; margin-bottom: 12px;
}
.post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2; letter-spacing: -.02em;
  font-weight: 800; color: #0f172a; margin-bottom: 12px;
}
.post-excerpt {
  font-size: 1.15rem; color: #475569; line-height: 1.55;
  margin-bottom: 16px; font-weight: 400;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  font-size: .88rem; color: #64748b;
  padding-bottom: 20px; margin-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}
.post-featured { margin: 0 0 28px; }
.post-featured img {
  width: 100%; height: auto; max-height: 480px;
  object-fit: cover; display: block;
}
.post-body {
  font-size: 1.08rem; line-height: 1.75; color: #1e293b;
}
.post-body p { margin-bottom: 1.1em; }
.post-body h2, .post-body h3 { margin: 1.4em 0 .6em; color: #0f172a; }
.post-body img { max-width: 100%; height: auto; margin: 1em 0; }
.post-body a { color: #2563eb; }
.post-body ul, .post-body ol { margin: 0 0 1.1em 1.25rem; }
.post-tags { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags .tag {
  font-size: .78rem; padding: 4px 12px; border-radius: 999px;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}

/* Ad slots */
.ad-slot { margin: 20px auto; padding: 12px 0; }
.ad-slot-top { max-width: 1100px; padding-top: 16px; }
.ad-slot-under { max-width: 720px; margin: 32px auto; padding: 24px 20px; border-top: 1px solid #e2e8f0; }
.ad-slot-footer { margin-bottom: 24px; }
.ad-label {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  color: #94a3b8; margin-bottom: 8px;
}

/* Related open list */
.related-open { max-width: 720px; margin: 0 auto 40px; padding: 0 20px; }
.related-open h2 { font-size: 1.15rem; margin-bottom: 14px; color: #0f172a; }
.related-list { list-style: none; }
.related-list li { border-top: 1px solid #e2e8f0; }
.related-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; color: #0f172a; text-decoration: none; font-weight: 600;
}
.related-list a:hover { color: #2563eb; }
.related-list img {
  width: 88px; height: 56px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}

.site-footer-blog {
  background: #0f172a; color: #94a3b8; padding: 32px 0 24px; margin-top: 24px;
}
.site-footer-blog .footer-links { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 12px; }
.site-footer-blog .footer-links a { color: #cbd5e1; font-size: .9rem; }
.site-footer-blog .footer-copy { font-size: .8rem; color: #64748b; }

/* Listado: menos “card”, más editorial */
.posts-grid.editorial .post-card {
  background: transparent; border: none; border-radius: 0;
  border-bottom: 1px solid var(--border); padding-bottom: 28px;
  display: grid; grid-template-columns: 200px 1fr; gap: 20px;
}
.posts-grid.editorial .post-card img {
  width: 100%; height: 130px; object-fit: cover; border-radius: 4px;
}
@media (max-width: 600px) {
  .posts-grid.editorial .post-card { grid-template-columns: 1fr; }
}
