/* ============================================================
   BLOG ARTICLES — Energia Solare Srl
   Tipografia di brand (Outfit + DM Sans), spaziatura e tabelle.
   Tutto il contenuto articolo va racchiuso in <div class="es-article">.
   ============================================================ */

.es-article {
  --es-green: #059669;
  --es-green-dark: #047857;
  --es-green-darker: #064E3B;
  --es-green-50: #ECFDF5;
  --es-green-100: #D1FAE5;
  --es-orange: #F59E0B;
  --es-gray-900: #111827;
  --es-gray-800: #1F2937;
  --es-gray-700: #374151;
  --es-gray-600: #4B5563;
  --es-gray-200: #E5E7EB;
  --es-gray-100: #F3F4F6;
  --es-gray-50: #F9FAFB;

  font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;       /* ~17px */
  line-height: 1.78;
  color: var(--es-gray-700);
  max-width: 820px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  .es-article { font-size: 1.125rem; }  /* ~18px su desktop */
}

/* ---------- Paragrafi ---------- */
.es-article p {
  margin: 0 0 1.35rem;
}

.es-article strong { color: var(--es-gray-900); font-weight: 700; }

/* ---------- Titoli ---------- */
.es-article h2,
.es-article h3,
.es-article h4 {
  font-family: 'Outfit', 'DM Sans', system-ui, sans-serif;
  color: var(--es-green-darker);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.es-article h2 {
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 700;
  margin: 3rem 0 1.1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--es-gray-200);
}

/* Prima h2 senza bordo sopra */
.es-article > h2:first-of-type { border-top: none; padding-top: 0; margin-top: 2rem; }

.es-article h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: var(--es-green-dark);
  margin: 2rem 0 0.75rem;
}

.es-article h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--es-gray-800);
  margin: 1.5rem 0 0.6rem;
}

/* ---------- Liste ---------- */
.es-article ul,
.es-article ol {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
}

.es-article li {
  margin-bottom: 0.6rem;
  padding-left: 0.3rem;
}

.es-article ul li::marker { color: var(--es-green); }
.es-article ol li::marker { color: var(--es-green); font-weight: 700; }

/* ---------- Link ---------- */
.es-article a {
  color: var(--es-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color .2s ease;
}
.es-article a:hover { color: var(--es-orange); }

/* ---------- Tabelle ---------- */
.es-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0 2.2rem;
  font-size: 0.97rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

/* Scroll orizzontale solo su mobile, senza rompere il layout desktop */
@media (max-width: 600px) {
  .es-article table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.es-article thead {
  background: linear-gradient(135deg, var(--es-green), var(--es-green-dark));
}

.es-article th {
  color: #fff;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  font-size: 0.92rem;
}

.es-article td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--es-gray-200);
  vertical-align: top;
}

.es-article tbody tr:nth-child(even) { background: var(--es-gray-50); }
.es-article tbody tr:hover { background: var(--es-green-50); }
.es-article tbody tr:last-child td { border-bottom: none; }

/* ---------- Citazioni / box consiglio ---------- */
.es-article blockquote {
  margin: 1.8rem 0;
  padding: 1.1rem 1.4rem;
  background: var(--es-green-50);
  border-left: 4px solid var(--es-green);
  border-radius: 0 12px 12px 0;
  color: var(--es-gray-800);
}
.es-article blockquote p { margin: 0; }
.es-article blockquote p + p { margin-top: 0.8rem; }

/* ---------- Immagini / figure ---------- */
.es-article figure {
  margin: 2rem 0;
}
.es-article img {
  border-radius: 12px;
  width: 100%;
  height: auto;
  display: block;
}
.es-article figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--es-gray-600);
  margin-top: 8px;
}

/* ---------- Separatore ---------- */
.es-article hr {
  border: none;
  border-top: 2px solid var(--es-gray-100);
  margin: 2.8rem 0;
}

/* ---------- CTA finale (lista contatti) ---------- */
.es-article h3 + ul {
  background: var(--es-gray-50);
  border: 1px solid var(--es-gray-200);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 1.2rem 2.4rem;
  list-style: none;
  margin-left: 0;
}
