/* Articolo blog EN — estratto da en/blog/article.php (prima era <style> inline in ogni pagina) */
/* ── AI stat block (StatisticalVariable) ── */
.ai-stat-block {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
}
.ai-stat-caption { font-style: normal; }
.ai-stat-label { display: block; font-size: 0.8125rem; color: var(--white-dim); margin-bottom: 0.25rem; }
.ai-stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.ai-stat-source { display: block; margin-top: 0.5rem; font-size: 0.75rem; color: var(--white-dim); opacity: 0.7; }
.ai-stat-source a { color: var(--brand-dim); text-decoration: none; }
@media (hover: hover) { .ai-stat-source a:hover { text-decoration: underline; } }

/* ── Expert quote block ── */
.expert-quote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: rgba(255,255,255,0.02);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.expert-quote p { font-size: 1.0625rem; font-style: italic; color: var(--white); margin-bottom: 0.75rem; }
.expert-quote-footer { font-size: 0.8125rem; color: var(--white-dim); }
.expert-quote-footer a { color: var(--brand-dim); text-decoration: none; }
@media (hover: hover) { .expert-quote-footer a:hover { text-decoration: underline; } }

.blog-article-page { padding-top: calc(var(--header-height) + 2rem); padding-bottom: 6rem; }
.blog-article-page .container { max-width: 800px; }
.breadcrumbs { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--white-dim); opacity: 0.82; margin-bottom: 2.5rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--white-dim); transition: color 0.2s var(--ease-smooth); }
@media (hover: hover) { .breadcrumbs a:hover { color: var(--brand); } }
.article-header { margin-bottom: 3rem; }
.article-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--white-dim); opacity: 0.88; }
.card-reading-time { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--white-dim); }
.article-sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.875rem; line-height: 1.7; }
.article-sources-label { font-weight: 700; color: var(--white-dim); font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.article-sources-text { color: var(--white-dim); }
.article-sources-sep { color: rgba(255,255,255,0.15); }
.article-sources-link { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(0,212,255,0.35); transition: all 0.2s var(--ease-smooth); }
@media (hover: hover) { .article-sources-link:hover { color: var(--white); text-decoration-color: var(--white); } }
.article-sources-name { color: var(--white-dim); }
.post-updated { padding: 0.125rem 0.5rem; background: var(--accent-subtle); border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--accent); }
.article-title { font-size: clamp(2.3rem, 4vw, 3.75rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; color: var(--white); }
.article-subtitle { font-size: 1.15rem; line-height: 1.6; color: var(--white-dim); opacity: 0.88; margin-top: 1rem; text-wrap: balance; border-left: 3px solid var(--brand); padding-left: 1.25rem; }
.article-cover { margin-top: 2rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgba(255,255,255,0.06); aspect-ratio: 16 / 9; }
.article-cover img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: top; }
.cover-credit { margin: 0; padding: 0.15rem 0 0 0; font-size: 0.625rem; line-height: 1.3; text-align: start; color: rgba(255,255,255,0.55); }
.post-content > p:has(> picture) { text-align: center; margin-bottom: 0 !important; line-height: 0; font-size: 0; }
.post-content > p:has(> picture) picture { display: inline-block; margin: 1.5rem 0 0.75rem 0; }
.post-content > p:has(> picture) img { display: block; margin: 0; }
.post-content > p:has(> picture) + p { margin-top: 0 !important; }
.post-content > p:has(> picture) + p em { display: block; padding: 0.15rem 0 0 0; font-size: 0.625rem; line-height: 1.3; text-align: start; color: rgba(255,255,255,0.55); font-style: normal; }

.post-content { font-size: 1.125rem; line-height: 1.8; color: rgba(255, 255, 255, 0.78); }
.post-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--white); margin-top: 2.5rem; margin-bottom: 1rem; letter-spacing: -0.02em; }
.post-content h3 { font-size: 1.25rem; font-weight: 600; color: var(--white); margin-top: 2rem; margin-bottom: 0.75rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content strong { color: var(--white); font-weight: 600; }
.post-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(0, 212, 255, 0.3); transition: all 0.2s var(--ease-smooth); }
@media (hover: hover) { .post-content a:hover { text-decoration-color: var(--brand); } }
.post-content ul, .post-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote { border-left: 3px solid var(--brand); padding: 1rem 1.25rem; margin: 1.5rem 0; background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--white-dim); font-style: italic; }
.post-content pre { background: var(--surface); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-md); padding: 1.25rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.6; margin: 1.5rem 0; }
.post-content code { font-family: var(--font-mono); font-size: 0.875em; background: rgba(255,255,255,0.06); padding: 0.15em 0.35em; border-radius: 3px; }
.post-content pre code { background: none; padding: 0; border-radius: 0; }
.post-content hr { border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 2.5rem 0; }
.post-content picture { display: block; margin: 2rem auto; width: fit-content; max-width: 100%; }
.post-content img { display: block; margin: 2rem auto; max-width: 100%; height: auto; border-radius: var(--radius-md); }
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.06); }
.related-title { font-size: 1.25rem; font-weight: 700; color: var(--white); margin-bottom: 1.25rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.related-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-md); text-decoration: none; transition: all 0.25s var(--ease-smooth); }
@media (hover: hover) { .related-card:hover { background: var(--accent-subtle); border-color: rgba(139, 92, 246, 0.2); } }
.related-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--white); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.related-card-date { font-size: 0.75rem; font-family: var(--font-mono); color: var(--white-dim); opacity: 0.5; }
@media (max-width: 820px) { .related-grid { grid-template-columns: 1fr; } }
.article-nav { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.06); }
.article-nav-back { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--brand-dim); transition: all 0.2s var(--ease-smooth); margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
@media (hover: hover) { .article-nav-back:hover { color: var(--brand); } }
.article-nav-links { display: flex; gap: 1rem; }
.article-nav-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.25rem; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-md); text-decoration: none; transition: all 0.25s var(--ease-smooth); }
@media (hover: hover) { .article-nav-link:hover { background: var(--accent-subtle); border-color: rgba(139, 92, 246, 0.2); } }
.article-nav-prev .article-nav-direction { justify-content: flex-start; }
.article-nav-next .article-nav-direction { justify-content: flex-end; }
.article-nav-direction { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--brand); opacity: 0.85; transition: all 0.2s var(--ease-smooth); }
@media (hover: hover) { .article-nav-link:hover .article-nav-direction { opacity: 1; color: var(--brand); } }
.article-nav-title { font-size: 0.875rem; font-weight: 500; color: var(--white); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.8; }
.article-nav-prev:only-child { max-width: 50%; }
.article-nav-next:only-child { max-width: 50%; margin-left: auto; }
@media (max-width: 820px) { .blog-article-page { padding-top: calc(var(--header-height) + 1rem); padding-bottom: 5.5rem; } .post-content { font-size: 1.125rem; } .article-nav-title { display: none; } .article-nav-links { gap: 0.75rem; } .article-nav-link { padding: 0.75rem 1rem; } }
.article-footer-note {
  margin-top: 3rem;
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--white-dim);
  line-height: 1.6;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
}
.article-footer-note .ai-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
  border-radius: 2px;
}

/* ── Comments delimiter ── */
.comments-delimiter {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin: 3rem 0;
  width: 100%;
}

/* ── Comments section ── */
.comments-section {
  margin-top: 3rem;
}

.comments-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  font-family: inherit;
}
@media (hover: hover) { .comments-toggle:hover {
  background: var(--accent-subtle);
  border-color: rgba(139, 92, 246, 0.2);
} }
.comments-toggle-icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--brand);
  opacity: 0.8;
}
.comments-toggle-label {
  flex: 1;
  text-align: left;
}
.comments-toggle-count {
  color: var(--white-dim);
  font-size: 0.8125rem;
  font-weight: 400;
}
.comments-toggle-arrow {
  flex-shrink: 0;
  color: var(--white-dim);
  transition: transform 0.3s var(--ease-smooth);
}
.comments-toggle[aria-expanded="true"] .comments-toggle-arrow {
  transform: rotate(180deg);
}

.comments-container {
  margin-top: 1.25rem;
}

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-nickname {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brand);
  font-family: var(--font-mono);
}

.comment-time {
  font-size: 0.75rem;
  color: var(--white-dim);
  opacity: 0.5;
  flex-shrink: 0;
}

.comment-body {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.8);
  word-wrap: break-word;
}

.comments-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--white-dim);
  font-size: 0.875rem;
  opacity: 0.6;
  margin-bottom: 2rem;
}

/* ── Comment form ── */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form-field {
  display: flex;
  flex-direction: column;
}

.comment-input,
.comment-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  color: var(--white);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease-smooth);
  outline: none;
  box-sizing: border-box;
}

.comment-input:focus,
.comment-textarea:focus {
  border-color: var(--brand);
  background: rgba(0, 212, 255, 0.04);
}

.comment-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--white-dim);
  cursor: pointer;
  user-select: none;
}

.comment-remember input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.comment-gdpr {
  font-size: 0.75rem;
  color: var(--white-dim);
  opacity: 0.55;
  line-height: 1.5;
  margin: 0;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-submit {
  min-width: 160px;
}

.comment-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-feedback {
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.comment-feedback:not([hidden]) {
  display: block;
}

.comment-feedback.comment-feedback-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.comment-feedback.comment-feedback-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.comment-feedback.comment-feedback-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #eab308;
}

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

/* ── Comments animation ── */
@keyframes commentFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.comments-container-visible {
  animation: commentFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.comments-container-visible .comment-item {
  animation: commentFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.comments-container-visible .comment-item:nth-child(1) { animation-delay: 0.02s; }
.comments-container-visible .comment-item:nth-child(2) { animation-delay: 0.05s; }
.comments-container-visible .comment-item:nth-child(3) { animation-delay: 0.08s; }
.comments-container-visible .comment-item:nth-child(4) { animation-delay: 0.11s; }
.comments-container-visible .comment-item:nth-child(5) { animation-delay: 0.14s; }
.comments-container-visible .comment-item:nth-child(6) { animation-delay: 0.17s; }
.comments-container-visible .comment-item:nth-child(7) { animation-delay: 0.20s; }
.comments-container-visible .comment-item:nth-child(8) { animation-delay: 0.23s; }
.comments-container-visible .comment-item:nth-child(9) { animation-delay: 0.26s; }
.comments-container-visible .comment-item:nth-child(n+10) { animation-delay: 0.28s; }

.comments-container-visible .comment-form {
  animation: commentFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

/* ── Sort bar ── */
.comments-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
}
.comments-sort-label {
  font-size: 0.8125rem;
  color: var(--white-dim);
  opacity: 0.6;
}
.comments-sort-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease-smooth);
}
@media (hover: hover) { .comments-sort-btn:hover {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--white);
} }
.comments-sort-btn.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

/* ── Reply button ── */
.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--white-dim);
  opacity: 0.65;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
@media (hover: hover) { .comment-reply-btn:hover {
  opacity: 1;
  color: var(--brand);
} }
.comment-reply-btn svg {
  flex-shrink: 0;
}

/* ── Reply form (inline, nested) ── */
.comment-reply-form {
  margin-top: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(139, 92, 246, 0.15);
}
.comment-reply-form .comment-form-field {
  margin-bottom: 0.5rem;
}
.comment-reply-form .reply-textarea {
  min-height: 60px;
}
.comment-reply-form .comment-form-actions {
  gap: 0.5rem;
}
.comment-reply-cancel {
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--white-dim);
  transition: all 0.2s var(--ease-smooth);
}
@media (hover: hover) { .comment-reply-cancel:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--white);
} }

/* ── Threaded replies ── */
.comment-replies {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  border-left: 2px solid rgba(255,255,255,0.04);
  padding-left: 1rem;
}
.comment-replies .comment-item {
  margin-bottom: 0.75rem;
  background: rgba(255,255,255,0.015);
  border-color: rgba(255,255,255,0.04);
}
.comment-replies .comment-item:last-child {
  margin-bottom: 0;
}
.comment-depth-end {
  font-size: 0.75rem;
  color: var(--white-dim);
  opacity: 0.4;
  text-align: center;
  padding: 0.5rem 0;
  margin: 0;
}

/* ── Load more ── */
.comments-load-more {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 0.875rem;
  font-family: inherit;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  color: var(--white-dim);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
@media (hover: hover) { .comments-load-more:hover {
  background: var(--accent-subtle);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--white);
} }
.comments-load-more[hidden] {
  display: none;
}

/* ── SICUREZZA: campo honeypot invisibile (antibot) ── */
.comment-hp {
  position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; width: 0;
}

/* ── Main form ── */
.comment-main {
  display: flex;
  flex-direction: column;
}

/* Titoletti promossi da normalizeHeadingLevels(): semantica h2/h3, aspetto originale */
.post-content h2.as-h3 { font-size: 1.25rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; letter-spacing: normal; }
.post-content h3.as-h4 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
