/* Framia — blog e risorse. Usa i token di styles.css. */
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.blog-index { padding-block: clamp(40px, 7vh, 72px) clamp(72px, 12vh, 140px); }
.blog-head { max-width: 40ch; margin-bottom: clamp(28px, 5vh, 48px); }
.blog-head h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.blog-head p { margin-top: 14px; color: var(--on-surface-2); font-size: 18px; }
.blog-empty { color: var(--on-surface-2); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}
.post-card { border-radius: var(--radius-lg); background: var(--surface-2); overflow: hidden; }
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; flex: 1; }
.post-card h3 { font-size: 19px; line-height: 1.25; }
.post-card p { color: var(--on-surface-2); font-size: 15px; }
.post-card .post-meta { margin-top: auto; padding-top: 6px; color: var(--on-surface-2); font-size: 13px; }
.post-card-link:hover h3 { color: var(--brand); }
.post-card-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Articolo ---------- */

.post { max-width: 760px; padding-block: clamp(28px, 5vh, 48px) clamp(72px, 12vh, 140px); }
.crumbs { font-size: 14px; color: var(--on-surface-2); }
.crumbs a { color: inherit; }
.post-head h1 { margin-top: 18px; font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.02em; }
.byline { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--on-surface-2); font-size: 14px; }
.byline img { border-radius: 50%; flex-shrink: 0; }
.byline a { color: var(--on-surface); }

.post-cover { margin: 28px 0 0; }
.post-cover img { width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }

.short-answer {
  margin-top: 28px;
  padding: 20px 22px;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.short-answer strong { display: block; font-size: 14px; color: var(--brand); }
.short-answer p { margin-top: 6px; color: var(--on-surface-3); font-size: 17px; }

.toc { margin-top: 28px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.toc h2 { font-size: 16px; }
.toc ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.toc a { color: var(--on-surface-3); text-decoration: none; }
.toc a:hover { color: var(--brand); }

.prose { margin-top: 12px; font-size: 18px; line-height: 1.7; color: var(--on-surface-3); }
.prose h2 { margin-top: 48px; font-size: clamp(24px, 3vw, 30px); line-height: 1.2; color: var(--on-surface); scroll-margin-top: 90px; }
.prose h3 { margin-top: 32px; font-size: 21px; color: var(--on-surface); scroll-margin-top: 90px; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin-top: 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--on-surface); text-decoration-color: var(--brand); text-underline-offset: 3px; }
.prose a:hover { color: var(--brand); }
.prose strong { color: var(--on-surface); }
.prose img { width: 100%; height: auto; border-radius: var(--radius-md); display: block; margin-top: 8px; }
/* didascalia: riga in corsivo subito sotto l'immagine nello stesso paragrafo */
.prose p:has(> img) em { display: block; margin-top: 8px; font-size: 14px; color: var(--on-surface-2); }
.prose blockquote { padding-left: 18px; border-left: 3px solid var(--border-strong); color: var(--on-surface-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { color: var(--on-surface); }

.post-cta, .lead-box {
  margin-top: 44px;
  padding: clamp(22px, 4vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.post-cta { border: 1px solid var(--brand-dark); }
.post-cta h2, .lead-box h2 { font-size: 22px; line-height: 1.25; }
.post-cta p, .lead-box > p { margin-top: 10px; color: var(--on-surface-3); }
.post-cta .btn { margin-top: 18px; }
.lead-box ul { margin: 12px 0 0; padding-left: 20px; color: var(--on-surface-3); }
.lead-form { margin-top: 18px; }
.lead-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lead-row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 16px;
  font: inherit;
  color: var(--on-surface);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.lead-row input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lead-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; color: var(--on-surface-2); }
.lead-consent input { margin-top: 3px; accent-color: var(--brand); }
.lead-consent a { color: var(--on-surface-3); }
.lead-status { margin-top: 10px; font-size: 14px; color: var(--on-surface-2); }
.lead-done { margin-top: 6px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.resources { display: grid; gap: 24px; max-width: 760px; }
.resources .lead-box { margin-top: 0; }

.faq-block, .sources, .related { margin-top: 48px; }
.faq-block h2, .sources h2, .related h2 { font-size: 24px; }
.faq-block details { margin-top: 12px; padding: 14px 18px; border-radius: var(--radius-md); background: var(--surface-2); }
.faq-block summary { cursor: pointer; font-weight: 700; }
.faq-block details p { margin-top: 10px; color: var(--on-surface-3); }
.sources ol { margin: 12px 0 0; padding-left: 22px; color: var(--on-surface-2); font-size: 15px; }
.sources a { color: var(--on-surface-3); }
.related .post-grid { margin-top: 18px; }
.post .related { max-width: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Autore ---------- */
.author-box {
  display: flex; gap: 18px; align-items: flex-start;
  margin-top: 44px; padding: 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.author-box img, .author-head img { border-radius: 50%; flex-shrink: 0; }
.author-name { font-weight: 800; font-size: 18px; }
.author-name a { color: var(--on-surface); text-decoration: none; }
.author-name a:hover { color: var(--brand); }
.author-role { margin-top: 2px; font-size: 14px; color: var(--brand); }
.author-bio { margin-top: 10px; color: var(--on-surface-3); font-size: 15.5px; }
.author-head { display: flex; gap: 28px; align-items: flex-start; max-width: 820px; }
.author-head h1 { font-size: clamp(32px, 5vw, 46px); line-height: 1.05; }
.author-head .author-role { font-size: 16px; margin-top: 8px; }
.author-head .author-bio { font-size: 17px; }
.author-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 15px; }
.author-links a { color: var(--on-surface-3); }
@media (max-width: 560px) {
  .author-box, .author-head { flex-direction: column; }
  .author-box img { width: 72px; height: 72px; }
}
.post-cta-tool { margin: 16px 0 0; font-size: 15px; color: var(--on-surface-2); }
.post-cta-tool a { color: var(--brand); }
