/* ============================================================================
 * Blog — styles
 * Tutti gli stili scoped a .blog-* e classi blog-specific per non conflitto
 * con il resto del sito.
 * ========================================================================== */

.blog-wrap {
    --blog-fg:     #1c2434;
    --blog-muted:  #64748b;
    --blog-subtle: #94a3b8;
    --blog-line:   #e4e8ee;
    --blog-bg:     #f8fafc;
    --blog-surf:   #fff;
    --blog-accent: #2563eb;
    --blog-accent-h: #1d4ed8;
    --blog-radius: 12px;
    background: var(--blog-bg);
    min-height: 60vh;
    padding: 0 0 3rem;
}

.blog-wrap a { color: var(--blog-accent); text-decoration: none; }
.blog-wrap a:hover { text-decoration: underline; }

/* Breadcrumb */
.blog-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0;
    font-size: .85rem;
    color: var(--blog-muted);
}
.blog-breadcrumb a { color: var(--blog-muted); }
.blog-breadcrumb a:hover { color: var(--blog-accent); text-decoration: underline; }
.blog-breadcrumb .sep { margin: 0 .45rem; color: #cbd5e1; }

/* Page wrappers — allineato al container standard del sito (1200px) */
.blog-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.25rem;
}
.blog-page.wide { max-width: 1400px; }

/* ----- Blog index: hero post ----- */
.post-hero {
    background: var(--blog-surf);
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: box-shadow .15s;
}
.post-hero:hover { box-shadow: 0 10px 28px rgba(16,24,40,.1); }
.post-hero a { color: inherit; display: block; }
.post-hero a:hover { text-decoration: none; }
.post-hero-thumb {
    width: 100%;
    aspect-ratio: 21/9;
    background: linear-gradient(135deg,#eff6ff,#dbeafe);
    overflow: hidden;
}
.post-hero-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-hero-body { padding: 1.75rem 2rem 2rem; }
.post-hero-body h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin: 0 0 .75rem;
    color: var(--blog-fg);
}
.post-hero-body .excerpt {
    font-size: 1.02rem;
    color: var(--blog-muted);
    line-height: 1.6;
    margin: 0 0 .9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-hero-body .meta { font-size: .82rem; color: var(--blog-subtle); }
@media (max-width: 700px) {
    .post-hero-thumb { aspect-ratio: 16/10; }
    .post-hero-body { padding: 1.1rem 1.15rem 1.3rem; }
}

/* ----- Blog index: post list ----- */
.post-list { display: flex; flex-direction: column; gap: 1.5rem; }
.post-list .post-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    background: var(--blog-surf);
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    overflow: hidden;
    transition: box-shadow .15s;
    min-height: 200px; /* altezza uniforme tra card */
}
.post-list .post-row:hover { box-shadow: 0 6px 16px rgba(16,24,40,.08); }
.post-list .post-row > a { color: inherit; display: contents; }
.post-list .post-row > a:hover { text-decoration: none; }
.post-list .post-thumb {
    width: 100%; height: 100%;
    background: linear-gradient(135deg,#eff6ff,#dbeafe);
    overflow: hidden;
    min-height: 200px;
}
.post-list .post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-list .post-body {
    padding: 1.25rem 1.5rem;
    display: flex; flex-direction: column; justify-content: center;
    min-width: 0;
}
.post-list .post-body h2 {
    font-size: 1.3rem; font-weight: 600; line-height: 1.25;
    margin: 0 0 .5rem; letter-spacing: -.01em;
    color: var(--blog-fg);
}
.post-list .post-body .excerpt {
    font-size: .95rem; color: var(--blog-muted); margin: 0 0 .6rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-list .post-body .meta { font-size: .78rem; color: var(--blog-subtle); }
@media (max-width: 700px) {
    .post-list .post-row { grid-template-columns: 1fr; min-height: 0; }
    .post-list .post-thumb { aspect-ratio: 16/10; min-height: 0; height: auto; }
    .post-list .post-body { padding: 1rem 1.1rem 1.15rem; }
}

/* Section title editoriale: titolo bold + barra accent sotto */
.blog-section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--blog-fg);
    margin: 2rem 0 .35rem;
    line-height: 1.1;
    text-transform: uppercase;
}
.blog-section-title::after {
    content: '';
    display: block;
    width: 72px;
    height: 4px;
    background: var(--blog-accent);
    border-radius: 2px;
    margin-top: .65rem;
}
.blog-section-title--sm {
    font-size: 1rem;
    letter-spacing: .02em;
    margin: 0 0 .25rem;
}
.blog-section-title--sm::after { width: 48px; height: 3px; margin-top: .45rem; }
.blog-section-sub {
    color: var(--blog-muted);
    font-size: 1rem;
    margin: 1.1rem 0 0;
    max-width: 640px;
}

/* Pulsante CTA inline usato nell'empty state */
.blog-btn-primary {
    display: inline-block;
    background: var(--blog-accent);
    color: #fff;
    padding: .6rem 1.1rem;
    border-radius: 8px;
    font-weight: 500;
}
.blog-btn-primary:hover { background: var(--blog-accent-h); color: #fff; text-decoration: none; }

/* Empty state */
.blog-empty {
    text-align: center;
    background: var(--blog-surf);
    border: 1px solid var(--blog-line);
    border-radius: var(--blog-radius);
    padding: 3rem 1.5rem;
    color: var(--blog-muted);
}
.blog-empty h2 { color: var(--blog-fg); margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 600; }
.blog-empty p { margin: .3rem 0; }

/* ----- Blog index/category: 2-col layout (main + sidebar) ----- */
.blog-layout-index {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    margin: 1.5rem 0 0;
    align-items: flex-start;
}
.blog-main { min-width: 0; }
.blog-sidebar { display: flex; flex-direction: column; gap: 2rem; }

@media (max-width: 900px) {
    .blog-layout-index { grid-template-columns: 1fr; gap: 2rem; }
    .blog-sidebar { position: static; }
}

/* Category pill overlay sulle thumb */
.post-thumb, .post-hero-thumb { position: relative; }
.post-cat-tag {
    position: absolute;
    top: 0; left: 0;
    background: var(--blog-accent);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .35rem .7rem;
    z-index: 1;
    line-height: 1;
    pointer-events: none;
}

/* Sidebar: Categorie (bottoni scuri full-width, squadrati) */
.sidebar-cats { display: flex; flex-direction: column; gap: 2px; }
.sidebar-cats a {
    display: block;
    padding: .6rem .9rem;
    background: var(--blog-fg);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .12s;
}
.sidebar-cats a:hover { background: var(--blog-accent); text-decoration: none; color: #fff; }
.sidebar-cats a.active { background: var(--blog-accent); }

/* Sidebar: Marche (griglia loghi 3 col, celle squadrate) */
.sidebar-brands {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--blog-line);
    border: 1px solid var(--blog-line);
}
.sidebar-brands .brand-cell {
    background: var(--blog-surf);
    aspect-ratio: 1/1;
    display: flex; align-items: center; justify-content: center;
    padding: .6rem;
    transition: background .12s;
}
.sidebar-brands .brand-cell:hover { background: #eff6ff; text-decoration: none; }
.sidebar-brands .brand-cell.active { background: #eff6ff; box-shadow: inset 0 0 0 2px var(--blog-accent); }
.sidebar-brands .brand-cell img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    display: block;
}
.sidebar-brands .brand-cell-fallback {
    font-size: .7rem;
    font-weight: 600;
    color: var(--blog-fg);
    text-align: center;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* ----- Single post: 3-column layout ----- */
.post-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 760px) 260px;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
    align-items: flex-start;
}
.post-layout > main { min-width: 0; }
.post-layout aside { position: sticky; top: 85px; }
.post-layout aside h3 {
    font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--blog-muted); font-weight: 600; margin: 0 0 .9rem;
}
aside .sidebar-block + .sidebar-block { margin-top: 1.75rem; }

/* Side "Auto correlate" / "Scopri di piu" cars */
.side-cars { display: flex; flex-direction: column; gap: .9rem; }
.side-car {
    background: var(--blog-surf); border: 1px solid var(--blog-line); border-radius: 10px;
    padding: .7rem; display: flex; flex-direction: column; gap: .5rem;
}
.side-car-img { aspect-ratio: 16/10; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.side-car-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s; }
.side-car-name { font-weight: 600; font-size: .9rem; line-height: 1.25; letter-spacing: -.01em; color: var(--blog-fg); }
.side-car-sub { font-size: .75rem; color: var(--blog-muted); }
a.side-car-cta,
.blog-wrap a.side-car-cta {
    display: inline-block; text-align: center;
    background: var(--blog-accent); color: #fff; padding: .45rem .5rem; border-radius: 6px;
    font-size: .8rem; font-weight: 500; margin-top: .15rem;
}
a.side-car-cta:hover,
.blog-wrap a.side-car-cta:hover { background: var(--blog-accent-h); text-decoration: none; color: #fff; }

/* Side "Altri articoli" */
.side-posts { display: flex; flex-direction: column; gap: 1rem; }
.side-post {
    background: var(--blog-surf); border: 1px solid var(--blog-line); border-radius: 10px;
    overflow: hidden; transition: box-shadow .15s;
}
.side-post:hover { box-shadow: 0 6px 16px rgba(16,24,40,.08); }
.side-post a { color: inherit; display: block; }
.side-post a:hover { text-decoration: none; }
.side-post .thumb { width: 100%; aspect-ratio: 16/10; background: #eef2f7; overflow: hidden; }
.side-post .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-post .body { padding: .75rem .9rem 1rem; }
.side-post .title {
    font-size: .95rem; font-weight: 600; line-height: 1.35; color: var(--blog-fg);
    margin: 0 0 .35rem; letter-spacing: -.005em;
}
.side-post .excerpt { font-size: .82rem; color: var(--blog-muted); line-height: 1.5; margin: 0 0 .45rem; }
.side-post time { display: block; font-size: .72rem; color: var(--blog-subtle); }

/* Article body */
.article-head { margin: 1rem 0 1.5rem; }
.article-head .eyebrow {
    display: inline-block; font-size: .82rem; font-weight: 600;
    color: var(--blog-accent); text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: .85rem;
}
.article-head h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem); line-height: 1.15; letter-spacing: -.02em;
    margin: 0 0 .5rem; color: var(--blog-fg);
}
.article-head .subtitle {
    font-size: 1.15rem; color: var(--blog-muted); font-weight: 400;
    line-height: 1.5; margin: 0 0 .75rem;
}
.article-head .meta { font-size: .85rem; color: var(--blog-muted); }

.hero-image {
    width: 100%; aspect-ratio: 16/9;
    margin: 0 0 2rem;
    border-radius: var(--blog-radius);
    overflow: hidden; background: #eef2f7;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-body { font-size: 1.05rem; line-height: 1.75; color: var(--blog-fg); }
.article-body h2, .article-body h3 { letter-spacing: -.01em; margin: 2rem 0 .75rem; color: var(--blog-fg); }
.article-body h2 { font-size: 1.5rem; font-weight: 600; }
.article-body h3 { font-size: 1.2rem; font-weight: 600; }
.article-body p { margin: 0 0 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.25rem 1.5rem; padding: 0; }
.article-body li { margin-bottom: .25rem; }

.article-footer { margin: 2.5rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--blog-line); font-size: .9rem; color: var(--blog-muted); }

/* Responsive: sidebar wrappa sotto */
@media (max-width: 1200px) {
    .post-layout { grid-template-columns: 1fr; max-width: 900px; }
    .post-layout aside { position: static; }
}

/* ----- Sidebar widget: promo Ricerca avanzata (link a /parco-auto/) ----- */
.promo-widget {
    background: var(--blog-surf);
    border: 1px solid var(--blog-line);
    overflow: hidden;
    display: flex; flex-direction: column;
}
/* Top panel scuro con le 3 auto che ruotano */
.promo-cars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    padding: 1rem .8rem 1.1rem;
    background:
        radial-gradient(circle at 20% 0%, rgba(59,130,246,.18), transparent 60%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
}
.promo-car { text-align: center; min-width: 0; }
.promo-car-img {
    aspect-ratio: 4/3;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    padding: .35rem;
    margin-bottom: .35rem;
    border-radius: 3px;
}
.promo-car-img img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .7s ease;
}
.promo-car-name {
    font-size: .72rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.1;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .7s ease;
}

/* Corpo bianco con bullet list */
.promo-bullets {
    list-style: none;
    padding: 1rem .9rem;
    margin: 0;
    display: flex; flex-direction: column; gap: .55rem;
}
.promo-bullets li {
    position: relative;
    padding-left: 1.35rem;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--blog-muted);
}
.promo-bullets li strong {
    color: var(--blog-fg);
    font-weight: 700;
}
.promo-bullets li::before {
    content: '»';
    position: absolute;
    left: 0;
    top: -.05rem;
    color: var(--blog-accent);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* CTA: rettangolo pieno full-width, testo bianco (specificità! il link
   bianco va forzato sopra .blog-wrap a { color: accent } generico). */
a.promo-cta,
.blog-wrap a.promo-cta {
    display: block;
    text-align: center;
    background: var(--blog-accent);
    color: #fff;
    padding: .55rem 1rem;
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0 .9rem 1rem;
    transition: background .12s;
}
a.promo-cta:hover,
.blog-wrap a.promo-cta:hover {
    background: var(--blog-accent-h);
    color: #fff;
    text-decoration: none;
}
