/* ===== LUMA Blog — diseño moderno ===== */

:root {
    --c-primary:    #2b55b4;
    --c-primary-d:  #1f3f8a;
    --c-primary-l:  #eef3ff;
    --c-accent:     #57c2ee;

    --c-text:       #111827;
    --c-text-soft:  #4b5563;
    --c-text-muted: #9ca3af;

    --c-bg:         #f8fafc;
    --c-bg-card:    #ffffff;
    --c-bg-soft:    #f1f5f9;
    --c-border:     #e5e7eb;
    --c-border-l:   #f3f4f6;

    --shadow-xs:    0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm:    0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md:    0 8px 24px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-lg:    0 18px 48px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .04);

    --radius-sm:    8px;
    --radius:       12px;
    --radius-lg:    16px;
}

* { box-sizing: border-box; }

html, body { height: auto; }
body {
    margin: 0;
    background: var(--c-bg);
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--c-primary); text-decoration: none; transition: color .12s; }
a:hover { color: var(--c-primary-d); }

img { max-width: 100%; display: block; }

/* ----- Header / branding del blog ----- */
.blog-header {
    background: var(--c-bg-card);
    border-bottom: 1px solid var(--c-border);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255, 255, 255, .92);
}
.blog-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.blog-header .blog-brand {
    display: flex; align-items: center; gap: 14px;
    color: var(--c-text); font-weight: 700;
}
.blog-header .blog-brand img { height: 44px; width: auto; }
.blog-header .blog-brand .brand-text {
    font-size: 18px; line-height: 1; color: var(--c-text);
    letter-spacing: -.3px;
}
.blog-header .blog-brand .brand-text small {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--c-primary); letter-spacing: 1.2px;
    text-transform: uppercase; margin-top: 4px;
}
.blog-header a.back-site {
    color: var(--c-text-soft); font-weight: 600; font-size: 14px;
    padding: 8px 16px; border-radius: 24px;
    background: var(--c-bg-soft);
    transition: all .15s;
}
.blog-header a.back-site:hover {
    background: var(--c-primary-l); color: var(--c-primary);
}

/* ----- Container principal ----- */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ----- Hero / título de página ----- */
.blog-hero {
    padding: 50px 0 30px;
    text-align: center;
}
.blog-hero h1 {
    margin: 0 0 8px; font-size: 36px; font-weight: 800;
    color: var(--c-text); letter-spacing: -1px;
}
.blog-hero p {
    margin: 0; color: var(--c-text-soft); font-size: 16px;
}
.blog-hero .breadcrumb {
    margin-top: 12px;
    color: var(--c-text-muted); font-size: 13px;
}
.blog-hero .breadcrumb a { color: var(--c-text-muted); }
.blog-hero .breadcrumb a:hover { color: var(--c-primary); }

/* ----- Layout principal: posts + sidebar ----- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 38px;
    padding: 20px 0 70px;
    align-items: start;
}
@media (max-width: 980px) {
    .blog-layout { grid-template-columns: 1fr; gap: 30px; }
}

/* ----- Cards de post (listado) ----- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 24px;
}
.posts-list { display: flex; flex-direction: column; gap: 28px; }

.post-card {
    background: var(--c-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border-l);
    transition: all .2s ease;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.post-card .post-cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--c-bg-soft);
}
.post-card .post-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s ease;
}
.post-card:hover .post-cover img { transform: scale(1.04); }

.post-card .post-body { padding: 22px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.post-card .post-meta {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    font-size: 12px; color: var(--c-text-muted);
    margin-bottom: 10px;
}
.post-card .post-cat {
    background: var(--c-primary-l); color: var(--c-primary);
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
}
.post-card .post-title {
    margin: 0 0 10px; font-size: 19px; font-weight: 700;
    color: var(--c-text); line-height: 1.3; letter-spacing: -.2px;
}
.post-card .post-title a { color: inherit; }
.post-card .post-title a:hover { color: var(--c-primary); }
.post-card .post-excerpt {
    color: var(--c-text-soft); font-size: 14px; line-height: 1.55;
    margin: 0 0 16px;
}
.post-card .post-cta {
    margin-top: auto;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--c-primary); font-weight: 700; font-size: 13.5px;
}
.post-card .post-cta:after {
    content: '→'; transition: transform .15s;
}
.post-card:hover .post-cta:after { transform: translateX(3px); }

/* Variante destacada: badge + borde lateral */
.post-card.featured {
    box-shadow: 0 0 0 1px var(--c-primary), var(--shadow-sm);
    border-color: transparent;
    position: relative;
}
.post-card.featured::before {
    content: '⭐ Destacado';
    position: absolute; top: 14px; left: 14px;
    background: var(--c-primary); color: #fff;
    padding: 4px 11px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    z-index: 2;
}

/* ----- Sidebar ----- */
.sidebar { display: flex; flex-direction: column; gap: 22px; }
.side-card {
    background: var(--c-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border-l);
    padding: 22px;
    box-shadow: var(--shadow-xs);
}
.side-card h3 {
    margin: 0 0 16px; font-size: 13px; font-weight: 700;
    color: var(--c-text-soft); text-transform: uppercase;
    letter-spacing: .5px; padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border-l);
}
.side-card .brand-mini {
    text-align: center; padding-bottom: 6px;
}
.side-card .brand-mini img { max-width: 140px; height: auto; margin: 0 auto; }
.side-card .brand-mini .btn-back {
    display: inline-block; margin-top: 12px;
    padding: 8px 18px; background: var(--c-accent); color: #fff;
    border-radius: 24px; font-size: 12.5px; font-weight: 600;
    text-decoration: none;
}
.side-card .brand-mini .btn-back:hover { background: var(--c-primary); color: #fff; }

/* Lista de categorías */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { border-bottom: 1px solid var(--c-border-l); }
.cat-list li:last-child { border-bottom: none; }
.cat-list li a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 4px; color: var(--c-text); font-size: 14px;
    font-weight: 500; transition: padding .15s, color .15s;
}
.cat-list li a:hover { color: var(--c-primary); padding-left: 8px; }
.cat-list li a .count {
    color: var(--c-text-muted); font-size: 12px;
    background: var(--c-bg-soft); padding: 2px 9px;
    border-radius: 12px; font-weight: 600;
}
.cat-list li a:hover .count {
    background: var(--c-primary-l); color: var(--c-primary);
}

/* Lista "más leídas" */
.popular-list { list-style: none; padding: 0; margin: 0; }
.popular-list li {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--c-border-l);
}
.popular-list li:last-child { border-bottom: none; }
.popular-list .pop-thumb {
    width: 80px; height: 56px; flex-shrink: 0;
    overflow: hidden; border-radius: var(--radius-sm);
    background: var(--c-bg-soft);
}
.popular-list .pop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-list .pop-info { flex: 1; min-width: 0; }
.popular-list .pop-info .pop-title {
    font-size: 13px; font-weight: 600; color: var(--c-text);
    line-height: 1.35; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.popular-list .pop-info .pop-title a { color: inherit; }
.popular-list .pop-info .pop-title a:hover { color: var(--c-primary); }
.popular-list .pop-info time {
    font-size: 11.5px; color: var(--c-text-muted);
}

/* ----- Detalle de post ----- */
.post-detail {
    background: var(--c-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border-l);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.post-detail .detail-cover {
    aspect-ratio: 16 / 9;
    background: var(--c-bg-soft);
}
.post-detail .detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-detail .detail-body { padding: 36px 42px 42px; }
@media (max-width: 700px) {
    .post-detail .detail-body { padding: 24px 22px 28px; }
}

.post-detail .detail-meta {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px; color: var(--c-text-muted);
}
.post-detail .detail-cat {
    background: var(--c-primary-l); color: var(--c-primary);
    padding: 4px 12px; border-radius: 20px;
    font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
}
.post-detail h1 {
    margin: 0 0 22px; font-size: 32px; font-weight: 800;
    color: var(--c-text); line-height: 1.2; letter-spacing: -.6px;
}
.post-detail .detail-content {
    font-size: 16px; line-height: 1.72; color: var(--c-text);
}
.post-detail .detail-content p { margin: 0 0 1em; }
.post-detail .detail-content h2,
.post-detail .detail-content h3,
.post-detail .detail-content h4 {
    margin: 1.6em 0 .6em; font-weight: 700; color: var(--c-text);
    line-height: 1.3;
}
.post-detail .detail-content h2 { font-size: 24px; }
.post-detail .detail-content h3 { font-size: 20px; }
.post-detail .detail-content h4 { font-size: 17px; }
.post-detail .detail-content img {
    max-width: 100%; height: auto; border-radius: var(--radius);
    margin: 1em 0;
}
.post-detail .detail-content ul,
.post-detail .detail-content ol { padding-left: 26px; }
.post-detail .detail-content li { margin-bottom: .35em; }
.post-detail .detail-content blockquote {
    border-left: 4px solid var(--c-primary);
    background: var(--c-primary-l);
    padding: 14px 20px;
    margin: 1.4em 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic; color: var(--c-text-soft);
}
.post-detail .detail-content a {
    color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px;
}

.post-detail .detail-quote {
    margin-top: 28px; padding: 24px;
    background: linear-gradient(135deg, var(--c-primary-l) 0%, #f7f3e8 100%);
    border-radius: var(--radius);
    font-style: italic; color: var(--c-text);
    font-size: 17px; line-height: 1.6;
    position: relative;
}
.post-detail .detail-quote::before {
    content: '“'; font-family: serif; font-size: 56px;
    color: var(--c-primary); line-height: .8;
    position: absolute; top: 12px; left: 16px; opacity: .3;
}
.post-detail .detail-quote-body { padding-left: 30px; }

.post-detail .detail-back {
    margin-top: 32px; padding-top: 24px;
    border-top: 1px solid var(--c-border-l);
    text-align: right;
}

/* ----- Botones ----- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: 24px;
    background: var(--c-primary); color: #fff;
    font-weight: 600; font-size: 14px;
    text-decoration: none; transition: all .15s;
    border: none; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--c-primary-d); color: #fff; box-shadow: 0 4px 12px rgba(43, 85, 180, .3); }
.btn-outline {
    background: transparent; color: var(--c-primary);
    border: 1px solid var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary-l); color: var(--c-primary-d); }
.btn-soft {
    background: var(--c-bg-soft); color: var(--c-text);
}
.btn-soft:hover { background: var(--c-border); color: var(--c-text); }

/* ----- Sección "Más noticias" ----- */
.more-section {
    margin-top: 38px;
    padding-top: 30px;
    border-top: 1px solid var(--c-border);
}
.more-section h2 {
    margin: 0 0 22px; font-size: 18px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .8px;
    color: var(--c-text-soft);
}
.more-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ----- Empty state ----- */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--c-text-muted);
}
.empty-state h3 { color: var(--c-text-soft); margin: 0 0 8px; font-size: 18px; }

/* ----- Footer mínimo ----- */
.blog-footer {
    background: var(--c-bg-card);
    border-top: 1px solid var(--c-border);
    padding: 28px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 13px; color: var(--c-text-muted);
}
.blog-footer a { color: var(--c-text-soft); margin: 0 10px; font-weight: 600; }
.blog-footer a:hover { color: var(--c-primary); }
