/* ============================================
   BLOG — Giacomo Amati
   Eredita i tokens di /style.css (--bl, --g*, --f, --fd)
   ============================================ */
.blog-body{
  overflow:auto !important; /* override dello snap della home */
  background:var(--wh);
  color:var(--g700);
  font-family:var(--f);
  line-height:1.75;
}

/* NAV (versione non-snap) */
.blog-nav{position:fixed;top:0;left:0;right:0;z-index:999;padding:18px 0;transition:all .4s var(--ease);background:rgba(255,255,255,.92);backdrop-filter:blur(20px);border-bottom:1px solid transparent}
.blog-nav.scr{border-color:var(--g100);padding:10px 0}
.blog-nav-in{max-width:1600px;margin:0 auto;padding:0 var(--px);display:flex;align-items:center;justify-content:space-between}
.blog-nav .limg{height:38px;width:auto}
.blog-nav-links{display:flex;align-items:center;gap:6px}
.blog-nav-links a{font-size:1rem;font-weight:500;color:var(--g500);padding:10px 20px;border-radius:100px;transition:all .3s}
.blog-nav-links a:hover{color:var(--bl);background:var(--g50)}
.blog-nav-links a.active{color:var(--bl);background:var(--blg)}
.blog-nav-links .ncta{background:var(--bl);color:var(--wh);padding:10px 22px}
.blog-nav-links .ncta:hover{background:var(--bld);color:var(--wh)}

.blog-burger{display:none;background:none;border:0;width:40px;height:40px;cursor:pointer;flex-direction:column;gap:5px;justify-content:center;align-items:center}
.blog-burger span{width:24px;height:2px;background:var(--g700);transition:all .3s}
.blog-burger.open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.blog-burger.open span:nth-child(2){opacity:0}
.blog-burger.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

.blog-mmenu{position:fixed;top:70px;left:0;right:0;background:var(--wh);padding:30px var(--px);display:none;flex-direction:column;gap:4px;border-bottom:1px solid var(--g100);box-shadow:0 10px 30px rgba(0,0,0,.06);z-index:998}
.blog-mmenu.open{display:flex}
.blog-mmenu a{padding:14px 8px;font-size:1.15rem;font-weight:500;color:var(--g700);border-bottom:1px solid var(--g50)}
.blog-mmenu a.mcta{color:var(--bl);font-weight:700}

/* CONTAINER */
.blog-wrap{max-width:1200px;margin:0 auto;padding:140px var(--px) 80px}
.blog-wrap.narrow{max-width:780px}

/* HERO INDEX */
.blog-hero{padding:140px var(--px) 40px;max-width:1200px;margin:0 auto;text-align:center}
.blog-hero .eyebrow{display:inline-flex;align-items:center;gap:8px;background:var(--blg);color:var(--bl);padding:8px 16px;border-radius:100px;font-size:.85rem;font-weight:600;margin-bottom:20px}
.blog-hero h1{font-family:var(--fd);font-size:clamp(2.4rem,5.5vw,4.2rem);line-height:1.05;font-weight:800;color:var(--g800);letter-spacing:-.03em}
.blog-hero h1 .blu{color:var(--bl)}
.blog-hero p{font-size:clamp(1.05rem,1.6vw,1.25rem);color:var(--g500);max-width:720px;margin:20px auto 0}

/* TAG FILTER */
.tag-filter{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:40px auto 0;max-width:900px}
.tag-filter a{padding:8px 18px;border-radius:100px;background:var(--g50);color:var(--g600);font-size:.92rem;font-weight:500;transition:all .25s;border:1px solid var(--g100)}
.tag-filter a:hover{background:var(--wh);color:var(--bl);border-color:var(--bl)}
.tag-filter a.active{background:var(--bl);color:var(--wh);border-color:var(--bl)}

/* GRID POST CARDS */
.post-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:32px;margin-top:60px}
.post-card{background:var(--wh);border:1px solid var(--g100);border-radius:20px;overflow:hidden;transition:all .4s var(--ease);display:flex;flex-direction:column}
.post-card:hover{transform:translateY(-4px);box-shadow:0 20px 50px rgba(15,23,42,.08);border-color:var(--g200)}
.post-card-img{aspect-ratio:16/10;overflow:hidden;background:var(--g50)}
.post-card-img img{width:100%;height:100%;object-fit:cover;transition:transform .6s var(--ease)}
.post-card:hover .post-card-img img{transform:scale(1.05)}
.post-card-body{padding:26px;flex:1;display:flex;flex-direction:column;gap:12px}
.post-card-tags{display:flex;flex-wrap:wrap;gap:6px}
.post-card-tags a{font-size:.75rem;font-weight:600;color:var(--bl);background:var(--blg);padding:4px 10px;border-radius:100px;text-transform:uppercase;letter-spacing:.03em}
.post-card h2{font-family:var(--fd);font-size:1.35rem;line-height:1.25;font-weight:700;color:var(--g800)}
.post-card h2 a{color:inherit}
.post-card h2 a:hover{color:var(--bl)}
.post-card p{color:var(--g500);font-size:.95rem;flex:1}
.post-card-meta{display:flex;align-items:center;gap:12px;color:var(--g400);font-size:.85rem;margin-top:auto;padding-top:12px;border-top:1px solid var(--g50)}
.post-card-meta .dot-sep{width:3px;height:3px;background:var(--g300);border-radius:50%}

/* PAGINATION */
.pagination{display:flex;justify-content:center;gap:8px;margin-top:60px}
.pagination a,.pagination span{min-width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border-radius:10px;font-weight:600;border:1px solid var(--g100);color:var(--g600)}
.pagination a:hover{background:var(--g50);color:var(--bl);border-color:var(--bl)}
.pagination .active{background:var(--bl);color:var(--wh);border-color:var(--bl)}
.pagination .disabled{color:var(--g300);border-color:var(--g50)}

/* ARTICLE */
.reading-bar{position:fixed;top:0;left:0;height:3px;background:var(--bl);z-index:1000;width:0;transition:width .1s linear}
.article-hero{max-width:900px;margin:0 auto;padding:140px var(--px) 40px;text-align:center}
.article-hero .breadcrumb{font-size:.88rem;color:var(--g400);margin-bottom:20px}
.article-hero .breadcrumb a{color:var(--g500)}
.article-hero .breadcrumb a:hover{color:var(--bl)}
.article-hero .breadcrumb .sep{margin:0 8px;color:var(--g300)}
.article-hero .post-card-tags{justify-content:center;margin-bottom:20px}
.article-hero h1{font-family:var(--fd);font-size:clamp(2rem,4.5vw,3.6rem);line-height:1.1;font-weight:800;color:var(--g800);letter-spacing:-.02em}
.article-hero .lede{font-size:clamp(1.1rem,1.6vw,1.3rem);color:var(--g500);margin-top:20px}
.article-meta{display:flex;justify-content:center;align-items:center;gap:14px;margin-top:28px;color:var(--g400);font-size:.9rem;flex-wrap:wrap}
.article-meta .dot-sep{width:3px;height:3px;background:var(--g300);border-radius:50%}

.article-cover{max-width:1100px;margin:0 auto 60px;padding:0 var(--px)}
.article-cover img{width:100%;border-radius:24px;aspect-ratio:16/9;object-fit:cover}

.post-body{max-width:780px;margin:0 auto;padding:0 var(--px);font-size:1.1rem}
.post-body h2{font-family:var(--fd);font-size:2rem;font-weight:700;color:var(--g800);margin:60px 0 20px;line-height:1.2;letter-spacing:-.01em}
.post-body h3{font-family:var(--fd);font-size:1.45rem;font-weight:700;color:var(--g800);margin:40px 0 16px}
.post-body h4{font-family:var(--fd);font-size:1.15rem;font-weight:700;color:var(--g800);margin:32px 0 12px}
.post-body p{margin:0 0 1.4em;color:var(--g700)}
.post-body a{color:var(--bl);text-decoration:underline;text-decoration-color:var(--blg);text-underline-offset:3px;transition:all .2s}
.post-body a:hover{text-decoration-color:var(--bl)}
.post-body strong{color:var(--g800);font-weight:700}
.post-body em{color:var(--g700)}
.post-body ul,.post-body ol{margin:0 0 1.4em;padding-left:24px}
.post-body li{margin-bottom:.5em}
.post-body blockquote{border-left:4px solid var(--bl);background:var(--g50);padding:20px 28px;margin:32px 0;border-radius:0 12px 12px 0;font-style:italic;color:var(--g600)}
.post-body blockquote p{margin:0}
.post-body hr{border:0;border-top:1px solid var(--g100);margin:48px auto;max-width:200px}
.post-body figure{margin:32px 0}
.post-body figure img{width:100%;border-radius:16px;display:block}
.post-body figcaption{text-align:center;font-size:.88rem;color:var(--g400);margin-top:10px;font-style:italic}
.post-body img{border-radius:12px}
.post-body code{background:var(--g50);color:var(--bl);padding:2px 8px;border-radius:6px;font-size:.9em;font-family:'SF Mono',Monaco,Consolas,monospace}
.post-body pre{background:var(--g800);color:#e2e8f0;padding:24px;border-radius:14px;overflow-x:auto;margin:28px 0;position:relative;font-size:.92rem;line-height:1.6}
.post-body pre code{background:transparent;color:inherit;padding:0;font-size:inherit}
.post-body pre .copy-btn{position:absolute;top:12px;right:12px;background:rgba(255,255,255,.1);color:#fff;border:0;padding:6px 14px;border-radius:8px;font-size:.78rem;cursor:pointer;font-weight:500;transition:all .2s}
.post-body pre .copy-btn:hover{background:rgba(255,255,255,.2)}

/* SHARE + AUTHOR BOX */
.post-foot{max-width:780px;margin:60px auto 0;padding:0 var(--px)}
.post-tags{display:flex;flex-wrap:wrap;gap:8px;padding:28px 0;border-top:1px solid var(--g100);border-bottom:1px solid var(--g100)}
.post-tags a{background:var(--g50);color:var(--g600);padding:6px 14px;border-radius:100px;font-size:.85rem;font-weight:500}
.post-tags a:hover{background:var(--blg);color:var(--bl)}

.author-box{display:flex;gap:20px;align-items:center;padding:32px;background:var(--g50);border-radius:20px;margin-top:40px}
.author-box .avatar{width:72px;height:72px;border-radius:50%;background:var(--bl);color:#fff;font-family:var(--fd);font-size:1.8rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.author-box h4{font-family:var(--fd);font-size:1.1rem;font-weight:700;color:var(--g800);margin-bottom:4px}
.author-box p{font-size:.92rem;color:var(--g500);margin:0}
.author-box a{color:var(--bl);font-weight:600}

/* CTA */
.blog-cta{max-width:900px;margin:80px auto 0;padding:60px var(--px);text-align:center;background:linear-gradient(135deg,var(--g800),#1a2340);border-radius:28px;color:var(--wh)}
.blog-cta h3{font-family:var(--fd);font-size:clamp(1.6rem,3vw,2.2rem);font-weight:800;margin-bottom:14px}
.blog-cta p{color:var(--g200);margin-bottom:28px;max-width:560px;margin-left:auto;margin-right:auto}
.blog-cta .btn{display:inline-block;background:var(--bl);color:var(--wh);padding:14px 32px;border-radius:100px;font-weight:600;transition:all .3s}
.blog-cta .btn:hover{background:var(--bll);transform:translateY(-2px)}

/* RELATED */
.related{max-width:1200px;margin:80px auto 0;padding:0 var(--px)}
.related h3{font-family:var(--fd);font-size:1.6rem;font-weight:700;color:var(--g800);margin-bottom:28px}
.related .post-grid{margin-top:0}

/* FOOTER */
.blog-ft{background:var(--g800);color:var(--g200);margin-top:100px;padding:60px var(--px) 30px}
.blog-ft-in{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:2fr 1fr 1fr;gap:50px}
.blog-ft-logo{height:40px;filter:brightness(0) invert(1);margin-bottom:16px}
.blog-ft-col h4{color:var(--wh);font-family:var(--fd);font-size:1rem;margin-bottom:16px;font-weight:700}
.blog-ft-col ul{list-style:none}
.blog-ft-col li{margin-bottom:10px}
.blog-ft-col a{color:var(--g300);transition:color .2s}
.blog-ft-col a:hover{color:var(--bll)}
.blog-ft-social{display:flex;gap:12px;margin-bottom:20px}
.blog-ft-social a{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.06);display:inline-flex;align-items:center;justify-content:center;color:var(--g200);transition:all .3s}
.blog-ft-social a:hover{background:var(--bl);color:var(--wh)}
.blog-ft-mail a{color:var(--g200)}
.blog-ft-bot{max-width:1200px;margin:40px auto 0;padding-top:24px;border-top:1px solid rgba(255,255,255,.06);display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;font-size:.88rem;color:var(--g400)}

/* Empty state */
.empty{text-align:center;padding:80px 20px;color:var(--g400)}
.empty h3{font-family:var(--fd);color:var(--g600);margin-bottom:12px}

/* RESPONSIVE */
@media (max-width:900px){
  .blog-ft-in{grid-template-columns:1fr;gap:36px}
  .blog-ft-bot{flex-direction:column;align-items:flex-start}
}
@media (max-width:768px){
  .blog-nav-links{display:none}
  .blog-burger{display:flex}
  .post-grid{grid-template-columns:1fr;gap:24px}
  .author-box{flex-direction:column;text-align:center}
}
