/* Campi lunghi: la griglia non deve limitarli a meta' riga. */
form label:has(input[type="email"]) { grid-column: 1 / -1; min-width: 0; }
.contact-fields label:has(input[name="nome"]) { grid-column: 1 / -1; }
.contact-fields > label { min-width: 0; }
form input[type="email"] { min-width: 0; width: 100%; box-sizing: border-box; font-size: max(1rem, 16px); }
form label .dico-email-preview {
  display: block; min-width: 0; max-width: 100%; margin: 0.25rem 0 0;
  padding: 0.65rem 0.8rem; border-left: 3px solid #213a59;
  border-radius: 0 8px 8px 0; background: #edf2f7; color: #213a59;
  font: 400 16px/1.5 system-ui, sans-serif; text-transform: none;
  letter-spacing: normal; overflow-wrap: anywhere; word-break: normal;
}
form label .dico-email-preview[hidden] { display: none; }
.dico-social {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1.25rem; grid-column: 1 / -1;
  width: 100%; padding: clamp(1.25rem, 3vw, 2rem) max(var(--page-pad, 1.35rem), calc((100% - 1180px) / 2));
  background: #14263b; color: #fff; text-align: left;
  border-top: 1px solid #44556a; border-bottom: 1px solid #44556a;
  font: 400 1rem/1.5 system-ui, sans-serif;
}

/* Stessa griglia e gerarchia per il piede delle diverse famiglie di pagine. */
.site-footer .footer-bottom { padding: 1.25rem; gap: 1rem; }
.site-footer .footer-bottom .footer-company {
  grid-column: 1 / -1; border-top: 1px solid rgba(160, 177, 195, 0.4);
  padding-top: 1rem; font-size: 0.875rem; line-height: 1.65; text-align: left;
  overflow-wrap: anywhere;
}
.site-footer-comune .footer-bottom .footer-company { color: #344e68; }
.blog-body a { text-underline-offset: 0.2em; }
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid #de9f13; outline-offset: 4px;
}
.mobile-menu { overflow-y: auto; overscroll-behavior: contain; }
.reference-nav .nav-toggle[hidden] { display: none; }
.reference-nav button.nav-burger { cursor: pointer; padding: 0; color: inherit; }
.reference-nav .reference-logo { text-decoration: none; }
@media (max-width: 820px) {
  .site-footer .footer-bottom { text-align: left; justify-items: start; }
  .site-footer .footer-links { justify-content: flex-start; margin-left: -0.8rem; }
  .site-footer .footer-credit { justify-self: start; white-space: normal; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .reference-nav { max-height: calc(100svh - 1.7rem); overflow-y: auto; overscroll-behavior: contain; }
  .reference-nav:has(.nav-toggle:checked) { background: #fff; }
  .reference-nav-comune .reference-logo { min-width: 0; }
  .reference-nav-comune .reference-logo-name { display: block; min-width: 0; max-width: 25ch; font-size: 0.78rem; line-height: 1.3; }
  .reference-nav-comune .reference-logo img { flex-shrink: 0; }
  .reference-nav-comune:has(img[src*="edr"]) .reference-logo-name { display: none; }
}
.faq details[open] { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.48); }
@media (prefers-reduced-motion: reduce) {
  .mobile-menu, .mobile-menu-panel, .nav-burger span,
  .nav-burger span::before, .nav-burger span::after { transition: none; }
}
.dico-social-heading { display: grid; gap: 0.2rem; }
.dico-social-heading strong { font-size: 1.15rem; }
.dico-social-heading span { color: #cbd5e1; }
.dico-social-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.dico-social .dico-social-links a {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.65rem;
  min-height: 44px; box-sizing: border-box; padding: 0.6rem 1rem;
  border: 1px solid #cbd5e1; border-radius: 999px;
  background: #fff; color: #14263b; text-decoration: none; font-weight: 650;
}
.dico-social .dico-social-links a:hover { background: #f4c54f; border-color: #f4c54f; }
.dico-social .dico-social-links a:focus-visible { outline: 3px solid #f4c54f; outline-offset: 4px; }
.dico-social svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 480px) {
  .dico-social-links { width: 100%; }
  .dico-social-links a { flex: 1; }
}

/* One architectural footer: CTA, navigation, social and legal information.
   Municipal pages retain a light institutional surface and their own policy. */
.site-footer.dico-footer {
  --footer-surface: #122539;
  --footer-ink: #f5f7fa;
  --footer-muted: #becbd8;
  --footer-line: #3c5063;
  position: relative; isolation: isolate; width: 100%; max-width: none;
  margin: 0; padding: 0 max(24px, calc((100% - 1180px) / 2));
  background: var(--footer-surface); color: var(--footer-ink);
  border: 0; border-radius: 0; text-align: left;
}
.site-footer.dico-footer::before, .site-footer.dico-footer::after { display: none; }
.dico-footer > .footer-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 48px;
  margin: 0; padding: 64px 0 48px; width: 100%; max-width: none;
  background: none; border: 0; border-bottom: 1px solid var(--footer-line);
  border-radius: 0; box-shadow: none; backdrop-filter: none;
}
.dico-footer .footer-panel::before, .dico-footer .footer-panel::after { display: none; }
.dico-footer .footer-panel h2 { max-width: 25ch; margin: 12px 0 20px; font-size: clamp(1.65rem, 2.7vw, 2.5rem); line-height: 1.2; letter-spacing: -0.035em; color: var(--footer-ink); }
.dico-footer .footer-panel p { max-width: 61ch; color: var(--footer-muted); font-size: 1rem; line-height: 1.65; }
.dico-footer .footer-panel .eyebrow, .dico-footer .footer-panel .footer-eyebrow { color: #f4c54f; font-size: .75rem; letter-spacing: .12em; }
.dico-footer .footer-actions { align-self: center; gap: 10px; }
.dico-footer .footer-actions .footer-cta { background: #f4c54f; color: #122539; border-color: #f4c54f; min-height: 52px; box-shadow: none; }
.dico-footer .footer-actions > a:not(.footer-cta) { border: 0; background: none; color: var(--footer-muted); justify-content: flex-start; padding-left: 0; }
.dico-footer .footer-trust, .dico-footer .footer-trust-badges { margin: 24px 0 0; gap: 8px 16px; }
.dico-footer .footer-trust li, .dico-footer .footer-trust-badges li { background: none; border: 0; padding: 0; color: var(--footer-muted); font-size: .68rem; }
.site-footer.dico-footer .footer-bottom {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start; justify-items: stretch; gap: 36px 56px;
  width: 100%; max-width: none; margin: 0; padding: 48px 0 32px;
  border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left;
}
.dico-footer .footer-bottom > * { min-width: 0; }
.dico-footer .footer-brand { display: inline-flex; width: fit-content; min-height: 44px; }
.dico-footer .footer-brand img { width: 176px; height: auto; max-width: 100%; }
.dico-footer .footer-bottom .footer-tagline { max-width: 26ch; margin: 18px 0 0; font-size: 1.1rem; font-weight: 500; line-height: 1.55; color: var(--footer-muted); }
.dico-footer .footer-bottom .footer-kicker { margin: 0 0 14px; font: 600 .72rem/1.5 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .13em; color: var(--footer-muted); }
.site-footer.dico-footer .footer-links, .dico-footer .footer-explore { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; margin: 0; gap: 0; }
.dico-footer .footer-explore a, .site-footer.dico-footer .footer-links a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  max-width: 100%; margin: 0; padding: 8px 0; border: 0; border-radius: 0;
  background: none; color: var(--footer-ink); font: 500 .9rem/1.5 system-ui, sans-serif;
  text-decoration: none; text-align: left; overflow-wrap: anywhere;
}
.dico-footer .footer-explore a:hover, .site-footer.dico-footer .footer-links a:hover { text-decoration: underline; text-underline-offset: 5px; }
.dico-footer .dico-social { padding: 24px 0; margin: 0; background: none; border-color: var(--footer-line); color: var(--footer-ink); }
.dico-footer .dico-social-heading strong { font-size: 1rem; }
.dico-footer .dico-social-heading span { color: var(--footer-muted); font-size: .9rem; }
.dico-footer .dico-social .dico-social-links a { background: none; color: var(--footer-ink); border-color: var(--footer-line); border-radius: 10px; font-size: .9rem; }
.dico-footer .dico-social .dico-social-links a:hover { background: #f4c54f; color: #122539; border-color: #f4c54f; }
.dico-footer .dico-social svg rect + path { fill: var(--footer-surface); }
.dico-footer .dico-social a:hover svg rect + path { fill: #f4c54f; }
.site-footer.dico-footer .footer-bottom .footer-company {
  grid-column: 1 / 3; margin: 0; padding: 0; border: 0;
  color: var(--footer-muted); font: 400 .8rem/1.8 system-ui, sans-serif; max-width: 80ch;
}
.site-footer.dico-footer .footer-bottom .footer-company a { color: inherit; }
.site-footer.dico-footer .footer-bottom .footer-credit { grid-column: 3; justify-self: start; margin: 0; padding: 0; color: var(--footer-muted); font: 400 .75rem/1.5 system-ui, sans-serif; white-space: normal; flex-wrap: wrap; }
.site-footer.dico-footer .footer-credit a { width: 76px; min-height: 44px; }
.site-footer.dico-footer.site-footer-comune { --footer-surface: #edf2f5; --footer-ink: #17324d; --footer-muted: #4c6072; --footer-line: #c8d3dc; border-top: 1px solid var(--footer-line); }
.dico-footer .footer-bottom .footer-entity-name { margin: 0 0 20px; color: var(--footer-ink); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.3; max-width: 25ch; letter-spacing: -.025em; }
.dico-footer .footer-powered { display: flex; align-items: center; justify-content: flex-start; gap: 10px; color: var(--footer-muted); font: 400 .75rem/1.5 system-ui, sans-serif; text-decoration: none; }
.dico-footer .footer-powered img { width: 105px; height: auto; }
.site-footer.dico-footer .reference-copyright { grid-column: 1 / -1; justify-self: start; width: 100%; margin: -12px 0 0; color: var(--footer-muted); text-align: left; font: 400 .8rem/1.6 system-ui, sans-serif; }
.site-footer.dico-footer .reference-copyright a { color: inherit; }
/* Keep the provider's links and attribution, but avoid a detached purple bar.
   Iubenda loads its own stylesheet asynchronously, hence scoped important. */
body:has(.dico-footer) #iub-legal-footer { background: #122539 !important; color: #becbd8 !important; border-top: 1px solid #3c5063; padding: 16px 24px !important; }
body:has(.site-footer-comune.dico-footer) #iub-legal-footer { background: #edf2f5 !important; color: #4c6072 !important; border-color: #c8d3dc; }
body:has(.dico-footer) #iub-legal-footer a { color: inherit !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-inner { display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px !important; margin: 0 auto !important; padding: 0 !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-container { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 20px; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-product { margin: 0 !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-product a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-separator { display: none !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-brand { margin: 0 !important; color: inherit !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-by { color: inherit !important; }
body:has(.dico-footer) #iub-legal-footer .iub-legal-footer-logo svg g { fill: currentColor; }
@media (max-width: 820px) {
  .dico-footer > .footer-panel { grid-template-columns: 1fr; gap: 24px; padding: 40px 0 32px; }
  .dico-footer .footer-actions { width: 100%; max-width: 360px; }
  .site-footer.dico-footer .footer-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; padding: 36px 0 28px; }
  .dico-footer .footer-identity { grid-column: 1 / -1; }
  .site-footer.dico-footer .footer-bottom .footer-company, .site-footer.dico-footer .footer-bottom .footer-credit { grid-column: 1 / -1; }
  .dico-footer .footer-bottom .footer-tagline { max-width: 32ch; }
  .dico-footer .dico-social { gap: 16px; }
  .dico-footer .dico-social-links { width: 100%; }
  .dico-footer .dico-social-links a { flex: 1; }
}
@media (max-width: 359px) {
  .site-footer.dico-footer { padding-inline: 20px; }
  .site-footer.dico-footer .footer-bottom { gap: 24px 16px; }
  .dico-footer .dico-social .dico-social-links a { gap: 6px; padding-inline: 10px; }
}

/* Shared municipal actions: recognisable channel, generous target, clear label.
   Keep the institution's channel groups, copy and destinations unchanged. */
body:has(.reference-nav-comune) .reference-content > h2 {
  max-width: 24ch; font-size: clamp(1.7rem, 3.3vw, 3rem);
  line-height: 1.15; letter-spacing: -.03em;
}
body:has(.reference-nav-comune) .reference-channel-icons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 32rem;
  margin: 20px 0;
}
body:has(.reference-nav-comune) .channel-icon {
  display: flex; flex-direction: row; justify-content: flex-start;
  width: auto; min-width: 0; min-height: 80px; gap: 12px;
  padding: 16px; border: 1px solid #cbd6df; border-radius: 16px;
  background: #fff; color: #17324d; text-align: left;
  font-size: .95rem; line-height: 1.3; text-decoration: none;
  box-shadow: 0 4px 12px rgba(23, 50, 77, .04);
}
body:has(.reference-nav-comune) .channel-icon img {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  object-fit: contain;
}
body:has(.reference-nav-comune) .channel-icon:hover {
  background: #f0f5f8; border-color: #59738c; transform: none;
}
body:has(.reference-nav-comune) .channel-icon:focus-visible {
  outline: 3px solid #215c9b; outline-offset: 4px;
}
body:has(.reference-nav-comune) .reference-channel-label { color: #365671; }
body:has(.reference-nav-comune) .reference-channel-headline { line-height: 1.55; }

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  body:has(.reference-nav-comune) .reference-hero {
    grid-template-columns: minmax(0, 1fr); gap: 28px;
    min-height: 0; padding-top: 7rem; padding-bottom: 2.5rem;
  }
  body:has(.reference-nav-comune) .reference-hero h1 {
    font-size: clamp(2.3rem, 9vw, 3.8rem); line-height: 1.08; max-width: 16ch;
  }
  body:has(.reference-nav-comune) .reference-hero::after {
    background: linear-gradient(90deg, rgba(10, 22, 36, .9), rgba(10, 22, 36, .55)),
      linear-gradient(0deg, #0a1624, transparent 80%);
  }
  body:has(.reference-nav-comune) .reference-kicker {
    font-size: .73rem; line-height: 1.5; letter-spacing: .08em; margin-bottom: 1rem;
  }
  body:has(.reference-nav-comune) .reference-lead {
    font-size: 1rem; line-height: 1.65; max-width: 42ch; margin-top: 1.25rem;
    color: #e0e7ee;
  }
  body:has(.reference-nav-comune) .reference-actions { margin-top: 1.5rem; gap: 10px; }
  body:has(.reference-nav-comune) .reference-identity {
    width: 100%; max-width: 32rem; min-height: 0; margin-top: 0; justify-self: start;
  }
  body:has(.reference-nav-comune) .lanyard-wrapper {
    min-height: 0; padding: 0; perspective: none; pointer-events: none;
  }
  body:has(.reference-nav-comune) .lanyard-rig { width: 100%; }
  body:has(.reference-nav-comune) .lanyard-rope,
  body:has(.reference-nav-comune) .lanyard-card-hole { display: none; }
  body:has(.reference-nav-comune) .reference-lanyard-card {
    grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto;
    align-items: center; justify-items: start; column-gap: 16px; row-gap: 4px;
    width: 100%; min-height: 104px; margin: 0; padding: 18px;
    border-radius: 16px; box-shadow: none; text-align: left;
    transform-style: flat; will-change: auto;
  }
  body:has(.reference-nav-comune) .reference-lanyard-card img {
    grid-column: 1; grid-row: 1 / -1; width: 64px; height: 68px; margin: 0;
  }
  body:has(.reference-nav-comune) .reference-lanyard-card span {
    grid-column: 2; font-size: 1.1rem; line-height: 1.3; text-align: left; align-self: end;
  }
  body:has(.reference-nav-comune) .reference-lanyard-card strong {
    grid-column: 2; margin: 0; font-size: .8rem; line-height: 1.5; align-self: start;
  }
}
@media (max-width: 420px) {
  body:has(.reference-nav-comune) .channel-icon {
    flex-direction: column; align-items: flex-start; gap: 10px;
    min-height: 108px; padding: 16px; font-size: .9rem;
  }
}

/* Hero exits: separate photo contrast from the fade below the content.
   Only the small decorative strip is painted; no blur or scroll-driven JS. */
.hero, .page-hero, .reference-hero, .reference-index-hero {
  --hero-exit-size: clamp(6rem, 10vw, 10rem);
  --hero-exit-color: var(--canvas, #f5f2ec);
  --hero-exit-ramp: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.04) 16%, rgba(0,0,0,.16) 34%, rgba(0,0,0,.42) 55%, rgba(0,0,0,.76) 76%, #000 98%, #000);
}
.page-hero {
  padding-bottom: calc(var(--hero-exit-size) + 2rem);
  background: var(--blue-deep);
}
.page-hero::after {
  background: linear-gradient(90deg, rgba(11,19,32,.94), rgba(11,19,32,.66) 48%, rgba(11,19,32,.22)),
    linear-gradient(0deg, rgba(11,19,32,.8), rgba(11,19,32,.1) 60%);
}
.page-hero-evento::after {
  background: linear-gradient(90deg, rgba(8,17,29,.98), rgba(8,17,29,.9) 44%, rgba(8,17,29,.62) 72%, rgba(8,17,29,.38)),
    linear-gradient(0deg, rgba(8,17,29,.82), rgba(8,17,29,.16) 70%);
}
.page-hero::before, .hero::after {
  content: ""; position: absolute; inset: auto 0 -1px;
  height: var(--hero-exit-size); z-index: 4; pointer-events: none;
  background: var(--hero-exit-color);
  -webkit-mask-image: var(--hero-exit-ramp); mask-image: var(--hero-exit-ramp);
}
.hero-statement { padding-bottom: calc(var(--hero-exit-size) + 2rem); }

/* Resources continues into a dark panel, not the paper canvas. Give the
   panel's first pixels the same solid tone, then let its ambient colour show. */
.page-hero:has(+ .plus-resources) { --hero-exit-color: #10243b; }
.page-hero + .plus-resources {
  background-image: linear-gradient(to bottom, #10243b, rgba(16,36,59,0) 15rem),
    radial-gradient(circle at 12% 18%, rgba(251,188,5,.22), transparent 22rem),
    radial-gradient(circle at 92% 20%, rgba(159,192,218,.24), transparent 24rem),
    linear-gradient(135deg, #10243b, var(--blue) 48%, #182f4a);
}

/* Municipal pages have a nonuniform ambient canvas. Reveal that exact
   backdrop instead of ending a flat paper-coloured overlay against it. The
   mask lives exclusively in reserved bottom padding, never over the badge. */
body .reference-hero, body .reference-index-hero,
body:has(.reference-nav-comune) .reference-hero {
  padding-bottom: calc(var(--hero-exit-size) + 2rem);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--hero-exit-size)), rgba(0,0,0,.96) calc(100% - var(--hero-exit-size) * .84), rgba(0,0,0,.84) calc(100% - var(--hero-exit-size) * .66), rgba(0,0,0,.58) calc(100% - var(--hero-exit-size) * .45), rgba(0,0,0,.24) calc(100% - var(--hero-exit-size) * .24), transparent calc(100% - 2px));
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--hero-exit-size)), rgba(0,0,0,.96) calc(100% - var(--hero-exit-size) * .84), rgba(0,0,0,.84) calc(100% - var(--hero-exit-size) * .66), rgba(0,0,0,.58) calc(100% - var(--hero-exit-size) * .45), rgba(0,0,0,.24) calc(100% - var(--hero-exit-size) * .24), transparent calc(100% - 2px));
}
@media (max-width: 640px), (hover: none) and (pointer: coarse), (prefers-reduced-motion: reduce) {
  .hero-intro { padding-bottom: 6rem; }
  .hero-intro::after {
    content: ""; position: absolute; inset: auto 0 -1px; height: 4.5rem;
    pointer-events: none; background: #14283e;
    -webkit-mask-image: var(--hero-exit-ramp); mask-image: var(--hero-exit-ramp);
  }
  .hero-statement { border-top: 0; background: #14283e; }
}
