/* ==========================================================================
   Fundo.one — Editoriale: Radar bandi, Guida, News, archivi e articolo
   Poche informazioni, titoli compatti, lettura comoda.
   ========================================================================== */

/* ---------- Hero degli archivi: compatto, con ricerca e sezioni ---------- */
main.fundo > section.nx-hero.nx-hero-editorial { padding: 88px 0 72px; }
main.fundo > section.nx-hero-editorial h1 { font-size: clamp(36px, 4.6vw, 58px); }
.nx-ed-search {
  display: flex; align-items: center; gap: 12px; width: min(620px, 100%); height: 58px; margin: 36px auto 0; padding: 0 20px;
  border-radius: 999px; background: #fff; color: #2362EC; box-shadow: 0 0 0 6px rgba(35, 98, 236, .14), 0 24px 60px -20px rgba(35, 98, 236, .55);
}
.nx-ed-search svg { flex: 0 0 auto; width: 20px; height: 20px; }
.nx-ed-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: #0E1430; font: inherit; font-size: 16px; }
.nx-ed-search input::placeholder { color: #6B7280; }
.nx-ed-search:focus-within { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #2362EC; }
.nx-ed-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.nx-ed-tabs a {
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(217, 227, 253, .3); color: rgba(255, 255, 255, .85);
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background .2s, border-color .2s, color .2s;
}
.nx-ed-tabs a:hover { border-color: rgba(217, 227, 253, .7); color: #fff; }
.nx-ed-tabs a[aria-current="page"] { background: #fff; border-color: #fff; color: #0E1430; font-weight: 600; }

/* ---------- Griglia e card articolo ---------- */
main.fundo > section.nx-ed-list { padding-top: 72px; }
.nx-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 980px) { .nx-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .nx-post-grid { grid-template-columns: 1fr; gap: 16px; } }
.nx-post[hidden] { display: none; }
.nx-post > a {
  display: flex; flex-direction: column; height: 100%; padding: 24px; border: 1px solid #DCE5F7; border-radius: 16px; background: #fff;
  color: inherit; text-decoration: none; transition: border-color .25s, box-shadow .25s, transform .25s cubic-bezier(.22, 1, .36, 1);
}
.nx-post > a:hover { border-color: #2362EC; transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(35, 98, 236, .08), 0 16px 40px rgba(14, 20, 48, .08); }
.nx-post > a:focus-visible { outline: 3px solid #2362EC; outline-offset: 3px; }
.nx-post-image { margin: -24px -24px 20px; overflow: hidden; border-radius: 15px 15px 0 0; aspect-ratio: 16 / 9; background: #F5F8FF; }
.nx-post-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nx-post-meta { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 12px; color: #4B5563; font-size: 13px; }
.nx-post-meta span { color: #2362EC; font-weight: 600; }
main.fundo .nx-post h2, main.fundo > section .nx-post h2 {
  margin: 0 0 10px; color: #0E1430; font-size: 18px; line-height: 1.35; letter-spacing: -.01em; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nx-post-excerpt { margin: 0; color: #4B5563; font-size: 15px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nx-post-link { margin-top: auto; padding-top: 18px; color: #2362EC; font-size: 14.5px; font-weight: 600; }

/* ---------- Paginazione ---------- */
.nx-pagination { margin-top: 48px; }
.nx-pagination ul, .nx-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nx-pagination a, .nx-pagination span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #DCE5F7; background: #fff; color: #0E1430; font-size: 15px; font-weight: 600; text-decoration: none;
}
.nx-pagination a:hover { border-color: #2362EC; color: #2362EC; }
.nx-pagination .current { background: #2362EC; border-color: #2362EC; color: #fff; }
.nx-pagination .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Articolo ---------- */
.nx-article-head { padding: 64px 0 40px; background: linear-gradient(180deg, #F5F8FF 0%, #fff 100%); border-bottom: 1px solid #EEF2FC; }
.nx-article-head .f-container { max-width: 860px; }
.nx-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; color: #4B5563; font-size: 14px; }
.nx-breadcrumb a { color: #2362EC; font-weight: 600; text-decoration: none; }
.nx-breadcrumb a:hover { text-decoration: underline; }
main.fundo .nx-article-head h1 { margin: 0; color: #0E1430; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -.025em; }
.nx-article-lead { margin: 18px 0 0; color: #4B5563; font-size: 19px; line-height: 1.6; }
.nx-article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; color: #4B5563; font-size: 14px; }
.nx-article-image { max-width: 1120px; margin-top: 40px; }
.nx-article-image img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; border-radius: 20px; }

.nx-article-layout { display: grid; grid-template-columns: minmax(0, 720px) 300px; justify-content: space-between; gap: 64px; padding-top: 56px; padding-bottom: 96px; }
@media (max-width: 1080px) { .nx-article-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 760px; } }

/* testo dell'articolo */
.nx-article-body { color: #1F2937; font-size: 18px; line-height: 1.75; }
.nx-article-body > *:first-child { margin-top: 0; }
.nx-article-body p, .nx-article-body ul, .nx-article-body ol { margin: 0 0 1.2em; }
main.fundo .nx-article-body h2 { margin: 2.2em 0 .7em; color: #0E1430; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.25; letter-spacing: -.02em; scroll-margin-top: 96px; }
main.fundo .nx-article-body h3 { margin: 1.8em 0 .6em; color: #0E1430; font-size: 21px; line-height: 1.3; }
.nx-article-body h4 { margin: 1.5em 0 .5em; color: #0E1430; font-size: 18px; }
.nx-article-body a { color: #2362EC; text-decoration: underline; text-underline-offset: 3px; }
.nx-article-body ul, .nx-article-body ol { padding-left: 1.3em; }
.nx-article-body li { margin-bottom: .45em; }
.nx-article-body li::marker { color: #2362EC; }
.nx-article-body strong { color: #0E1430; }
.nx-article-body blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid #2362EC; color: #0E1430; }
.nx-article-body img { max-width: 100%; height: auto; border-radius: 14px; }
.nx-article-body table { width: 100%; margin: 1.6em 0; border-collapse: collapse; font-size: 15.5px; display: block; overflow-x: auto; }
.nx-article-body th, .nx-article-body td { padding: 10px 12px; border-bottom: 1px solid #E6ECFA; text-align: left; vertical-align: top; }
.nx-article-body th { color: #0E1430; background: #F5F8FF; }
.nx-article-source { margin-top: 2em; padding-top: 1.2em; border-top: 1px solid #E6ECFA; font-weight: 600; }

/* colonna laterale */
.nx-article-aside { display: grid; gap: 24px; align-content: start; position: sticky; top: 96px; }
@media (max-width: 1080px) {
  .nx-article-aside { display: contents; }
  .nx-toc { order: -1; }
  .nx-article-cta { order: 2; }
}
.nx-toc { display: none; padding: 20px; border: 1px solid #E6ECFA; border-radius: 14px; background: #fff; }
.nx-toc.is-ready { display: block; }
.nx-toc summary { margin: 0; color: #0E1430; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.nx-toc summary::-webkit-details-marker { display: none; }
.nx-toc summary::after { content: "+"; color: #2362EC; font-size: 18px; line-height: 1; }
.nx-toc details[open] summary { margin-bottom: 12px; }
.nx-toc details[open] summary::after { content: "−"; }
.nx-toc ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: toc; max-height: 52vh; overflow-y: auto; }
.nx-toc li a { display: block; padding: 7px 10px; border-radius: 8px; color: #4B5563; font-size: 14px; line-height: 1.4; text-decoration: none; }
.nx-toc li a:hover { background: #F5F8FF; color: #0E1430; }
.nx-toc li a[aria-current="true"] { background: #EEF3FF; color: #2362EC; font-weight: 600; }
.nx-article-cta { padding: 24px; border-radius: 16px; color: #fff;
  background: radial-gradient(300px 200px at 0% 0%, rgba(35, 98, 236, .55), transparent 70%), #0A1433; }
.nx-article-cta-title { margin: 0 0 8px; font-family: "Montserrat", system-ui, sans-serif; font-size: 19px; font-weight: 700; line-height: 1.3; }
.nx-article-cta p:not(.nx-article-cta-title) { margin: 0 0 18px; color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.55; }
.nx-article-cta .f-btn { width: 100%; justify-content: center; }

/* correlati */
.nx-related-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
main.fundo > section .nx-related-head h2 { margin: 0; color: #0E1430; font-size: clamp(26px, 2.8vw, 34px); letter-spacing: -.02em; }
.nx-related-head a { color: #2362EC; font-size: 15px; font-weight: 600; text-decoration: none; }

main.fundo .nx-article-body h2::before, main.fundo .nx-article-body h2::after { display: none; }

/* La paginazione ora è del tema: nasconde quella aggiunta in passato da uno snippet (Code Snippets) */
.radar-bandi-pagination { display: none !important; }

/* stato della ricerca */
.nx-ed-status { min-height: 1.4em; margin: 14px 0 0; color: rgba(217, 227, 253, .9); font-size: 14px; }
.nx-pagination[hidden] { display: none; }
