/* ═══════════════════════════════════════════════════════════════════
   JWMatrix Theme — Main Stylesheet
   Font: VT323 (Google Fonts) — terminal CRT aesthetic
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0d0d;
  --surface:   #141414;
  --card:      #1a1a1a;
  --border:    #2a2a2a;
  --green:     #00ff41;
  --green-dim: #00c032;
  --green-bg:  #001a0a;
  --red:       #e63946;
  --amber:     #f4a261;
  --text:      #e8e8e8;
  --muted:     #888;
  --white:     #ffffff;
  --radius:    0px;
  --accent:    #00ff41;
  --font:      'VT323', monospace;
  --font-mono: 'VT323', monospace;
  --font-title:'VT323', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
}

/* ── SCANLINES CRT ── */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

/* ── TOPBAR ── */
#topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,255,65,0.15);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 60px;
}
.logo {
  font-family: var(--font-title);
  font-size: 1.8rem; font-weight: 400; letter-spacing: 3px;
  color: var(--green); text-decoration: none;
  text-shadow: 0 0 12px rgba(0,255,65,0.5);
}
.logo span { color: var(--white); }

/* ── DESKTOP NAV ── */
#desktop-nav { display: flex; gap: 0; }
#desktop-nav a {
  padding: 0.35rem 0.9rem;
  color: var(--muted); text-decoration: none; font-size: 1.1rem;
  font-family: var(--font); letter-spacing: 1px;
  border: 1px solid transparent;
  transition: all 0.15s;
  position: relative;
}
#desktop-nav a::before { content: ''; }
#desktop-nav a:hover::before,
#desktop-nav a.active::before { content: '> '; color: var(--green); }
#desktop-nav a:hover,
#desktop-nav a.active {
  color: var(--green); border-color: var(--green-dim);
  background: var(--green-bg);
}

/* ── PILL BUTTON (topbar CTA) ── */
.pill {
  background: transparent; color: var(--green);
  font-family: var(--font); font-size: 1rem; letter-spacing: 1px;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--green);
  text-decoration: none; transition: all 0.2s;
}
.pill::before { content: '[ '; }
.pill::after  { content: ' ]'; }
.pill:hover { background: var(--green); color: #000; }

/* ── HAMBURGER ── */
#hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 6px; background: none; border: none;
}
#hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--green); transition: all 0.2s;
}

/* ── MOBILE NAV ── */
#mobile-nav {
  display: none; flex-direction: column;
  background: var(--surface); border-bottom: 1px solid var(--green-dim);
  padding: 0.5rem 0;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  padding: 0.75rem 1.5rem; color: var(--muted);
  font-family: var(--font); font-size: 1.3rem;
  text-decoration: none; border-left: 3px solid transparent;
  transition: all 0.15s;
}
#mobile-nav a::before { content: '> '; color: var(--green-dim); }
#mobile-nav a:hover,
#mobile-nav a.active {
  color: var(--green); border-left-color: var(--green);
  background: var(--green-bg);
}

/* ── HERO ── */
#hero {
  min-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 4rem 2rem;
  position: relative; overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #001a0a 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-badge {
  display: inline-block; margin-bottom: 1.5rem;
  background: var(--green-bg); border: 1px solid var(--green-dim);
  color: var(--green); font-family: var(--font); font-size: 1.1rem;
  padding: 0.2rem 1rem; letter-spacing: 2px;
}
.hero-badge::before { content: '> '; }
.hero-badge::after  { content: ' _'; animation: blink 1s step-end infinite; }
a.hero-badge { text-decoration: none; transition: box-shadow 0.2s, background 0.2s; }
a.hero-badge:hover { background: rgba(0,255,65,0.15); box-shadow: 0 0 16px rgba(0,255,65,0.3); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── MATRIX CANVAS ── */
#matrix-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.18; pointer-events: none; z-index: 0;
}

/* ── TYPOGRAPHY ── */
h1 {
  font-family: var(--font-title);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 400; line-height: 1.1; margin-bottom: 1.5rem;
  color: var(--white); letter-spacing: 2px;
}
h1 em {
  color: var(--green); font-style: normal;
  text-shadow: 0 0 20px rgba(0,255,65,0.4);
}
h2 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400; color: var(--white); letter-spacing: 1px;
  margin-bottom: 0.5rem;
}
h3 {
  font-family: var(--font);
  font-size: 1.3rem; font-weight: 400; color: var(--green);
  margin-bottom: 0.4rem;
}
p { color: var(--muted); line-height: 1.6; }
a { color: var(--green); }

.hero-sub {
  font-size: 1.35rem; color: var(--muted); max-width: 560px;
  margin: 0 auto 2.5rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  padding: 0.5rem 1.4rem;
  font-family: var(--font); font-size: 1.15rem; letter-spacing: 1px;
  text-decoration: none; cursor: pointer;
  border: 1px solid; transition: all 0.15s;
  display: inline-block;
}
.btn::before { content: '[ '; }
.btn::after  { content: ' ]'; }
.btn-primary {
  background: var(--green-bg); color: var(--green);
  border-color: var(--green);
  text-shadow: 0 0 8px rgba(0,255,65,0.5);
}
.btn-primary:hover { background: var(--green); color: #000; text-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

/* ── STATS BAR ── */
.stats-bar {
  display: flex; justify-content: center; gap: 3rem;
  padding: 2rem; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface); flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-n {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 400;
  color: var(--green); text-shadow: 0 0 8px rgba(0,255,65,0.4);
}
.stat-l {
  font-size: 0.8rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── CONTENT WRAPPER ── */
.content-wrap { max-width: 1100px; margin: 0 auto; padding: 4rem 2rem; }

/* ── PAGE HEADER ── */
.page-header {
  padding: 0;
  border-bottom: 1px solid var(--border);
  max-width: 1100px; margin: 0 auto;
}
.page-header .content-wrap { padding: 1.2rem 2rem 1rem; }
.page-header + .content-wrap { padding-top: 1.5rem; }
.page-header h2 {
  font-family: var(--font-title);
  font-size: 2.4rem; font-weight: 400; color: var(--white); margin-bottom: 0.5rem;
  letter-spacing: 1px;
}
.page-header p { color: var(--muted); font-size: 1.05rem; }
.page-header-uscire h2 { color: var(--amber); }

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 2rem; }
.section-header h2 { font-size: 1.6rem; color: var(--white); margin-bottom: 0.5rem; }
.section-header p  { color: var(--muted); }

/* ── GRID ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 1.5rem; }

/* ── CARD ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  padding: 1.5rem;
  transition: border-color 0.15s, border-left-color 0.15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.card:hover {
  border-color: var(--green-dim);
  border-left-color: var(--green);
}
.card-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }
.matrix-icon { font-family: var(--font); font-size: 1.1rem; color: var(--green-dim); letter-spacing: 0.05em; }
.card h3 { font-family: var(--font); font-size: 1.3rem; color: var(--green); margin-bottom: 0.4rem; }
.card h3::before { content: '> '; color: var(--green-dim); }
.card p { font-size: 1rem; color: var(--muted); line-height: 1.5; }
.card-tag {
  display: inline-block; margin-top: 1rem;
  font-family: var(--font); font-size: 0.9rem; padding: 0.1rem 0.5rem;
  border: 1px solid;
}
.tag-red   { border-color: var(--red);   color: var(--red); }
.tag-green { border-color: var(--green); color: var(--green); }
.tag-amber { border-color: var(--amber); color: var(--amber); }

/* ── SECTION INTRO ── */
.section-intro {
  background: var(--green-bg); border: 1px solid var(--green-dim);
  border-left: 4px solid var(--green);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem; color: var(--text); font-size: 1rem;
}
.section-intro::before { content: '// '; color: var(--green-dim); }
.section-intro strong { color: var(--green); }

/* ── MORPHEO BOX ── */
.morpheo-box {
  margin-top: 4rem; padding: 2rem;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
}
.morpheo-icon { font-size: 2.5rem; }
.morpheo-text { flex: 1; min-width: 200px; }
.morpheo-name { font-weight: 700; color: var(--white); margin-bottom: 0.25rem; font-size: 1.1rem; }
.morpheo-text p { color: var(--muted); font-size: 1rem; }

/* ── SINGLE ARTICLE ── */
.single-wrap { max-width: 800px; }
.single-article { margin: 0 auto; }
.article-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-title {
  font-family: var(--font-title); font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400; color: var(--white); line-height: 1.2;
  margin: 0.75rem 0;
}
.article-meta {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  color: var(--muted); font-size: 1rem; margin-top: 0.75rem;
}
.article-meta span::before { content: '// '; color: var(--green-dim); }
.article-meta span:first-child::before { content: ''; }
.article-body {
  font-size: 1.15rem; line-height: 1.7; color: var(--text);
}
.article-body p { margin-bottom: 1.25rem; color: var(--text); }
.article-body h2 { margin: 2rem 0 0.75rem; color: var(--green); font-size: 1.6rem; }
.article-body h3 { margin: 1.5rem 0 0.5rem; color: var(--green-dim); }
.article-body h3::before { content: '> '; }
.article-body blockquote {
  border-left: 3px solid var(--green-dim);
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: normal;
}
.article-body blockquote::before { content: '// '; color: var(--green-dim); }
.article-body ul, .article-body ol {
  padding-left: 1.5rem; margin-bottom: 1.25rem;
  color: var(--text);
}
.article-body li { margin-bottom: 0.4rem; }
.article-body li::marker { color: var(--green); }
.article-body a { color: var(--green); }
.article-body a:hover { text-decoration: underline; }
.article-body strong { color: var(--white); }
.article-body code {
  font-family: var(--font-mono); background: var(--surface);
  padding: 0.1rem 0.4rem; color: var(--green); font-size: 0.95em;
}
.article-body pre {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1rem; overflow-x: auto; margin-bottom: 1.25rem;
}
.article-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.article-nav { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 2rem; }
.tl-item::before {
  content: ''; position: absolute; left: -2.4rem; top: 0.3rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg);
}
.tl-year { font-size: 0.8rem; color: var(--green); font-weight: 700; margin-bottom: 0.25rem; }
.tl-title { font-weight: 700; color: var(--white); margin-bottom: 0.25rem; }
.tl-body { font-size: 0.9rem; color: var(--muted); }

/* ── DOC TABLE ── */
.doc-table-wrap { overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.doc-table th {
  text-align: left; padding: 0.75rem 1rem;
  background: var(--surface); color: var(--muted);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font);
}
.doc-table td {
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 1rem; color: var(--text);
  font-family: var(--font);
}
.doc-table tr:hover td { background: var(--card); }
.doc-table a { color: var(--green); text-decoration: none; }
.doc-table a:hover { text-decoration: underline; }
.doc-desc { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.hide-mobile { /* shown by default, hidden on mobile */ }

/* ── PAGINATION ── */
.pagination { margin-top: 3rem; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.pagination a,
.pagination span {
  font-family: var(--font); font-size: 1rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border); color: var(--muted);
  text-decoration: none; transition: all 0.15s;
}
.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination .current { border-color: var(--green); color: var(--green); background: var(--green-bg); }

/* ── FOOTER ── */
#site-footer {
  border-top: 1px solid var(--border); padding: 3rem 2rem 2rem;
  background: var(--surface);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 1rem;
}
.footer-logo {
  font-family: var(--font-title); font-size: 1.8rem;
  color: var(--green); letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(0,255,65,0.4);
}
.footer-logo span { color: var(--white); }
.footer-tagline { color: var(--muted); font-size: 1rem; }
.footer-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.footer-nav a {
  color: var(--muted); text-decoration: none; font-size: 1rem;
  padding: 0.2rem 0.6rem; border: 1px solid transparent;
  transition: all 0.15s;
}
.footer-nav a::before { content: '[ '; }
.footer-nav a::after  { content: ' ]'; }
.footer-nav a:hover { color: var(--green); border-color: var(--green-dim); }
.footer-contact a { color: var(--green); text-decoration: none; font-size: 1rem; }
.footer-disclaimer { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

/* ── CHI SONO ── */
.chi-sono-menu {
  background: var(--surface); border: 1px solid var(--green-dim);
  border-left: 3px solid var(--green);
  padding: 0.75rem 0; margin: 1.5rem 0;
  font-family: var(--font-mono); font-size: 1.1rem;
  display: flex; flex-direction: column;
}
.chi-sono-menu a {
  color: var(--green); text-decoration: none;
  padding: 0.4rem 1.5rem; display: block;
  transition: background 0.15s, padding-left 0.15s;
}
.chi-sono-menu a:hover {
  background: var(--green-bg); padding-left: 2rem;
  color: var(--green);
}
.chi-sono-lettera {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  padding: 2rem 2.5rem; margin: 2.5rem 0;
}
.chi-sono-lettera h2 { color: var(--amber); }
.chi-sono-lettera-fonte { color: var(--muted); font-size: 0.95rem; margin: 0.5rem 0 1rem; }
.chi-sono-disclaimer { color: var(--muted); font-size: 0.85rem; line-height: 1.7; font-style: italic; }
.chi-sono-lettera-link { cursor: default; }

/* ── AI MIEI FIGLI page ── */
.ai-figli-body p { line-height: 1.9; margin-bottom: 1.1rem; }
.ai-figli-illustration {
  margin: 3rem auto 1rem; text-align: center; max-width: 600px;
}
.ai-figli-illustration img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border); margin: 0 auto;
}
.ai-figli-illustration figcaption {
  color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem;
  font-style: italic;
}

/* ── RESPONSIVE 768px ── */
@media (max-width: 768px) {
  #desktop-nav { display: none; }
  #hamburger { display: flex; }
  .pill { display: none; }
  .stats-bar { gap: 1.2rem; padding: 1.5rem 1rem; }
  .stat-n { font-size: 1.6rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content-wrap { padding: 2rem 1rem; }
  .page-header { padding: 2rem 1rem 1.5rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hide-mobile { display: none; }
  .article-nav { flex-direction: column; }
}

/* ── RESPONSIVE 480px ── */
@media (max-width: 480px) {
  #topbar { padding: 0 1rem; }
  .logo { font-size: 1.4rem; }
  h1 { font-size: 2.4rem; }
  .page-header h2 { font-size: 1.8rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; display: grid; gap: 1rem; padding: 1rem; }
  .timeline { padding-left: 1.25rem; }
  .tl-item::before { left: -1.65rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   SEZIONE COMMENTI
   ══════════════════════════════════════════════════════════════════════════ */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--green);
}

.comments-title,
.comment-reply-title {
    font-family: 'VT323', monospace;
    color: var(--green);
    font-size: 1.6rem;
    letter-spacing: .08em;
    margin-bottom: 1.5rem;
}

.comment-reply-title small { font-size: 1rem; margin-left: .75rem; }
.comment-reply-title small a { color: var(--green-dim); text-decoration: none; }
.comment-reply-title small a:hover { color: var(--green); }

/* Lista commenti */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
}

.comment-list .children {
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 1rem;
    border-left: 2px solid var(--green-dim);
}

.comment-body {
    background: rgba(0, 255, 65, .04);
    border: 1px solid var(--green-dim);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.comment-body::before {
    content: '// COMMENTO';
    position: absolute;
    top: -0.6rem;
    left: 1rem;
    background: var(--bg);
    padding: 0 .5rem;
    font-family: 'VT323', monospace;
    font-size: .85rem;
    color: var(--green-dim);
    letter-spacing: .1em;
}

.comment-author .fn { color: var(--green); font-weight: 600; }
.comment-author .fn a { color: var(--green); text-decoration: none; }
.comment-metadata { font-size: .8rem; color: var(--green-dim); margin: .25rem 0 .75rem; }
.comment-metadata a { color: var(--green-dim); text-decoration: none; }
.comment-metadata a:hover { color: var(--green); }

.comment-content p { margin: 0 0 .75rem; color: var(--text); line-height: 1.65; }
.comment-content p:last-child { margin-bottom: 0; }

.comment-awaiting-moderation {
    font-size: .8rem;
    color: var(--yellow, #ffff00);
    margin-top: .5rem;
    font-style: italic;
}

.reply a {
    font-size: .8rem;
    color: var(--green-dim);
    text-decoration: none;
    border: 1px solid var(--green-dim);
    padding: .15rem .5rem;
    transition: color .2s, border-color .2s;
}
.reply a:hover { color: var(--green); border-color: var(--green); }

/* Form commento */
.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--green-dim);
    background: rgba(0, 255, 65, .03);
}

.comment-form label {
    display: block;
    font-size: .85rem;
    color: var(--green-dim);
    letter-spacing: .06em;
    margin-bottom: .3rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: transparent;
    border: 1px solid var(--green-dim);
    color: var(--green);
    font-family: 'VT323', monospace;
    font-size: 1rem;
    padding: .5rem .75rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 6px rgba(0, 255, 65, .25);
}

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

.comment-form p { margin: 0 0 1rem; }

.comment-form .comment-notes,
.comment-form .logged-in-as {
    font-size: .8rem;
    color: var(--green-dim);
    margin-bottom: 1rem;
}

.comment-form .form-submit input[type="submit"] {
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green);
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    letter-spacing: .1em;
    padding: .5rem 1.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: background .2s, color .2s;
}
.comment-form .form-submit input[type="submit"]:hover {
    background: var(--green);
    color: var(--bg);
}

/* Nasconde il campo honeypot (ridondante con lo style inline ma più sicuro) */
.jwm-hp { display: none !important; visibility: hidden; position: absolute; left: -9999px; }

/* Responsive commenti */
@media (max-width: 640px) {
    .comment-list .children { padding-left: .75rem; }
    .comment-body { padding: 1rem; }
    .comment-respond { padding: 1rem; }
}
