/* ====== BASE / RESET MINIMO ====== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
  color: #213447;
  background: #f5f5f5;
  line-height: 1.45;
}
img { max-width: 100%; height: auto; display: block; }

/* Contenitore centrale uniforme */
.container { max-width: 1100px; width: 92%; margin: 0 auto; }

/* ====== HEADER ====== */
.site-header { background: #1f3f63; color: #fff; padding: .75rem 0; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-left: 8px; padding-right: 8px;
}
.branding { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.branding .logo {
  height: 56px; width: 56px;
  border-radius: 12px;           /* richiamo ai pulsanti */
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.branding .title {
  color: #fff; font-weight: 700; font-size: 1.08rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ====== MENU COMPATTO (a destra) ====== */
nav, nav.compact {
  display: flex; align-items: center; gap: .45rem;
  flex-wrap: nowrap;                /* evita di andare sotto il logo */
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* IE vecchi */
}
nav::-webkit-scrollbar { display: none; }

nav a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff; text-decoration: none;
  transition: background .2s ease, transform .1s ease;
}
nav a:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
nav a:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* ====== SEZIONE AVVISI (index) ====== */
.notice-wrap { background: #0b2542; color: #e6eef7; }
.notice-inner { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; }
.notice-toggle {
  background: transparent; border: 1px solid #7aa1c7; color: #e6eef7;
  padding: .35rem .6rem; border-radius: 999px; cursor: pointer;
}
.notice-toggle:hover { background: #123456; }
.notice-text { display: none; }
.notice-text.active { display: block; }

/* ====== HERO (index) ====== */
.hero {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  padding: 2rem 0 2.4rem;
  border-bottom: 1px solid #eef3f7;
}
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.hero h1 { margin: .2rem 0 .6rem; color: #1f3f63; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.15; }
.hero p.lead { margin: 0 0 1rem; color: #3a4a5b; font-size: 1rem; }
.cta-row { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ====== BOTTONE ====== */
.btn, .button {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem .9rem; border: none; border-radius: 10px;
  font-weight: 700; cursor: pointer; text-decoration: none;
  background: #1f3f63; color: #fff;
}
.btn.secondary { background: #e9eef5; color: #213447; }
.btn:hover, .button:hover { filter: brightness(.95); }

/* ====== SEZIONI E CARD ====== */
main {
  max-width: 960px; width: 95%; margin: 0 auto;
  background: #fff; padding: 2rem 1rem; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
section { padding: 2rem 0; }
.section-title { color: #1f3f63; margin: 0 0 1rem; font-size: 1.25rem; }

.card, .service-card, .portal-card, .hero-card {
  background: #fff; border: 1px solid #e8eef6; border-radius: 14px; padding: 1rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

/* ====== GRID SERVIZI ====== */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .services-grid { grid-template-columns: 1fr; } }
.service-card h3 {
  margin: .4rem 0 .3rem; font-size: 1.1rem; color: #1b2f45;
  display: flex; align-items: center; gap: .5rem;
}
.service-card p { margin: 0; color: #3b4d60; line-height: 1.58; }

/* ====== PORTALI ====== */
.portals-list { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.portal-card { display: flex; gap: .9rem; }
.portal-card i { color: #1f3f63; flex: 0 0 auto; }
.portal-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .7rem; background: #e9eef5; border-radius: 10px;
  color: #1b2f45; text-decoration: none; font-weight: 600;
}
.btn-link:hover { filter: brightness(.96); }

/* ====== TOC (disattivato ovunque) ====== */
.toc-side, .toc-title { display: none !important; }

/* ====== FOOTER ====== */
footer { background: #ddd; text-align: center; padding: 1rem; color: #213447; }

/* ====== RESPONSIVE HEADER ====== */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: stretch; }
  nav, nav.compact { width: 100%; }
}

/* ====== RESPONSIVE HERO ====== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}
