/*
Theme Name: Vendi Online Pro
Description: Tema professionale per blog eCommerce italiano
Version: 3.0
Author: Domenico Tavoletta
*/

:root {
    --nero:   #0A0A0A;
    --scuro:  #111827;
    --scuro2: #1F2937;
    --blu:    #1D4ED8;
    --blu-h:  #1E40AF;
    --testo:  #1F2937;
    --testo2: #4B5563;
    --muted:  #9CA3AF;
    --bordo:  #E5E7EB;
    --sfondo: #F9FAFB;
    --bianco: #FFFFFF;
    --raggio: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--testo);
    background: var(--sfondo);
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', sans-serif; color: var(--nero); line-height: 1.25; font-weight: 700; }
a { color: var(--blu); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blu-h); }
img { max-width: 100%; height: auto; display: block; }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.site-main { padding: 52px 0 80px; min-height: 60vh; }
.content-wrap { display: grid; grid-template-columns: 1fr 288px; gap: 36px; align-items: start; }
.main-content { min-width: 0; }

/* ---- HEADER ---- */
.site-header { background: var(--scuro); position: sticky; top: 0; z-index: 200; border-bottom: 1px solid rgba(255,255,255,0.07); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.site-logo { font-family: 'Poppins', sans-serif; font-size: 19px; font-weight: 700; color: var(--bianco); letter-spacing: -0.3px; text-decoration: none; flex-shrink: 0; }
.site-logo span { color: #60A5FA; }
.site-logo:hover { color: var(--bianco); opacity: .85; }

.main-nav { display: flex; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 0; }
.nav-list > li > a { display: block; color: rgba(255,255,255,.6); font-size: 14px; font-weight: 500; padding: 8px 14px; transition: color .15s; white-space: nowrap; }
.nav-list > li > a:hover { color: var(--bianco); }
.nav-list > .current-menu-item > a { color: var(--bianco); }
.nav-list > li:last-child > a { margin-left: 10px; padding: 7px 16px; background: var(--blu); color: var(--bianco); border-radius: 6px; font-weight: 600; }
.nav-list > li:last-child > a:hover { background: var(--blu-h); color: var(--bianco); }

/* Hamburger */
.nav-toggle { display: none; flex-direction: column; gap: 5px; align-items: flex-end; width: 36px; height: 36px; padding: 7px 6px; background: none; border: none; cursor: pointer; justify-content: center; }
.nav-toggle span { display: block; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; transition: transform .28s ease, opacity .2s ease; }
.nav-toggle span:nth-child(1) { width: 20px; }
.nav-toggle span:nth-child(2) { width: 14px; align-self: flex-end; }
.nav-toggle span:nth-child(3) { width: 20px; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile fullscreen */
.mobile-menu { display: none; position: fixed; inset: 0; z-index: 300; background: var(--bianco); flex-direction: column; transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); }
.mobile-menu.is-open { transform: translateX(0); }

.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 64px; border-bottom: 1px solid var(--bordo); flex-shrink: 0; }
.mobile-menu-logo { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 700; color: var(--nero); text-decoration: none; }
.mobile-menu-logo span { color: var(--blu); }
.mobile-close { width: 36px; height: 36px; background: var(--sfondo); border: 1px solid var(--bordo); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--testo2); line-height: 1; transition: background .15s; }
.mobile-close:hover { background: var(--bordo); }

.mobile-nav { flex: 1; padding: 8px 24px; overflow-y: auto; }
.mobile-nav ul { list-style: none; }
.mobile-nav ul li a { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; font-size: 22px; font-weight: 700; font-family: 'Poppins', sans-serif; color: var(--nero); border-bottom: 1px solid var(--bordo); transition: color .15s; }
.mobile-nav ul li a:hover { color: var(--blu); }
.mobile-nav ul li:last-child a { border-bottom: none; }
.mobile-nav ul li a::after { content: '→'; font-size: 16px; color: var(--muted); font-family: 'Inter', sans-serif; font-weight: 400; transition: transform .15s, color .15s; }
.mobile-nav ul li a:hover::after { transform: translateX(4px); color: var(--blu); }

.mobile-nav-cta { padding: 20px 24px 36px; }
.mobile-nav-cta a { display: block; text-align: center; background: var(--blu); color: var(--bianco); padding: 15px; border-radius: var(--raggio); font-size: 16px; font-weight: 600; font-family: 'Poppins', sans-serif; transition: background .15s; }
.mobile-nav-cta a:hover { background: var(--blu-h); color: var(--bianco); }

/* ---- SEZIONE IN EVIDENZA ---- */
.evidenza { background: var(--scuro); padding: 48px 0; margin-bottom: 52px; }
.evidenza-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.evidenza-image { border-radius: var(--raggio); overflow: hidden; aspect-ratio: 16/9; background: var(--scuro2); }
.evidenza-image img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .3s, transform .4s; }
.evidenza-image:hover img { opacity: 1; transform: scale(1.03); }
.evidenza-body { display: flex; flex-direction: column; gap: 14px; }
.evidenza-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #60A5FA; }
.evidenza-title { font-size: 26px; font-weight: 700; color: var(--bianco); line-height: 1.3; }
.evidenza-title a { color: var(--bianco); }
.evidenza-title a:hover { color: #93C5FD; }
.evidenza-excerpt { font-size: 15px; color: rgba(255,255,255,.55); line-height: 1.65; }
.evidenza-meta { font-size: 13px; color: rgba(255,255,255,.35); display: flex; gap: 10px; }
.evidenza-cats .cat-badge { background: rgba(96,165,250,.12); color: #93C5FD; border-color: rgba(96,165,250,.2); }
.btn-evidenza { display: inline-block; background: var(--bianco); color: var(--nero); padding: 9px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; align-self: flex-start; transition: background .15s, color .15s; }
.btn-evidenza:hover { background: #60A5FA; color: var(--bianco); }

/* ---- BLOG GRID ---- */
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--bordo); }
.blog-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }

/* ---- CARD ---- */
.post-card { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s; }
.post-card:hover { border-color: #BFDBFE; box-shadow: 0 4px 20px rgba(29,78,216,.08); }
.card-image { display: block; overflow: hidden; height: 188px; background: var(--sfondo); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.post-card:hover .card-image img { transform: scale(1.04); }
.card-no-image { height: 188px; background: var(--scuro2); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.1); font-size: 36px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-badge { display: inline-block; background: #EFF6FF; color: var(--blu); border: 1px solid #BFDBFE; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 4px; transition: background .15s, color .15s; }
.cat-badge:hover { background: var(--blu); color: var(--bianco); border-color: var(--blu); }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.45; }
.card-title a { color: var(--nero); }
.card-title a:hover { color: var(--blu); }
.card-excerpt { font-size: 14px; color: var(--testo2); line-height: 1.6; flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--bordo); margin-top: 4px; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.meta-dot { color: var(--bordo); }
.card-link { font-size: 13px; font-weight: 600; color: var(--blu); }
.card-link:hover { color: var(--blu-h); }

/* Paginazione */
.pagination { grid-column: 1/-1; display: flex; justify-content: center; gap: 6px; padding-top: 32px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 12px; background: var(--bianco); border: 1px solid var(--bordo); border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--testo); transition: border-color .15s, color .15s; }
.pagination .page-numbers:hover { border-color: var(--blu); color: var(--blu); }
.pagination .current { background: var(--blu); border-color: var(--blu); color: var(--bianco); }
.pagination .dots { background: transparent; border-color: transparent; cursor: default; }
.no-posts { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---- SIDEBAR ---- */
.sidebar { position: sticky; top: calc(64px + 24px); display: flex; flex-direction: column; gap: 16px; }
.widget { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 18px 20px; }
.widget-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--bordo); }
.search-wrap { display: flex; border: 1px solid var(--bordo); border-radius: 6px; overflow: hidden; transition: border-color .15s; }
.search-wrap:focus-within { border-color: var(--blu); }
.search-wrap input[type="search"] { flex: 1; border: none; outline: none; padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--testo); background: var(--bianco); min-width: 0; }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap button { background: var(--blu); border: none; padding: 0 12px; cursor: pointer; color: var(--bianco); display: flex; align-items: center; transition: background .15s; flex-shrink: 0; }
.search-wrap button:hover { background: var(--blu-h); }
.cat-list { list-style: none; }
.cat-list li a { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--testo); border-bottom: 1px solid var(--bordo); transition: color .15s; }
.cat-list li:last-child a { border-bottom: none; }
.cat-list li a:hover { color: var(--blu); }
.cat-count { font-size: 11px; font-weight: 600; background: var(--sfondo); color: var(--muted); padding: 1px 7px; border-radius: 10px; border: 1px solid var(--bordo); }
.recent-list { list-style: none; }
.recent-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--bordo); }
.recent-list li:first-child { padding-top: 0; }
.recent-list li:last-child { border-bottom: none; padding-bottom: 0; }
.recent-title { font-size: 13px; font-weight: 500; color: var(--testo); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-title:hover { color: var(--blu); }
.recent-date { font-size: 11px; color: var(--muted); }

/* ---- SINGOLO ---- */
.single-hero { overflow: hidden; background: var(--scuro); }
.single-hero img { width: 100%; max-height: 400px; object-fit: cover; opacity: .9; display: block; }
.single-wrap { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 36px 44px 48px; margin-top: 28px; }
.single-header { margin-bottom: 24px; }
.single-title { font-size: clamp(22px,4vw,32px); font-weight: 700; letter-spacing: -.3px; margin: 14px 0 12px; line-height: 1.25; }
.single-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.single-meta strong { color: var(--testo); font-weight: 500; }
.post-content { font-size: 17px; line-height: 1.85; color: var(--testo); }
.post-content > * + * { margin-top: 1.35em; }
.post-content h2 { font-size: 21px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--bordo); }
.post-content h3 { font-size: 18px; margin-top: 32px; }
.post-content p { margin-bottom: 1.4em; }
.post-content ul,.post-content ol { padding-left: 24px; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--blu); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--blu-h); }
.post-content img { border-radius: 6px; margin: 28px 0; }
.post-content strong { color: var(--nero); }
.post-content blockquote { border-left: 3px solid var(--blu); padding: 14px 20px; background: #EFF6FF; border-radius: 0 6px 6px 0; margin: 24px 0; font-style: italic; color: var(--blu-h); }
.post-content blockquote p { margin: 0; }
.post-content code { font-size: 13px; background: var(--sfondo); border: 1px solid var(--bordo); padding: 1px 5px; border-radius: 3px; color: #BE185D; }
.post-content pre { background: var(--scuro); border-radius: 6px; padding: 18px 22px; overflow-x: auto; margin: 20px 0; }
.post-content pre code { background: none; border: none; color: #E2E8F0; font-size: 14px; padding: 0; }
.post-tags { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--bordo); font-size: 13px; color: var(--muted); }
.post-tags a { display: inline-block; background: var(--sfondo); border: 1px solid var(--bordo); color: var(--testo2); padding: 2px 9px; border-radius: 4px; margin: 3px; font-size: 12px; }
.post-tags a:hover { background: var(--blu); color: var(--bianco); border-color: var(--blu); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--bordo); }
.post-nav-item { display: flex; flex-direction: column; gap: 4px; }
.post-nav-next { text-align: right; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.post-nav-item a { font-size: 14px; font-weight: 600; color: var(--testo); line-height: 1.4; }
.post-nav-item a:hover { color: var(--blu); }

/* ---- PAGINA ---- */
.page-wrap { background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 36px 44px; }
.page-title { font-size: 28px; margin-bottom: 20px; }

/* ---- ARCHIVIO ---- */
.archive-header { background: var(--scuro); border-radius: var(--raggio); padding: 28px 32px; margin-bottom: 28px; }
.archive-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: #60A5FA; display: block; margin-bottom: 6px; }
.archive-title { color: var(--bianco); font-size: 22px; }
.archive-desc { color: rgba(255,255,255,.5); font-size: 14px; margin-top: 6px; }

/* ---- FOOTER ---- */
.site-footer { background: var(--scuro); margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; padding: 48px 24px 36px; border-bottom: 1px solid rgba(255,255,255,.06); }
.footer-logo { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; color: var(--bianco); display: block; margin-bottom: 10px; text-decoration: none; }
.footer-logo span { color: #60A5FA; }
.footer-logo:hover { opacity: .8; color: var(--bianco); }
.footer-about p { font-size: 14px; color: rgba(255,255,255,.4); line-height: 1.65; max-width: 260px; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.22); margin-top: 18px; }
.footer-col h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.3); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { font-size: 14px; color: rgba(255,255,255,.5); transition: color .15s; }
.footer-col ul a:hover { color: var(--bianco); }

/* ---- 404 ---- */
.not-found-wrap { text-align: center; padding: 80px 24px; }
.code-404 { font-size: 96px; font-weight: 800; color: var(--bordo); font-family: 'Poppins', sans-serif; line-height: 1; }
.not-found-wrap h2 { font-size: 22px; margin: 16px 0 10px; }
.not-found-wrap p { color: var(--muted); margin-bottom: 24px; }
.btn-back { display: inline-block; background: var(--blu); color: var(--bianco); padding: 10px 22px; border-radius: 6px; font-size: 14px; font-weight: 600; transition: background .15s; }
.btn-back:hover { background: var(--blu-h); color: var(--bianco); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) { .content-wrap { grid-template-columns: 1fr 256px; gap: 24px; } }

@media (max-width: 860px) {
    .content-wrap { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
    .evidenza-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1/-1; }
    .footer-about p { max-width: 100%; }
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .main-nav { display: none; }
    .mobile-menu { display: flex; }
    .blog-grid { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .single-wrap { padding: 24px 18px 32px; margin-top: 16px; }
    .page-wrap { padding: 24px 18px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 32px 24px 24px; }
    .evidenza { padding: 28px 0; margin-bottom: 36px; }
    .evidenza-title { font-size: 20px; }
}

@media (max-width: 400px) { .container { padding: 0 14px; } }
