/* =============================================
   Blog — assets/css/blog.css
   ============================================= */

/* ═══ LAYOUT: contenuto + sidebar blog ═══ */
.blog-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
    align-items: start;
}
.blog-main {
    min-width: 0;
}
.blog-main > *:first-child { margin-top: 0; padding-top: 0; }
.blog-sidebar-col { align-self: start; }

/* ═══ BADGE CATEGORIA BLOG (colore dinamico) ═══ */
.blog-badge {
    display: inline-block;
    font-size: .62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .2rem .55rem;
    background: color-mix(in srgb, var(--badge-color, #B70018) 12%, transparent);
    color: var(--badge-color, #B70018);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.blog-badge:hover {
    background: var(--badge-color, #B70018);
    color: #fff;
    text-decoration: none;
}

/* ═══ SIDEBAR BLOG — stile menu area privata ═══ */
.blog-sidebar {
    position: sticky;
    top: 1rem;
    border: 1px solid var(--gray3, #ddd);
    background: var(--bg2, #f9f9f9);
}
.blog-sb-section {
    padding: 0;
}
.blog-sb-section + .blog-sb-section {
    border-top: 1px solid var(--gray3, #ddd);
}
.blog-sb-title {
    font-family: var(--font-title, 'Bebas Neue', sans-serif);
    font-size: .9rem;
    letter-spacing: .08em;
    color: var(--red, #B70018);
    padding: .75rem 1.25rem .4rem;
}
.blog-sb-nav {
    display: flex;
    flex-direction: column;
    padding: .25rem 0 .5rem;
}
.blog-sb-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 1.25rem;
    font-size: .78rem;
    color: var(--gray, #666);
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.blog-sb-link:hover {
    background: #fff;
    color: var(--ink, #111);
    text-decoration: none;
}
.blog-sb-link.active {
    background: #fff;
    color: var(--red, #B70018);
    font-weight: 500;
    border-left-color: var(--red, #B70018);
}
.blog-sb-count {
    font-size: .7rem;
    color: var(--gray2, #999);
    background: var(--gray3, #ddd);
    padding: .1em .45em;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}
.blog-sb-link.active .blog-sb-count {
    background: var(--red-light, #fce8eb);
    color: var(--red, #B70018);
}

/* ═══ LISTA ARTICOLI — CARD VERTICALI ═══ */
.blog-lista {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--gray3, #ddd);
    padding-bottom: 2rem;
}
.blog-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.blog-card-img-link {
    display: block;
}
.blog-card-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}
.blog-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: var(--bg2, #f9f9f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray2, #999);
    font-size: 2rem;
}
.blog-card-body {
    padding: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.blog-card-titolo {
    font-family: var(--font-title, 'Bebas Neue', sans-serif);
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--ink, #111);
    text-decoration: none;
}
.blog-card-titolo:hover {
    color: var(--red, #B70018);
    text-decoration: none;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--gray2, #999);
}

/* ═══ DETTAGLIO ARTICOLO ═══ */
.blog-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--gray, #666);
    margin-bottom: 1.75rem;
}
.blog-detail-autore {
    font-weight: 600;
    color: var(--ink, #111);
    text-decoration: none;
}
.blog-detail-autore:hover { color: var(--red, #B70018); text-decoration: none; }
.blog-detail-sep { color: var(--gray3, #ddd); }
.blog-detail-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    margin-bottom: 2rem;
}
.blog-detail-contenuto {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ink, #111);
}
.blog-detail-contenuto p { margin: 0 0 1.1em; }
.blog-detail-contenuto img { max-width: 100%; height: auto; display: block; margin: 1.25em 0; }
.blog-detail-contenuto h2, .blog-detail-contenuto h3 {
    font-family: var(--font-title, 'Bebas Neue', sans-serif);
    margin: 1.5em 0 .5em;
}
.blog-detail-contenuto blockquote {
    border-left: 3px solid var(--red, #B70018);
    margin: 1.5em 0;
    padding: .75em 1.25em;
    color: var(--gray, #666);
    background: var(--bg2, #f9f9f9);
}
.blog-detail-contenuto a { color: var(--red, #B70018); }

/* ═══ COMMENTI ═══ */
.blog-commenti {
    margin-top: 2.5rem;
    border-top: 1px solid var(--gray3, #ddd);
    padding-top: 1.5rem;
}
.blog-commenti-titolo {
    font-family: var(--font-title, 'Bebas Neue', sans-serif);
    font-size: 1.4rem;
    margin: 0 0 1.25rem;
}
.commento {
    padding: .85rem 0;
    border-bottom: 1px solid var(--gray3, #ddd);
}
.commento:last-child { border-bottom: none; }
.commento-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
}
.commento-autore { font-weight: 600; color: var(--ink, #111); font-size: .9rem; }
.commento-data { color: var(--gray2, #999); font-size: .8rem; }
.commento-testo { color: var(--gray, #666); line-height: 1.5; font-size: .9rem; }
.commento-form { margin-top: 1.25rem; }
.commento-form textarea {
    width: 100%;
    min-height: 90px;
    padding: .65rem;
    border: 1px solid var(--gray3, #ddd);
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: .9rem;
    resize: vertical;
}
.commento-form textarea:focus { outline: none; border-color: var(--red, #B70018); }
.commento-form .btn { margin-top: .6rem; }
.commento-avviso {
    background: var(--bg2, #f9f9f9);
    padding: .6rem .85rem;
    color: var(--gray, #666);
    font-size: .85rem;
    margin-top: .75rem;
}

/* ═══ PAGINAZIONE ═══ */
.blog-paginazione {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2rem;
}
.blog-paginazione a,
.blog-paginazione span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: .85rem;
    text-decoration: none;
    color: var(--gray, #666);
    border: 1px solid var(--gray3, #ddd);
    transition: all 0.15s;
}
.blog-paginazione a:hover { background: var(--bg2, #f9f9f9); }
.blog-paginazione .attiva {
    background: var(--red, #B70018);
    color: #fff;
    border-color: var(--red, #B70018);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 960px) {
    .blog-with-sidebar {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .blog-card-img {
        height: 200px;
    }
    .blog-card-titolo {
        font-size: 1.3rem;
    }
    .blog-detail-cover {
        max-height: 250px;
    }
}
