:root {
    --blog-green: #22C55E;
    --blog-blue: #2563EB;
    --blog-bg: #F1F5F9;
    --blog-text: #0F172A;
    --blog-muted: #475569;
    --blog-border: #DCE5F0;
}

.blog-main,
.faq-main {
    background: linear-gradient(180deg, #f8fbff 0%, var(--blog-bg) 100%);
}

.blog-hero {
    padding: clamp(3rem, 5vw, 4.4rem) 0 2rem;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.18), transparent 35%),
        radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.2), transparent 38%),
        #f8fbff;
    border-bottom: 1px solid var(--blog-border);
}

.blog-hero h1 {
    margin-top: .9rem;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: var(--blog-text);
}

.blog-hero p {
    margin: .8rem 0 0;
    max-width: 72ch;
    color: var(--blog-muted);
    font-size: 1.04rem;
}

.blog-section,
.faq-section {
    padding: clamp(2rem, 4vw, 3rem) 0 4rem;
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: 1.2rem;
}

.blog-filter {
    border: 1px solid var(--blog-border);
    background: #fff;
    color: var(--blog-text);
    border-radius: 999px;
    padding: .5rem .9rem;
    font: inherit;
    font-size: .86rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s ease;
}

.blog-filter.is-active,
.blog-filter:hover {
    border-color: var(--blog-blue);
    color: #fff;
    background: var(--blog-blue);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .95rem;
    align-items: stretch;
}

.blog-card {
    border: 1px solid var(--blog-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .72rem;
    height: 100%;
}

.blog-card-media {
    width: 100%;
    height: 180px;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #ffffff;
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    gap: .72rem;
    flex: 1;
}

.blog-card-cta {
    margin-top: auto;
}

.blog-card-placeholder,
.article-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: .75rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(34, 197, 94, 0.1));
    color: var(--blog-blue);
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.blog-card[hidden],
.faq-group[hidden],
.faq-item[hidden],
.faq-answer[hidden],
#blogEmptyState[hidden],
#faqEmptyState[hidden] {
    display: none !important;
}

.blog-card-category {
    display: inline-flex;
    width: fit-content;
    font-size: .74rem;
    font-weight: 850;
    border-radius: 999px;
    color: var(--blog-blue);
    background: rgba(37, 99, 235, 0.12);
    padding: .32rem .58rem;
}

.blog-card h2,
.blog-card h3 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.2;
    color: var(--blog-text);
}

.blog-card p {
    margin: 0;
    color: var(--blog-muted);
    font-size: .94rem;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
}

.blog-empty {
    margin-top: .8rem;
    color: var(--blog-muted);
    font-weight: 700;
}

.blog-detail {
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    background: #fff;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.blog-back-link {
    font-weight: 800;
    color: var(--blog-blue);
}

.blog-detail-head h1 {
    margin: .6rem 0;
    font-size: clamp(1.7rem, 3.8vw, 2.7rem);
}

.article-hero-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    align-items: center;
    margin-top: .7rem;
}

.article-hero-image {
    width: 360px;
    max-width: 100%;
    height: 300px;
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 32px rgba(15, 23, 42, 0.08);
}

.article-hero-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.article-hero-content {
    min-width: 0;
}

.blog-detail-summary {
    margin: .3rem 0 0;
    color: #334155;
    font-size: 1rem;
    line-height: 1.62;
}

.blog-content h2 {
    margin: 1.5rem 0 .65rem;
    font-size: 1.34rem;
}

.blog-content h3 {
    margin: 1rem 0 .5rem;
    font-size: 1.08rem;
}

.blog-content p,
.blog-content li {
    color: #1e293b;
}

.blog-content ul,
.blog-content ol {
    padding-left: 1.2rem;
}

.blog-content-wrap {
    max-width: 900px;
    margin: 1.4rem auto 0;
}

.article-detail-card {
    max-width: 1180px;
    margin: 0 auto;
}

.article-content {
    max-width: 900px;
    margin: 32px auto 0;
    line-height: 1.75;
}

.blog-cta {
    margin-top: 1.5rem;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.13), #fff);
    border-radius: 16px;
    padding: 1rem;
}

.blog-cta h2 {
    margin: 0 0 .45rem;
    font-size: 1.25rem;
}

.related-posts {
    margin-top: 1.25rem;
}

.related-posts h2 {
    margin-bottom: .7rem;
}

.related-card-media {
    height: 150px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.related-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: #ffffff;
}

.blog-not-found {
    border: 1px solid var(--blog-border);
    border-radius: 18px;
    background: #fff;
    text-align: center;
    padding: 2rem 1rem;
}

.faq-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.faq-categories {
    position: sticky;
    top: 105px;
    display: grid;
    gap: .45rem;
    border: 1px solid var(--blog-border);
    border-radius: 16px;
    background: #fff;
    padding: .7rem;
}

.faq-category {
    border: 1px solid transparent;
    background: transparent;
    color: var(--blog-text);
    border-radius: 10px;
    font: inherit;
    font-size: .9rem;
    font-weight: 800;
    text-align: left;
    padding: .58rem .62rem;
    cursor: pointer;
}

.faq-category:hover,
.faq-category.is-active {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
    color: var(--blog-blue);
}

.faq-content {
    border: 1px solid var(--blog-border);
    border-radius: 16px;
    background: #fff;
    padding: .95rem;
}

.faq-search-wrap {
    display: grid;
    gap: .45rem;
    margin-bottom: .9rem;
    font-weight: 800;
}

.faq-search-wrap input {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: .72rem .8rem;
    font: inherit;
}

.faq-group h2 {
    margin: .45rem 0 .75rem;
    font-size: 1.22rem;
}

.faq-accordion {
    display: grid;
    gap: .5rem;
}

.faq-item {
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    border: 0;
    background: #fff;
    font: inherit;
    font-size: .95rem;
    font-weight: 800;
    color: var(--blog-text);
    padding: .76rem .86rem;
    text-align: left;
    cursor: pointer;
}

.faq-question[aria-expanded="true"] {
    background: rgba(37, 99, 235, 0.06);
}

.faq-answer {
    border-top: 1px solid var(--blog-border);
    padding: .78rem .86rem;
}

.faq-answer p {
    margin: 0;
    color: var(--blog-muted);
}

.faq-icon {
    color: var(--blog-blue);
    font-weight: 900;
}

@media (max-width: 1040px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-hero-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .article-hero-image {
        width: 100%;
        height: 260px;
    }

    .faq-layout {
        grid-template-columns: 1fr;
    }

    .faq-categories {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .blog-grid,
    .faq-categories {
        grid-template-columns: 1fr;
    }

    .blog-card-media {
        height: 160px;
    }
}

/* Sistema uniforme de thumbnails para imágenes de blog/infografías */
.blog-card-media,
.related-card-media {
    background: linear-gradient(135deg, #f8fafc 0%, #eef7f1 100%);
    padding: 10px;
}

.blog-card-media img,
.related-card-media img,
.article-hero-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.article-hero-image {
    padding: 14px;
}
