/* ============================================================
   SINGLE POST – NES | Hello Elementor Child Theme
   Aggiungere in coda a: css/blog-archive.css
   ============================================================ */

/* ── LAYOUT 2 COLONNE ─────────────────────────────────────── */
.nes-single-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 52px;
  padding-top: 56px;
  padding-bottom: 88px;
  align-items: start;
}

/* ── ARTICOLO ─────────────────────────────────────────────── */
.nes-article { min-width: 0; }

/* Thumbnail */
.nes-single-thumb {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 32px;
  background: #e8e2da;
  max-height: 480px;
}
.nes-single-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nes-single-cat {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #C8102E;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 16px;
}

/* Header titolo */
.nes-single-header { margin-bottom: 28px; }
.nes-single-title {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1.2;
  margin-bottom: 14px;
}
.nes-single-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #bbb;
}

/* Contenuto */
.nes-single-content {
  font-size: 16px;
  color: #444;
  line-height: 1.85;
}
.nes-single-content h2 {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 40px 0 14px;
  line-height: 1.25;
}
.nes-single-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 32px 0 12px;
}
.nes-single-content p { margin-bottom: 20px; }
.nes-single-content ul,
.nes-single-content ol {
  margin: 0 0 20px 24px;
}
.nes-single-content li { margin-bottom: 8px; }
.nes-single-content a {
  color: #C8102E;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nes-single-content a:hover { color: #a30d25; }
.nes-single-content img {
  border-radius: 12px;
  max-width: 100%;
  height: auto;
  margin: 8px 0 20px;
}
.nes-single-content blockquote {
  border-left: 4px solid #C8102E;
  margin: 28px 0;
  padding: 16px 22px;
  background: #fdf2f2;
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  color: #555;
  font-style: italic;
}
.nes-single-content strong { color: #1a1a2e; }
.nes-single-content hr {
  border: none;
  border-top: 1.5px solid #f0f0f0;
  margin: 36px 0;
}

/* Tag */
.nes-single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0;
  padding-top: 24px;
  border-top: 1.5px solid #f0f0f0;
}
.nes-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #f7f7f7;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  border: 1.5px solid #f0f0f0;
  transition: background .2s, color .2s, border-color .2s;
}
.nes-tag:hover {
  background: #C8102E;
  color: #fff;
  border-color: #C8102E;
}

/* Nav prev/next */
.nes-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}
.nes-post-nav-item {
  background: #fafafa;
  border: 1.5px solid #ebebeb;
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color .2s, background .2s;
}
.nes-post-nav-item:hover { border-color: rgba(200,16,46,.2); background: #fff; }
.nes-post-nav-next { text-align: right; }
.nes-post-nav-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #C8102E;
  margin-bottom: 6px;
}
.nes-post-nav-item a {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  text-decoration: none;
  line-height: 1.35;
  display: block;
}
.nes-post-nav-item a:hover { color: #C8102E; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.nes-sidebar {
  position: sticky;
  top: 100px; /* aggiustato via JS come la cat-bar */
}

/* Widget generico */
.nes-sidebar .widget {
  background: #fff;
  border: 1.5px solid #ebebeb;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
}
.nes-sidebar .widget-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a1a2e;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nes-sidebar .widget-title::before {
  content: '';
  width: 16px;
  height: 2px;
  background: #C8102E;
  display: inline-block;
  flex-shrink: 0;
}

/* Widget: categorie e archivi (liste) */
.nes-sidebar .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nes-sidebar .widget ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: #fafafa;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  transition: background .2s, color .2s;
}
.nes-sidebar .widget ul li a:hover {
  background: #fff5f5;
  color: #C8102E;
}

/* Widget: ricerca */
.nes-sidebar .widget.widget_search .search-form {
  display: flex;
}
.nes-sidebar .widget.widget_search input[type="search"] {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a2e;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.nes-sidebar .widget.widget_search input[type="search"]:focus {
  outline: none;
  border-color: #C8102E;
}
.nes-sidebar .widget.widget_search button,
.nes-sidebar .widget.widget_search input[type="submit"] {
  padding: 11px 16px;
  background: #C8102E;
  color: #fff;
  border: none;
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}
.nes-sidebar .widget.widget_search button:hover,
.nes-sidebar .widget.widget_search input[type="submit"]:hover {
  background: #a30d25;
}

/* Widget: post recenti */
.nes-sidebar .widget_recent_entries ul li {
  background: none !important;
  padding: 0;
}
.nes-sidebar .widget_recent_entries ul li a {
  background: #fafafa;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  line-height: 1.4;
  justify-content: flex-start;
}
.nes-sidebar .widget_recent_entries ul li a:hover {
  background: #fff5f5;
  color: #C8102E;
}
.nes-sidebar .widget_recent_entries .post-date {
  display: block;
  font-size: 11px;
  color: #bbb;
  margin-top: 3px;
}

/* Widget: tag cloud */
.nes-sidebar .widget_tag_cloud .tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.nes-sidebar .widget_tag_cloud .tagcloud a {
  display: inline-block;
  padding: 5px 13px;
  background: #f7f7f7;
  color: #666;
  font-size: 12px !important;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  border: 1.5px solid #f0f0f0;
  transition: background .2s, color .2s, border-color .2s;
}
.nes-sidebar .widget_tag_cloud .tagcloud a:hover {
  background: #C8102E;
  color: #fff;
  border-color: #C8102E;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nes-single-layout {
    grid-template-columns: 1fr 280px;
    gap: 36px;
  }
}
@media (max-width: 768px) {
  .nes-single-layout {
    grid-template-columns: 1fr;
  }
  .nes-sidebar { position: static; }
  .nes-post-nav { grid-template-columns: 1fr; }
}

/* ============================================================
   TABLE OF CONTENTS – CSS
   Aggiungere in coda a: assets/css/blog-single.css
   ============================================================ */

.nes-toc {
  background: #fdf2f2;
  border: 1.5px solid rgba(200, 16, 46, .15);
  border-left: 4px solid #C8102E;
  border-radius: 0 14px 14px 0;
  padding: 22px 26px;
  margin: 32px 0;
}

.nes-toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #C8102E;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nes-toc-title::before {
  content: '';
  width: 16px;
  height: 2px;
  background: #C8102E;
  display: inline-block;
  flex-shrink: 0;
}

.nes-toc-list {
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nes-toc-list li {
  font-size: 14px;
  line-height: 1.4;
}

.nes-toc-list a {
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}
.nes-toc-list a:hover {
  color: #C8102E;
}

/* Smooth scroll per tutta la pagina */
html {
  scroll-behavior: smooth;
}

/* Offset per la sticky nav + cat-bar quando si clicca sull'ancora */
h2[id] {
  scroll-margin-top: 120px;
}