:root{
  --violet-main:#6C5CE7;
  --violet-dark:#4B3ACB;
  --bg-page:#F7F7FB;
  --text-main:#403E43;

  --border:#E5E7EB;
  --muted:#6B7280;
  --shadow:0 4px 6px rgba(0,0,0,0.10);
}

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  font-family: Arial, sans-serif;
  background: var(--bg-page);
  margin:0;
  padding:0;
  line-height:1.6;
  color:var(--text-main);
}

/* =========================
   HEADER (da header.html)
========================= */
.site-header{
  background: linear-gradient(90deg, var(--violet-dark), var(--violet-main));
  color:#fff;
  padding:12px 14px;
  box-shadow:0 2px 4px rgba(0,0,0,0.15);
  position:sticky;
  top:0;
  z-index:100;
}

.header-inner{
  max-width:1180px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.logo{
  font-size:1.4rem;
  font-weight:700;
  letter-spacing:0.03em;
}

#main-nav{
  display:flex;
  gap:18px;
  font-size:0.95rem;
}
#main-nav a{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  padding-bottom:2px;
}
#main-nav a:hover{ text-decoration:underline; }

/* Mobile menu (se lo usi in header.html) */
.menu-toggle{
  display:none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}
.menu-toggle span{ margin-left:4px; font-size:1.1rem; }

@media (max-width:768px){
  #main-nav{
    display:none;
    position:absolute;
    left:0; right:0;
    top:56px;
    margin:0 auto;
    max-width:1180px;
    flex-direction:column;
    background-color: var(--violet-dark);
    padding:10px 16px 12px 16px;
    border-radius:0 0 8px 8px;
    box-shadow:0 3px 6px rgba(0,0,0,0.25);
    z-index:150;
  }
  #main-nav a{ padding:6px 0; }
  body.nav-open #main-nav{ display:flex; }
  .menu-toggle{
    display:inline-flex;
    align-items:center;
  }
}

/* =========================
   MAIN LAYOUT (uguale ai vecchi articoli)
========================= */
main{
  max-width:900px;
  margin:30px auto;
  padding:20px;
  background:#fff;
  border-radius:10px;
  box-shadow: var(--shadow);
}

@media (max-width:600px){
  main{
    margin:16px auto;
    padding:16px 14px;
  }
}

/* Titoli */
h1,h2,h3{ color: var(--violet-dark); }
h1{ margin-top:0; }

/* Link */
a{ color: var(--violet-dark); }
a:hover{ text-decoration:underline; }

/* =========================
   RELATED (stile "Ti possono interessare anche")
========================= */
.related-wrap{
  margin: 28px 0 18px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.related-title{
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--violet-main);
  font-weight: 800;
  letter-spacing: -0.2px;
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin-top: 6px; /* micro polish: più aria */
}

.related-card{
  text-decoration: none;
  display: block;
}

.related-card:hover{ text-decoration: none; } /* evita underline globale sul box */

.related-card h3{
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--violet-dark);
  font-weight: 800;
}

.related-card p{
  margin: 0;
  color: rgba(64,62,67,0.8);
  font-size: 14px;
  line-height: 1.55;
}

.related-card:hover h3{
  text-decoration: underline;
}

.related-actions{
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

/* Responsive */
@media (max-width: 900px){
  .related-grid{ grid-template-columns: 1fr; gap: 14px; }
  .related-title{ font-size: 22px; }
}

/* Navigazione “back-links” */
.back-links{
  margin-bottom:20px;
  font-size:0.9rem;
}
.back-links a{
  color: var(--violet-dark);
  text-decoration:none;
  font-weight:600;
}
.back-links a:hover{ text-decoration:underline; }

/* Tag in alto */
.intro-tag{
  display:inline-block;
  background:#F3F4FF;
  color: var(--violet-dark);
  padding:4px 10px;
  border-radius:999px;
  font-size:0.8rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.06em;
  margin-bottom:8px;
}

/* Bottoni share */
.shareBtn{
  background: var(--violet-main);
  color:#fff;
  padding:10px 15px;
  border:none;
  border-radius:6px;
  cursor:pointer;
  margin: 6px 0 18px;
  font-weight:700;
}
.shareBtn:hover{ background: var(--violet-dark); }

/* Box vari */
.tip-box{
  background:#F6F4FF;
  border-left:4px solid var(--violet-main);
  padding:14px;
  margin:25px 0;
  border-radius:8px;
}

.mini-test{
  background:#FFFBEA;
  border-left:4px solid #FBBF24;
  padding:14px;
  margin:25px 0;
  border-radius:8px;
  font-size:0.95rem;
}

.syn-box{
  background:#F7F7FB;
  border-left:4px solid var(--violet-main);
  padding:14px;
  margin:18px 0;
  border-radius:8px;
}

/* Quote */
.quote{
  background:#F7F7FB;
  border:1px solid var(--border);
  border-left:4px solid var(--violet-main);
  padding:14px 16px;
  border-radius:10px;
  margin:18px 0;
  font-style:italic;
}

/* Liste */
.list{ margin:10px 0 0 18px; }
.list li{ margin:6px 0; }

/* CTA */
.cta-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:18px 0 8px;
}
.cta, .cta-ghost{
  display:inline-block;
  padding:10px 14px;
  border-radius:8px;
  text-decoration:none;
  font-weight:700;
}
.cta{
  background: var(--violet-main);
  color:#fff;
}
.cta:hover{ background: var(--violet-dark); text-decoration:none; }

.cta-ghost{
  background:#fff;
  color: var(--violet-dark);
  border:2px solid var(--violet-main);
}
.cta-ghost:hover{
  border-color: var(--violet-dark);
  color: var(--violet-dark);
  text-decoration:none;
}

/* Piccolo testo */
.small{
  font-size:0.9rem;
  color:#555;
}

/* Tabelle (se le usi) */
table{
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
  font-size:0.95rem;
}
th, td{
  border:1px solid var(--border);
  padding:8px 10px;
  text-align:left;
}
th{ background:#F3F4FF; }

/* =========================
   FOOTER (da footer.html)
========================= */
footer{
  text-align:center;
  margin-top:40px;
  padding:20px;
  background:#eee;
  font-size:0.9rem;
}

/* =========================
   Cookie banner (da gdpr.html)
========================= */
#cookie-banner{
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  max-width:90%;
  width:420px;
  background:#fff;
  border:2px solid var(--violet-main);
  border-radius:10px;
  padding:16px;
  box-shadow:0 4px 8px rgba(0,0,0,0.15);
  z-index:9999;
  font-family:Arial, sans-serif;
  display:none;
}
#cookie-banner p{
  margin:0 0 12px 0;
  font-size:0.95rem;
  color:#333;
  line-height:1.4;
}
#cookie-banner a{
  color: var(--violet-main);
  font-weight:700;
  text-decoration:none;
}
#cookie-banner a:hover{ text-decoration:underline; }

#cookie-banner button[onclick="rejectCookies()"]{
  flex:1;
  background:#fff !important;
  color:#111827 !important;
  border:2px solid var(--violet-main) !important;
  padding:10px 12px;
  border-radius:6px;
  cursor:pointer;
  font-weight:700;
}

#cookie-btn{
  flex:1;
  background: var(--violet-main);
  color:#fff;
  border:2px solid var(--violet-main);
  padding:10px 16px;
  border-radius:6px;
  cursor:pointer;
  font-weight:800;
}
#cookie-btn:hover{ background: var(--violet-dark); }
