/* WP Care AI Blog · stile dark sobrio · Onest font */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0e16;
  --bg-soft: #131822;
  --bg-card: #1a2030;
  --border: #232a3a;
  --text: #e8ecf3;
  --text-soft: #9aa3b5;
  --text-dim: #6b7385;
  --accent: #d4a056;
  --accent-soft: #e8c890;
  --link: #7ab8ff;
  --link-hover: #a5d0ff;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* --- HEADER --- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand-tag { font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

.site-nav { display: flex; gap: 24px; align-items: center; }
.site-nav a { color: var(--text-soft); text-decoration: none; font-size: 15px; transition: color .15s; font-weight: 500; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav .cta-link { background: var(--accent); color: #0a0e16; padding: 8px 16px; border-radius: 6px; font-weight: 600; }
.site-nav .cta-link:hover { background: var(--accent-soft); color: #0a0e16; }
.site-nav .lang-switch { color: var(--text-dim); border: 1px solid var(--border); padding: 5px 10px; border-radius: 4px; font-size: 13px; }
.site-nav .lang-switch:hover { color: var(--text); border-color: var(--accent); }

/* --- BLOG HERO --- */
.blog-hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
}
.blog-hero h1 {
  font-size: 48px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-soft) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.blog-hero .lead { font-size: 19px; color: var(--text-soft); max-width: 720px; line-height: 1.55; }

/* === BLOG HOME · FEATURED HERO (full-bleed, immagine + titolo sovrapposto) ===
   Stesso linguaggio di .article-hero-overlay · 16:9 native Pollinations · no deform */
.blog-featured {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9; max-height: 600px; min-height: 440px;
  background-color: var(--bg-soft);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  text-decoration: none; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.blog-featured:not(.has-img) {
  background:
    radial-gradient(ellipse at 28% 18%, rgba(212,160,86,0.20) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.blog-featured-gradient {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(10,14,22,0.28) 0%, rgba(10,14,22,0.52) 52%, rgba(10,14,22,0.93) 100%);
}
.blog-featured-content {
  position: relative; z-index: 2; height: 100%;
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 48px 24px 60px;
}
.blog-featured-eyebrow {
  align-self: flex-start;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em;
  color: #0a0e16; background: var(--accent);
  padding: 6px 14px; border-radius: 4px; margin-bottom: 22px;
}
.blog-featured-content .post-meta { color: rgba(255,255,255,0.82); margin-bottom: 14px; }
.blog-featured-content .post-cat { background: rgba(255,255,255,0.16); color: #fff; }
.blog-featured-content h1 {
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.025em;
  color: #fff; margin-bottom: 16px; max-width: 920px;
  text-shadow: 0 2px 28px rgba(0,0,0,0.55);
}
.blog-featured-excerpt {
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55;
  color: rgba(255,255,255,0.88); max-width: 700px; margin-bottom: 24px;
  text-shadow: 0 1px 14px rgba(0,0,0,0.5);
}
.blog-featured-cta {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  color: var(--accent-soft); font-weight: 700; font-size: 16px;
  border: 1px solid rgba(232,200,144,0.4); padding: 11px 24px; border-radius: 8px;
  background: rgba(10,14,22,0.35); backdrop-filter: blur(4px);
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.blog-featured:hover .blog-featured-cta {
  background: var(--accent); color: #0a0e16; border-color: var(--accent); transform: translateX(3px);
}
@media (max-width: 768px) {
  .blog-featured { aspect-ratio: auto; min-height: 500px; max-height: none; }
  .blog-featured-content { padding: 36px 20px 44px; }
}

/* === BLOG HOME · titolo sezione "Tutti gli articoli" === */
.blog-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--text-dim); margin: 0 0 28px;
  display: flex; align-items: center; gap: 18px;
}
.blog-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* === post-thumb fallback (articolo senza immagine) === */
.post-thumb[data-noimg="1"] {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 40% 28%, rgba(212,160,86,0.16) 0%, transparent 60%),
    linear-gradient(150deg, var(--bg-soft) 0%, var(--bg-card) 100%);
}
.post-thumb-fallback {
  font-size: 32px; font-weight: 700; letter-spacing: 0.20em;
  color: rgba(212,160,86,0.42);
}

/* --- POST GRID --- */
main { padding: 50px 0 80px; min-height: 60vh; }
.post-grid {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.post-card-featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.post-card-featured .post-thumb { aspect-ratio: 4/3; }
.post-card-featured .post-card-body { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.post-card-featured .post-title { font-size: 28px; }
@media (max-width: 768px) {
  .post-card-featured { grid-template-columns: 1fr; }
  .blog-hero h1 { font-size: 36px; }
}

.post-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.post-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-soft); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }

.post-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); align-items: center; flex-wrap: wrap; }
.post-cat { background: rgba(212, 160, 86, 0.12); color: var(--accent); padding: 3px 10px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; text-decoration: none; }
.post-cat:hover { background: rgba(212, 160, 86, 0.2); }
.post-date, .post-read { font-weight: 500; }
.post-read::before { content: '· '; color: var(--text-dim); }

.post-title { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.post-title a { color: var(--text); text-decoration: none; transition: color .15s; }
.post-title a:hover { color: var(--accent-soft); }
.post-excerpt { color: var(--text-soft); font-size: 15px; line-height: 1.55; flex: 1; }
.post-read-more { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; align-self: flex-start; }
.post-read-more:hover { color: var(--accent-soft); }

/* --- PAGINATION --- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 60px; padding: 24px; border-top: 1px solid var(--border); }
.pagination a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pagination a:hover { color: var(--accent-soft); }
.page-info { color: var(--text-dim); font-size: 14px; }

/* --- EMPTY STATE --- */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-soft); }
.empty-state h1, .empty-state h2 { color: var(--text); margin-bottom: 12px; font-size: 28px; }
.empty-state a { color: var(--accent); text-decoration: none; }

/* --- SINGLE ARTICLE --- */
.article-header { padding: 60px 0 32px; max-width: 720px; }
.article-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; font-size: 13px; color: var(--text-dim); }
.article-header h1 {
  font-size: 44px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 20px; color: var(--text);
}
@media (max-width: 768px) { .article-header h1 { font-size: 32px; } }
.article-lead {
  font-size: 22px; line-height: 1.5; color: var(--text-soft);
  margin-bottom: 28px; font-weight: 400;
}
.article-author { font-size: 14px; color: var(--text-dim); }
.article-author strong { color: var(--accent); font-weight: 600; }

.article-hero { max-width: 1080px; margin: 32px auto 48px; padding: 0 24px; }
.article-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }

/* === HERO OVERLAY · titolo sovrapposto a immagine full-bleed ===
   Aspect-ratio 16:9 = ratio Pollinations native (no crop, no deform)
   max-height 720px = STOP scaling oltre dimensione image originale
   align-items center = testo centrato verticalmente, NO drift verso bottom su widescreen */
.article-hero-overlay {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 720px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 56px;
  overflow: hidden;
}
@media (max-width: 768px) {
  .article-hero-overlay { aspect-ratio: auto; min-height: 60vh; max-height: none; }
}

.article-hero-overlay-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,14,22,0.55) 0%, rgba(10,14,22,0.25) 50%, rgba(10,14,22,0.55) 100%),
    radial-gradient(ellipse at center, rgba(10,14,22,0.15) 30%, rgba(10,14,22,0.55) 90%);
  pointer-events: none;
  z-index: 1;
}

.article-hero-overlay-content {
  position: relative; z-index: 2;
  max-width: 880px; margin: 0 auto; width: 100%;
  padding: 60px 32px;
  color: #fff;
  text-align: center;
}
.article-hero-overlay-content .article-meta { color: rgba(255,255,255,0.9); margin-bottom: 28px; justify-content: center; }
.article-hero-overlay-content .post-cat { background: var(--accent); color: #0a0e16; }
.article-hero-overlay-content .post-cat:hover { background: var(--accent-soft); }
.article-hero-overlay-content h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.025em;
  margin-bottom: 22px; color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.article-hero-overlay-content .article-lead {
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.5; color: rgba(255,255,255,0.92);
  margin-bottom: 26px; max-width: 720px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}
.article-hero-overlay-content .article-author { color: rgba(255,255,255,0.7); }
.article-hero-overlay-content .article-author strong { color: var(--accent-soft); }

/* === AEO TL;DR box · answer-first, speakable target === */
.aeo-tldr {
  max-width: 720px; margin: 0 auto 40px; padding: 22px 26px;
  background: linear-gradient(135deg, rgba(212,160,86,0.10) 0%, rgba(212,160,86,0.04) 100%);
  border: 1px solid rgba(212,160,86,0.35); border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.aeo-tldr-label {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent); margin-bottom: 8px;
}
.aeo-tldr p { font-size: 17px; line-height: 1.6; color: var(--text); margin: 0; font-weight: 500; }

.article-body {
  max-width: 720px; margin: 0 auto; padding: 0 24px; font-size: 18px; line-height: 1.75; color: var(--text);
}
/* FAQ section · visual distinction (AEO + UX) */
.article-body h2#domande-frequenti, .article-body h2#frequently-asked-questions { margin-top: 64px; }
.article-body h3 { scroll-margin-top: 80px; }
.article-body h2 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  margin: 56px 0 20px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 12px;
}
.article-body h3 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin: 36px 0 14px; color: var(--text);
}
.article-body h4 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; color: var(--accent-soft); }
.article-body p { margin: 0 0 22px; }
.article-body a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body a:hover { color: var(--link-hover); }
.article-body strong { color: var(--accent-soft); font-weight: 600; }
.article-body em { color: var(--text); font-style: italic; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 8px 0 8px 22px;
  margin: 28px 0; color: var(--text-soft); font-style: italic; background: rgba(212, 160, 86, 0.04);
}
.article-body code {
  background: var(--bg-soft); padding: 2px 8px; border-radius: 4px;
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; color: var(--accent-soft);
}
.article-body pre {
  background: var(--bg-soft); padding: 20px; border-radius: 8px;
  overflow-x: auto; margin: 28px 0; border: 1px solid var(--border);
}
.article-body pre code { background: transparent; padding: 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 48px 0; }

/* --- ARTICLE CTA --- */
.article-cta { padding: 60px 0; }
.cta-box {
  max-width: 720px; margin: 0 auto;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--accent); border-radius: 12px;
  padding: 40px; text-align: center;
}
.cta-box h3 { font-size: 26px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.cta-box p { color: var(--text-soft); margin-bottom: 24px; font-size: 16px; }
.cta-button {
  display: inline-block; background: var(--accent); color: #0a0e16;
  padding: 14px 28px; border-radius: 8px; font-weight: 700;
  text-decoration: none; transition: transform .15s, background .15s;
}
.cta-button:hover { background: var(--accent-soft); transform: translateY(-1px); }

/* --- FOOTER --- */
.site-footer {
  border-top: 1px solid var(--border); padding: 32px 0;
  color: var(--text-dim); font-size: 14px; text-align: center;
}
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* === ARTICLE TOC · indice contenuti (anchor jump, AEO-friendly) === */
.article-toc {
  max-width: 720px; margin: 0 auto 40px; padding: 22px 26px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px;
}
.article-toc-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent); margin-bottom: 12px;
}
.article-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.article-toc li { margin: 0; padding: 0; }
.article-toc li.toc-l2 { counter-increment: toc; }
.article-toc li.toc-l2 > a::before {
  content: counter(toc) ". "; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.article-toc li.toc-l3 { padding-left: 26px; }
.article-toc li.toc-l3 > a::before { content: '– '; color: var(--text-dim); }
.article-toc a {
  display: inline-block; padding: 5px 0; color: var(--text-soft);
  text-decoration: none; font-size: 15px; line-height: 1.4; transition: color .15s;
}
.article-toc a:hover { color: var(--accent-soft); }

/* anchor jump · evita che l'heading finisca sotto l'header sticky */
.article-body h2, .article-body h3 { scroll-margin-top: 90px; }

/* === ARTICLE NAV · precedente / indice / successivo === */
.article-nav {
  max-width: 720px; margin: 56px auto 0; padding: 28px 0 0;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch;
}
.article-nav-link {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.article-nav-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.article-nav-link.next { text-align: right; align-items: flex-end; }
.article-nav-dir { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.article-nav-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.article-nav-link:hover .article-nav-title { color: var(--accent-soft); }
.article-nav-index {
  align-self: center; white-space: nowrap;
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 99px;
  color: var(--text-soft); text-decoration: none; font-size: 13px; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.article-nav-index:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 720px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: left; align-items: flex-start; }
  .article-nav-index { order: 3; justify-self: center; }
}

/* --- accessibility --- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
