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

:root {
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
  --text:  #292929;
  --text2: #6b6b6b;
  --text3: #9b9b9b;
  --border: #e8e8e8;
  --bg:    #fff;
  --bg2:   #f9f9f9;
  --bg3:   #f2f2f2;
  --accent: #c96edc;
  --accent2: #a855c8;
}

body {
  font-family: var(--sans);
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; }

/* ── header ── */
.site-header-outer {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
  font-size: 1.05rem; font-weight: 700; text-decoration: none; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.site-logo img { width:28px; height:28px; flex-shrink:0; border-radius:6px; }
.header-nav { display:flex; gap:24px; align-items:center; }
.header-nav a {
  font-size:.9rem; text-decoration:none; color:var(--text2);
  transition: color .2s;
}
.header-nav a:hover { color:var(--text); }
.header-nav a.active { color:var(--text); font-weight:600; }

/* ── footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  text-align:center; padding:32px 20px 24px;
  display:flex; flex-direction:column; align-items:center; gap:16px;
}
.footer-socials { display:flex; gap:18px; }
.footer-social-link {
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border:1px solid var(--border);
  border-radius:50%; color:var(--text2);
  transition: border-color .2s, color .2s;
}
.footer-social-link:hover { border-color:var(--text); color:var(--text); }
.footer-social-link svg { width:18px; height:18px; }
.footer-legal {
  display:flex; align-items:center; justify-content:center;
  gap:12px; flex-wrap:wrap;
  font-size:.75rem; color:var(--text3);
}
.footer-legal a { color:var(--text3); text-decoration:none; }
.footer-legal a:hover { color:var(--text); }

/* ── blog list ── */
.blog-hero {
  max-width: 1200px; margin: 0 auto;
  padding: 48px 20px 40px;
}
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; line-height: 1.1; margin-bottom: 12px;
  color: #1a1a1a;
}
.blog-hero p {
  font-size: 1.1rem; color: var(--text2); max-width: 560px; line-height: 1.6;
}
.post-grid {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); border-color: #d0d0d0; }
.card-cover { aspect-ratio: 16/9; overflow: hidden; }
.card-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--text3); }
.card-reading::before { content: "·"; margin-right: 8px; }
.card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.card-title a { text-decoration: none; color: var(--text); }
.card-title a:hover { color: #1a1a1a; text-decoration: underline; }
.card-excerpt { font-size: .9rem; color: var(--text2); line-height: 1.6; flex: 1; }
.card-link {
  display: inline-block; margin-top: 4px;
  font-size: .88rem; font-weight: 600; text-decoration: none;
  color: var(--accent); transition: color .2s;
}
.card-link:hover { color: var(--accent2); }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .post-grid { grid-template-columns: 1fr; padding: 0 15px 60px; }
  .blog-hero { padding: 28px 15px 32px; }
}

/* ── single post ── */
.breadcrumb {
  max-width: 740px; margin: 0 auto;
  padding: 16px 20px;
  font-size: .82rem; color: var(--text3);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text3); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { opacity: .5; }
.post-wrap { max-width: 740px; margin: 0 auto; padding: 0 20px 80px; }
.post-header { margin-bottom: 28px; }
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.post-tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  background: var(--bg3); color: var(--text2);
}
.post-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.2; margin-bottom: 14px; color: #1a1a1a; }
.post-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--text3); }
.post-meta-sep { opacity: .5; }
.post-cover { margin: 24px 0 32px; border-radius: 8px; overflow: hidden; }
.post-cover img { width:100%; height:auto; display:block; }

/* Article body — serif per il comfort di lettura */
.post-body {
  font-family: var(--serif);
  font-size: 1.12rem; line-height: 1.85; color: var(--text);
}
.post-body h2 {
  font-family: var(--sans);
  font-size: 1.45rem; font-weight: 700; line-height: 1.25;
  margin: 2.2em 0 .7em; color: #1a1a1a;
}
.post-body h3 {
  font-family: var(--sans);
  font-size: 1.15rem; font-weight: 700; line-height: 1.3;
  margin: 1.8em 0 .6em; color: #1a1a1a;
}
.post-body p { margin-bottom: 1.4em; }
.post-body ul, .post-body ol { padding-left: 1.6em; margin-bottom: 1.4em; }
.post-body li { margin-bottom: .55em; }
.post-body strong { color: #1a1a1a; font-weight: 700; }
.post-body table strong { color: #1a1a1a; font-weight: 700; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body a:hover { color: var(--accent2); }
.post-body blockquote {
  border-left: 3px solid var(--border);
  padding: .6em 0 .6em 1.2em; margin: 1.5em 0;
  color: var(--text2); font-style: italic;
}
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* CTA fondo articolo */
.post-cta {
  margin-top: 52px; padding: 32px 36px;
  background: linear-gradient(135deg, #fdf4ff 0%, #f3e8fd 100%);
  border: 1px solid #e9c8f5;
  border-radius: 16px;
  font-family: var(--sans);
  display: flex; align-items: center; gap: 28px;
}
.post-cta-body { flex: 1; }
.post-cta h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: #6b21a8; }
.post-cta p  { font-size: .95rem; color: #7e22ce; margin-bottom: 20px; }
.cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #c96edc; border: none;
  padding: 13px 26px; border-radius: 50px;
  text-decoration: none; color: #fff !important; font-weight: 600;
  box-shadow: 0 2px 10px rgba(201,110,220,.3);
  transition: background .25s, transform .2s, box-shadow .2s;
}
.cta-btn:hover { background: #a855c8; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(201,110,220,.4); }
.cta-btn svg { width: 22px; height: 22px; }
.post-cta-icon { flex-shrink: 0; width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
@media (max-width: 560px) { .post-cta { flex-direction: column; } .post-cta-icon { display: none; } }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .9rem; color: var(--text2); text-decoration: none;
  margin-bottom: 24px; transition: color .2s;
  font-family: var(--sans);
}
.back-link:hover { color: var(--text); }

/* inline app cta (dopo TOC) */
.inline-app-cta {
  display: flex; align-items: center;
  gap: 24px;
  margin: 28px 0 36px;
  padding: 28px 32px;
  background: linear-gradient(135deg, #fdf4ff 0%, #f3e8fd 100%);
  border: 1px solid #e9c8f5;
  border-radius: 16px;
  font-family: var(--sans);
}
.inline-app-cta-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.inline-app-cta-body strong { font-size: 1.05rem; font-weight: 700; color: #6b21a8; }
.inline-app-cta-body span { font-size: .88rem; color: #7e22ce; }
.inline-app-cta-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.inline-cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 50px;
  background: #c96edc; border: none;
  text-decoration: none; color: #fff !important; font-size: .9rem; font-weight: 600;
  box-shadow: 0 2px 10px rgba(201,110,220,.3);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.inline-cta-btn:hover { background: #a855c8; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(201,110,220,.4); }
.inline-cta-btn svg { width: 18px; height: 18px; }
.inline-app-cta-icon { flex-shrink: 0; width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
@media (max-width: 480px) { .inline-app-cta-icon { display: none; } }

/* related posts */
.related-posts {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
}
.related-posts h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; color: #1a1a1a; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-card {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.related-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); border-color: #d0d0d0; }
.related-card-cover { aspect-ratio: 16/9; overflow: hidden; }
.related-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.related-card-meta { font-size: .75rem; color: var(--text3); }
.related-card-title { font-size: .92rem; font-weight: 650; line-height: 1.35; color: var(--text); }
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  .post-wrap { padding: 0 15px 60px; }
  .breadcrumb { padding: 0 15px 12px; }
  .inline-app-cta { flex-direction: column; align-items: flex-start; }
}

/* ── tables ── */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans);
}
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  min-width: 500px;
}
.styled-table thead tr {
  background-color: var(--bg3);
  text-align: left;
}
.styled-table th, .styled-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.styled-table th { color: #1a1a1a; font-weight: 600; }
.styled-table td { color: var(--text); }
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-of-type(even) { background-color: #fafafa; }
.styled-table tbody tr:hover { background-color: var(--bg3); }
