/* =====================================================================
   _public_html/blog/assets/css/blog.css
   Estilos ESPECÍFICOS del módulo blog.
   Complementan /assets/css/estilos.css (no lo reemplazan).
   Usan variables --brand-* del sistema corporativo.
   ===================================================================== */

/* ====== Variables locales del blog ====== */
.blog-scope {
    --blog-bg-soft: #f8fafc;
    --blog-bg-app: #f4f6f9;
    --blog-text: #1e293b;
    --blog-muted: #64748b;
    --blog-border: #e2e8f0;
    --blog-shadow-soft: 0 4px 15px rgba(0,0,0,0.04);
    --blog-shadow-card: 0 8px 25px rgba(0,0,0,0.07);
    --blog-radius: 16px;
    --blog-radius-pill: 50px;
}

/* ====== Hero del blog (gradient corporativo) ====== */
.blog-hero {
    background: linear-gradient(135deg, #17355C 0%, #2A61A8 100%);
    padding: 55px 0 45px 0;
    color: #fff;
}
.blog-hero h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 2.2rem;
    margin: 0 0 12px 0;
    color: #fff;
}
.blog-hero p {
    color: rgba(255,255,255,0.8);
    font-family: sans-serif;
    font-size: 1.05rem;
    max-width: 720px;
    margin: 0;
    font-weight: normal;
    text-transform: none;
}
.blog-hero .breadcrumb-blog {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 12px;
}
.blog-hero .breadcrumb-blog a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}
.blog-hero .breadcrumb-blog a:hover { color: #fff; }
.blog-hero .breadcrumb-blog .sep { margin: 0 8px; opacity: 0.5; }

/* ====== Layout del blog ====== */
.blog-section { padding: 50px 0 40px 0; background: #f4f6f9; }
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 40px;
}
@media (max-width: 991px) {
    .blog-layout { grid-template-columns: 1fr; gap: 30px; }
    .blog-sidebar { order: 2; }
}

/* ====== Cards de posts (listado) ====== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.post-card {
    background: white;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow-soft);
    transition: all .2s;
    display: flex; flex-direction: column;
    border: none;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blog-shadow-card);
}
.post-card > a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.post-card > a:hover { text-decoration: none; color: inherit; }

.post-card-img {
    background: var(--blog-bg-app);
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
}
.post-card-img img {
    width: 100%; height: 100%; object-fit: cover; transition: transform .4s;
    display: block;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-img.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-header) 0%, var(--brand-primary) 100%);
    color: rgba(255,255,255,0.4);
}
.post-card-img.placeholder i { font-size: 56px; }

.post-card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card-meta {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    font-size: .76rem;
    color: var(--blog-muted);
    margin-bottom: 10px;
    font-family: sans-serif;
    text-transform: none; font-weight: normal;
}
.post-card-cat {
    background: rgba(42,97,168,0.1);
    color: var(--brand-primary);
    padding: 4px 12px;
    border-radius: var(--blog-radius-pill);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-size: .68rem;
    font-family: 'Open Sans', sans-serif;
}
.post-card h2 {
    font-size: 1.12rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--brand-header);
    margin: 0 0 8px 0;
    letter-spacing: -0.2px;
    font-family: 'Open Sans', sans-serif;
}
.post-card-excerpt {
    color: var(--blog-muted);
    font-size: .9rem;
    line-height: 1.55;
    flex: 1;
    margin: 0 0 14px 0;
    font-family: sans-serif;
    font-weight: normal;
    text-transform: none;
}
.post-card-foot {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .78rem; color: var(--blog-muted);
    border-top: 1px solid var(--blog-border);
    padding-top: 12px;
    font-family: sans-serif; font-weight: normal; text-transform: none;
}
.post-card-foot i { margin-right: 4px; opacity: 0.7; }

/* ====== Sidebar ====== */
.sidebar-card {
    background: white;
    border-radius: var(--blog-radius);
    padding: 22px;
    box-shadow: var(--blog-shadow-soft);
    margin-bottom: 20px;
}
.sidebar-card h3 {
    font-size: .82rem;
    font-weight: 800;
    color: var(--blog-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 0 0 14px 0;
    font-family: 'Open Sans', sans-serif;
}
.sidebar-card .cat-list { list-style: none; margin: 0; padding: 0; }
.sidebar-card .cat-list li { margin-bottom: 6px; }
.sidebar-card .cat-list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 14px; border-radius: 10px;
    color: var(--brand-header); font-weight: 600; font-size: .9rem;
    transition: background .15s;
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
}
.sidebar-card .cat-list a:hover { background: var(--blog-bg-app); }
.sidebar-card .cat-list a.active { background: var(--brand-header); color: #fff; }
.sidebar-card .cat-list .count {
    background: var(--blog-bg-app); color: var(--blog-muted);
    padding: 2px 10px; border-radius: var(--blog-radius-pill);
    font-size: .72rem; font-weight: 700;
}
.sidebar-card .cat-list a.active .count { background: rgba(255,255,255,0.18); color: #fff; }

.cta-card-wa {
    background: linear-gradient(135deg, #25D366 0%, #1eb558 100%);
    color: white;
    padding: 26px;
    border-radius: var(--blog-radius);
    text-align: center;
    box-shadow: var(--blog-shadow-card);
}
.cta-card-wa h3 {
    color: white; text-transform: none; letter-spacing: -0.3px;
    font-size: 1.1rem; font-weight: 800; margin-bottom: 8px;
    font-family: 'Open Sans', sans-serif;
}
.cta-card-wa p {
    font-size: .88rem; opacity: 0.95; margin: 0 0 14px 0;
    font-family: sans-serif; font-weight: normal; text-transform: none;
}
.cta-card-wa .btn-wa {
    background: white;
    color: #25D366;
    padding: 10px 22px;
    border-radius: var(--blog-radius-pill);
    font-weight: 800;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .15s;
    text-decoration: none;
}
.cta-card-wa .btn-wa:hover { transform: scale(1.05); text-decoration: none; color: #25D366; }

/* ====== Vista de post individual ====== */
.post-cat-badge {
    background: rgba(255,255,255,0.18);
    color: #fff;
    padding: 5px 14px;
    border-radius: var(--blog-radius-pill);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    display: inline-block;
    margin-bottom: 14px;
    text-decoration: none;
    font-family: 'Open Sans', sans-serif;
}
.post-cat-badge:hover { background: rgba(255,255,255,0.28); color: #fff; text-decoration: none; }

.post-title {
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    line-height: 1.15;
    margin: 0 0 16px 0;
    font-size: 2.3rem;
    font-family: 'Open Sans', sans-serif;
}
.post-bajada {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
    margin: 0 0 22px 0;
    font-family: sans-serif;
    font-weight: normal;
    text-transform: none;
}
.post-meta {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    color: rgba(255,255,255,0.75);
    font-size: .88rem;
    font-family: sans-serif;
    font-weight: normal;
    text-transform: none;
}
.post-meta .author { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
.post-meta .dot { color: rgba(255,255,255,0.4); }
.post-veh-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 5px 12px;
    border-radius: var(--blog-radius-pill);
    font-size: .82rem;
    font-weight: 700;
}

.post-hero-img {
    margin: 26px 0 0 0;
}
.post-hero-img img {
    width: 100%;
    border-radius: var(--blog-radius);
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}
.post-hero-img figcaption {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: .82rem;
    margin-top: 10px;
    font-family: sans-serif;
}

/* ====== Contenido prose ====== */
.post-body-wrap { background: #fff; padding: 50px 0; }
.prose {
    font-size: 1.05rem;
    line-height: 1.78;
    color: var(--blog-text);
    font-family: 'Open Sans', sans-serif;
    font-weight: normal;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--brand-header);
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-top: 2.2rem;
    margin-bottom: .9rem;
    font-family: 'Open Sans', sans-serif;
}
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.22rem; }
.prose h4 { font-size: 1.08rem; }
.prose p { margin: 0 0 1.2rem 0; }
.prose a { color: var(--brand-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 1rem 0 1.4rem 0; padding-left: 24px; }
.prose ul li, .prose ol li { margin-bottom: 6px; }
.prose blockquote {
    border-left: 4px solid var(--brand-primary);
    background: var(--blog-bg-soft);
    padding: 14px 22px;
    margin: 1.4rem 0;
    border-radius: 0 12px 12px 0;
    color: #475569;
    font-style: italic;
}
.prose code {
    background: var(--blog-bg-soft);
    color: #be123c;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .92em;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.prose pre {
    background: var(--brand-header);
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: .88em;
}
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose img {
    border-radius: var(--blog-radius);
    margin: 1.4rem auto;
    box-shadow: var(--blog-shadow-soft);
    display: block;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--blog-border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--blog-bg-soft); font-weight: 700; color: var(--brand-header); }
.prose hr { border: none; border-top: 1px solid var(--blog-border); margin: 2rem 0; }

/* ====== CTA WhatsApp inline ====== */
.cta-wa-inline {
    background: linear-gradient(135deg, #25D366 0%, #1eb558 100%);
    color: white;
    padding: 28px 32px;
    border-radius: 20px;
    margin: 40px 0;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    box-shadow: var(--blog-shadow-card);
}
.cta-wa-inline .ico i { font-size: 56px; flex-shrink: 0; }
.cta-wa-inline .txt { flex: 1; min-width: 240px; }
.cta-wa-inline h4 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
    font-family: 'Open Sans', sans-serif;
}
.cta-wa-inline p {
    margin: 0; opacity: 0.95; font-size: .94rem;
    font-family: sans-serif; font-weight: normal; text-transform: none;
}
.cta-wa-inline .btn-wa {
    background: white; color: #25D366;
    padding: 12px 24px; border-radius: var(--blog-radius-pill);
    font-weight: 800; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .15s; flex-shrink: 0;
}
.cta-wa-inline .btn-wa:hover { transform: scale(1.05); text-decoration: none; color: #25D366; }

/* ====== Galería del post ====== */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 40px 0 0 0;
}
.post-gallery figure { margin: 0; }
.post-gallery img {
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow-soft);
    width: 100%; height: 180px; object-fit: cover;
    display: block;
}
.post-gallery figcaption {
    text-align: center; color: var(--blog-muted);
    font-size: .8rem; margin-top: 6px;
    font-family: sans-serif;
}

/* ====== Posts relacionados ====== */
.related-posts {
    background: var(--blog-bg-soft);
    padding: 50px 0 60px 0;
    border-top: 1px solid var(--blog-border);
}
.related-posts h2 {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-header);
    margin: 0 0 30px 0;
    letter-spacing: -0.4px;
    font-family: 'Open Sans', sans-serif;
}

/* ====== Paginación ====== */
.pagination-blog {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    list-style: none;
    padding: 0;
}
.pagination-blog a, .pagination-blog span {
    background: white;
    border: 1px solid var(--blog-border);
    color: var(--brand-header);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none;
    transition: all .15s;
    font-family: 'Open Sans', sans-serif;
}
.pagination-blog a:hover { background: var(--blog-bg-app); text-decoration: none; }
.pagination-blog .current { background: var(--brand-header); color: #fff; border-color: var(--brand-header); }
.pagination-blog .disabled { opacity: .4; cursor: not-allowed; }

/* ====== Empty / mensajes ====== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--blog-muted);
    font-family: sans-serif;
}
.empty-state i { font-size: 64px; opacity: .3; margin-bottom: 12px; color: var(--brand-primary); }
.empty-state h3 { color: var(--brand-header); font-weight: 700; margin-top: 12px; font-family: 'Open Sans', sans-serif; }

/* ====== Ajustes mobile ====== */
@media (max-width: 768px) {
    .post-title { font-size: 1.7rem; }
    .post-bajada { font-size: 1rem; }
    .blog-hero h1 { font-size: 1.7rem; }
    .prose { font-size: 1rem; }
    .cta-wa-inline { padding: 22px; gap: 16px; }
    .cta-wa-inline .ico i { font-size: 42px; }
    .cta-wa-inline h4 { font-size: 1.1rem; }
}
