/* ============================================================
   blog.css — Estilos del blog público de TronzadorasMG
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --blog-primary: #bc2119;
    --blog-primary-light: #fef2f1;
    --blog-success: #198754;
    --blog-success-light: #f0faf5;
    --blog-info: #0d6efd;
    --blog-info-light: #eef4ff;
    --blog-warning-light: #fff8e1;
    --blog-text: #2d2d2d;
    --blog-text-muted: #6c757d;
    --blog-border: #e0e0e0;
    --blog-radius: 0.5rem;
    --blog-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   TIPOGRAFÍA GENERAL DEL ARTÍCULO
   ============================================================ */
.blog-content {
    color: var(--blog-text);
    font-size: 1.05rem;
    line-height: 1.85;
}

.blog-content > *:first-child { margin-top: 0; }

.blog-content h2 {
    font-size: 1.55rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--blog-primary);
    color: var(--blog-text);
}

.blog-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--blog-text);
}

.blog-content h4,
.blog-content .fw-bold.fs-5 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--blog-primary);
    color: var(--blog-text);
}

.blog-content p {
    line-height: 1.85;
    margin-bottom: 1.15rem;
}

.blog-content a:not(.btn) {
    color: var(--blog-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.blog-content a:not(.btn):hover {
    color: #8a1712;
}

/* ============================================================
   LISTAS
   ============================================================ */
.blog-content ul,
.blog-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.blog-content ul li,
.blog-content ol li {
    margin-bottom: 0.55rem;
    line-height: 1.7;
}

.blog-content ul li::marker {
    color: var(--blog-primary);
}

/* ============================================================
   IMÁGENES
   ============================================================ */
.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
    margin: 1rem 0;
}

/* ============================================================
   TABLAS GENERALES
   ============================================================ */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
}

.blog-content table thead th {
    background-color: var(--blog-primary);
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border: none;
}

.blog-content table th,
.blog-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--blog-border);
    vertical-align: middle;
}

.blog-content table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.blog-content table tbody tr:hover {
    background-color: var(--blog-primary-light);
}

/* ============================================================
   CALLOUTS — Cajas destacadas con borde lateral
   ============================================================ */
.blog-content .callout {
    position: relative;
    padding: 1.15rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: var(--blog-radius);
    border-left: 5px solid;
    font-size: 1rem;
}

.blog-content .callout .fw-bold {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

/* Callout Primary (intro) */
.blog-content .callout.primary {
    background-color: var(--blog-primary-light);
    border-left-color: var(--blog-primary);
}

/* Callout Success (recomendaciones) */
.blog-content .callout.success {
    background-color: var(--blog-success-light);
    border-left-color: var(--blog-success);
}

/* Callout Info (resumen, notas) */
.blog-content .callout.info {
    background-color: var(--blog-info-light);
    border-left-color: var(--blog-info);
}

/* ============================================================
   ALERTS — Sobreescribir Bootstrap para coherencia
   ============================================================ */
.blog-content .alert {
    border-radius: var(--blog-radius);
    border-left: 5px solid;
    font-size: 0.97rem;
    margin: 1.5rem 0;
}

.blog-content .alert-info {
    background-color: var(--blog-info-light);
    border-left-color: var(--blog-info);
    color: #1a3a6c;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.blog-content .alert-warning {
    background-color: var(--blog-warning-light);
    border-left-color: #f0ad4e;
    color: #664d03;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

/* ============================================================
   SHORTCODE: PRODUCTO (ficha card)
   ============================================================ */
.shortcode-product-card {
    margin: 1.75rem 0;
    border: none !important;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shortcode-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.shortcode-product-card img {
    object-fit: contain;
    padding: 0.75rem;
    max-height: 220px;
    box-shadow: none;
    margin: 0;
}

.shortcode-product-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shortcode-product-card .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blog-text);
    border-bottom: none;
    margin-top: 0;
    padding-bottom: 0;
}

.shortcode-product-card .card-text {
    font-size: 0.92rem;
    color: var(--blog-text-muted);
    line-height: 1.6;
}

.shortcode-product-card .btn {
    align-self: flex-start;
}

/* ============================================================
   SHORTCODE: RECOMENDAR (tarjeta destacada)
   ============================================================ */
.shortcode-recommend-card {
    margin: 2rem 0;
    border: none !important;
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(188, 33, 25, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shortcode-recommend-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(188, 33, 25, 0.18);
}

.shortcode-recommend-card .card-header {
    background-color: var(--blog-primary) !important;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-bottom: none;
}

.shortcode-recommend-card img {
    object-fit: contain;
    max-height: 260px;
    box-shadow: none;
    margin: 0;
}

.shortcode-recommend-card .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blog-text);
    border-bottom: none;
    margin-top: 0;
    padding-bottom: 0;
}

.shortcode-recommend-card .card-text {
    font-size: 0.95rem;
    color: var(--blog-text-muted);
    line-height: 1.65;
}

/* ============================================================
   SHORTCODE: COMPARAR (tabla comparativa)
   ============================================================ */
.shortcode-compare-table {
    margin: 2rem 0;
}

.shortcode-compare-table .table {
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
    border: none;
}

.shortcode-compare-table .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--blog-primary);
    vertical-align: middle;
    text-align: center;
}

.shortcode-compare-table .table thead th img {
    border-radius: 0.35rem;
    box-shadow: none;
    margin: 0;
    transition: transform 0.3s ease;
}

.shortcode-compare-table .table thead th img:hover {
    transform: scale(1.08);
}

.shortcode-compare-table .table tbody td {
    vertical-align: middle;
    font-size: 0.93rem;
}

.shortcode-compare-table .table tbody tr:hover {
    background-color: var(--blog-primary-light);
}

.shortcode-compare-table .table .fw-bold {
    color: var(--blog-text);
    font-size: 0.93rem;
    border-bottom: none;
    margin: 0;
    padding: 0;
}

/* ============================================================
   HERO DEL BLOG (cabecera del post)
   ============================================================ */
.blog-hero {
    background: linear-gradient(135deg, var(--blog-primary) 0%, #8a1712 100%);
    padding: 3.5rem 0;
}

.blog-hero h1 {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    font-size: 2rem;
}

.blog-hero-image {
    padding: 4rem 0;
    background-size: cover;
    background-position: center;
    position: relative;
}

.blog-hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.65));
}

.blog-hero-image .container {
    position: relative;
    z-index: 2;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.blog-sidebar .card {
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
}

.blog-sidebar .list-group-item {
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.blog-sidebar .list-group-item:hover {
    background-color: var(--blog-primary-light);
    border-left-color: var(--blog-primary);
}

.blog-sidebar .list-group-item img {
    border-radius: 0.35rem;
    box-shadow: none;
}

/* ============================================================
   COMPARTIR
   ============================================================ */
.blog-share {
    border-top: 2px solid var(--blog-border);
    padding-top: 1.25rem;
    margin-top: 2.5rem;
}

.blog-share .btn {
    font-size: 0.88rem;
    text-transform: none;
    font-weight: 500;
}

/* ============================================================
   BLOCKQUOTE
   ============================================================ */
.blog-content blockquote {
    border-left: 4px solid var(--blog-primary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background-color: #fafafa;
    border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
    font-style: italic;
    color: #555;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   BOTÓN "VOLVER AL BLOG"
   ============================================================ */
.blog-back-link .btn {
    text-transform: none;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 991.98px) {
    .blog-hero h1 {
        font-size: 1.65rem;
    }

    .shortcode-recommend-card .row {
        flex-direction: column;
    }

    .shortcode-recommend-card img {
        max-height: 200px;
    }

    .shortcode-product-card .row {
        flex-direction: column;
    }

    .shortcode-product-card img {
        max-height: 200px;
    }
}

/* Móvil */
@media (max-width: 575.98px) {
    .blog-content {
        font-size: 1rem;
    }

    .blog-content h2 {
        font-size: 1.3rem;
        margin-top: 2rem;
    }

    .blog-content h3 {
        font-size: 1.15rem;
    }

    .blog-content h4,
    .blog-content .fw-bold.fs-5 {
        font-size: 1.1rem;
    }

    .blog-hero h1 {
        font-size: 1.4rem;
    }

    .blog-hero {
        padding: 2.5rem 0;
    }

    .shortcode-product-card img,
    .shortcode-recommend-card img {
        max-height: 180px;
    }

    .blog-content .callout {
        padding: 1rem;
    }

    .shortcode-compare-table {
        font-size: 0.85rem;
    }

    .shortcode-compare-table .table thead th img {
        max-height: 80px !important;
    }
}
