:root { --bg: #f9fafb; --card: #ffffff; --text: #111827; --muted: #6b7280; --brand: #2563eb; }
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 0; background: var(--bg); color: var(--text); }
.site-header, .site-footer { background: var(--card); padding: 12px 16px; border-bottom: 1px solid #e5e7eb; }
.site-footer { border-top: 1px solid #e5e7eb; border-bottom: none; text-align: center; }
.site-header h1 { margin: 0; font-size: 20px; }
.site-header nav a { margin-right: 12px; text-decoration: none; color: var(--brand); }
.site-header .nav-right { margin-left: 12px; color: var(--muted); }
.container { max-width: 860px; margin: 24px auto; padding: 0 16px; }
.post-list { list-style: none; padding: 0; }
.post-list li { background: var(--card); padding: 12px; margin-bottom: 10px; border: 1px solid #e5e7eb; border-radius: 8px; }
.post-list .subtitle { color: var(--muted); margin-left: 6px; }
.post-list .date { float: right; color: var(--muted); font-size: 12px; }
.post-list .actions a { margin-left: 10px; font-size: 12px; }
.post h2 { margin-top: 0; }
.form label { display: block; margin-bottom: 12px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form textarea { width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.form button, .button-link { background: var(--brand); color: white; border: 0; padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
.error { color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca; padding: 8px; border-radius: 6px; }
.muted { color: var(--muted); font-size: 12px; }

/* === Layout editor newsletter: testo sx, anteprima immagini dx, preview sotto === */
.nl-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}
.nl-left { min-width: 0; }
.nl-right {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 12px;
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.img-preview {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: center;
}
.img-preview img {
  max-width: 100%;
  height: auto;
}
.nl-images {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}
.nl-images li {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  background: #fff;
}
.nl-images img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}
.mini-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.nl-preview {
  margin-top: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  padding: 0;
}
@media (max-width: 900px) {
  .nl-grid { grid-template-columns: 1fr; }
  .nl-right { position: static; max-height: none; }
}

/* ===== Overrides solo per la pagina newsletter ===== */
.nl-page .container { max-width: 1200px; }              /* più larga, 2 colonne stabili */
.nl-page .nl-grid { grid-template-columns: minmax(0,1fr) 360px; }  /* sinistra fluid, destra fissa */
@media (max-width: 1024px) {
  .nl-page .nl-grid { grid-template-columns: minmax(0,1fr) 320px; }
}
@media (max-width: 820px) {
  .nl-page .nl-grid { grid-template-columns: 1fr; }     /* solo su smartphone torna 1 colonna */
  
  /* Colonna stretta stile newsletter, applicata quando il body ha la classe .editor-narrow */
.editor-narrow .nl-left .form,
.editor-narrow .nl-preview .inner {
  max-width: 640px;   /* puoi scendere a 600 o salire a 680 se vuoi */
  margin: 0 auto;
}
}

/* Home a due card */
.home-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 800px){
  .home-cards { grid-template-columns: 1fr; }
}
.card { border: 1px solid #e6edf3; border-radius: 14px; background: #fff; overflow: hidden; }
.card-body { padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 22px; }
.card p { margin: 0 0 12px; color: #6b7b8b; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-block; padding: 10px 14px; border-radius: 999px;
  background: #122559; color: #fff; border: 1px solid #122559; font-weight: 700;
}
.btn:hover { opacity: .92; }
.btn.outline { background: #fff; color: #122559; }
.btn.ghost { background: #fff; color: #122559; border-style: dashed; }