/* SICI - nuovo layout (2026)
   Font: Titillium Web (SIL Open Font License, file in /assets/fonts) */

@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/titillium-web-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/titillium-web-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/titillium-web-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/titillium-web-latin-700-normal.woff2") format("woff2"); }

:root {
  --blu: #0b4a9e;
  --blu-scuro: #0a2f66;
  --notte: #071d3f;
  --azzurro: #e8f0fb;
  --accento: #d9822b;
  --testo: #1c2b3a;
  --testo-soft: #4a5a6b;
  --bordo: #d6dee8;
  --fondo: #f3f6fa;
  --bianco: #ffffff;
  --raggio: 10px;
  --ombra: 0 1px 2px rgba(10, 30, 60, .06), 0 6px 24px rgba(10, 30, 60, .07);
  --larghezza: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.s-body {
  margin: 0;
  background: var(--fondo) !important;
  color: var(--testo);
  font-family: "Titillium Web", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.s-wrap { max-width: var(--larghezza); margin: 0 auto; padding: 0 24px; }

.s-salta { position: absolute; left: -9999px; top: 0; background: var(--accento); color: #fff;
  padding: 8px 14px; z-index: 1000; border-radius: 0 0 6px 0; }
.s-salta:focus { left: 0; }

/* ---------- Testata ---------- */
.s-testata { background: var(--bianco); position: relative; z-index: 50; box-shadow: 0 2px 10px rgba(7, 29, 63, .08); }
.s-barra-ente { background: var(--notte); color: #fff; font-size: 15px; letter-spacing: .03em; }
.s-barra-ente .s-wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; }
.s-barra-ente-dx { font-weight: 600; color: #fff; }

.s-marchio .s-wrap { display: flex; align-items: center; justify-content: center; padding-top: 16px; padding-bottom: 16px; }
.s-logo { display: block; line-height: 0; }
.s-logo img { height: 64px; width: auto; max-width: 100%; }

.s-hamburger { display: none; align-items: center; gap: 10px; background: var(--blu); color: #fff; border: 0;
  border-radius: 8px; padding: 10px 14px; font: 600 15px/1 "Titillium Web", sans-serif; cursor: pointer; }
.s-hamburger-icona, .s-hamburger-icona::before, .s-hamburger-icona::after {
  display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; position: relative; content: ""; }
.s-hamburger-icona::before { position: absolute; top: -6px; }
.s-hamburger-icona::after { position: absolute; top: 6px; }

/* ---------- Menu ---------- */
.s-nav { background: linear-gradient(180deg, var(--blu) 0%, var(--blu-scuro) 100%); }
.s-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.s-voce { position: static; }
.s-voce-link { display: flex; align-items: center; gap: 8px; color: #fff !important; text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: 15px 18px; font: 600 16px/1.2 "Titillium Web", sans-serif;
  border-bottom: 3px solid transparent; }
.s-voce-link:hover, .s-voce-link:focus-visible, .s-voce.s-aperta > .s-voce-link, .s-voce-link[aria-current="page"] {
  background: rgba(255, 255, 255, .1); border-bottom-color: var(--accento); outline: none; }
.s-freccia { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.s-voce.s-aperta .s-freccia { transform: rotate(-135deg) translateY(-2px); }

.s-pannello { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bianco);
  border-top: 3px solid var(--accento); box-shadow: 0 18px 40px rgba(7, 29, 63, .18);
  max-height: calc(100vh - 170px); overflow-y: auto; }
.s-voce.s-aperta .s-pannello { display: block; animation: s-appari .15s ease-out; }
@keyframes s-appari { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.s-pannello .s-wrap { padding-top: 22px; padding-bottom: 26px; }
.s-pannello-intro { display: inline-block; margin-bottom: 16px; font-weight: 700; color: var(--blu); text-decoration: none; font-size: 18px; }
.s-pannello-intro:hover { color: var(--accento); }
.s-colonne { columns: 5 200px; column-gap: 28px; column-rule: 1px solid var(--azzurro); }
.s-col { margin: 0 0 18px; }
.s-col > .s-links, .s-gruppo { break-inside: avoid; }
.s-col-titolo { break-after: avoid; margin: 0 0 4px; padding: 4px 8px; background: var(--azzurro); border-radius: 4px; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.s-col-titolo a, .s-col-titolo span { color: var(--blu-scuro); text-decoration: none; }
.s-col-titolo a:hover { color: var(--accento); }
.s-gruppo h4 { break-after: avoid; margin: 8px 0 2px; font-size: 14px; font-weight: 700; color: var(--accento); }
.s-gruppo h4 a { color: inherit; }
.s-links { list-style: none; margin: 0; padding: 0; }
.s-links a { display: block; padding: 2px 0; color: var(--testo); text-decoration: none; font-size: 14.5px; line-height: 1.4; }
.s-links a:hover, .s-links a:focus-visible { color: var(--blu); text-decoration: underline; }

/* ---------- Contenuto ---------- */
.s-main { padding: 32px 0 48px; }
.s-content { background: var(--bianco); border-radius: var(--raggio); box-shadow: var(--ombra);
  padding: 32px 36px; max-width: calc(var(--larghezza) - 48px); }
.s-main a { color: var(--blu); }
.s-main a:hover { color: var(--accento); }

/* Adattamento delle vecchie pagine */
.s-main img[src*="cnrlogo"], .s-main img[src*="barranew"], .s-main #MenuPos,
.s-main img[src*="transparent.gif"] { display: none !important; }
.s-main table { max-width: 100%; border-collapse: collapse; }
.s-main table[width="770"], .s-main table[width="800"], .s-main table[width="668"],
.s-main table[width="770"] table, .s-main > .s-wrap > table { width: 100% !important; }
.s-main td, .s-main th { font-family: inherit; }
.s-main font { font-family: inherit !important; color: inherit; }
.s-main font[size="1"] { font-size: 14px; }
.s-main font[size="2"] { font-size: 16px; }
.s-main font[size="3"] { font-size: 18px; }
.s-main .sicicss, .s-main center.sicicss { font-family: inherit; font-size: inherit; color: inherit; }
.s-main b, .s-main strong { color: var(--blu-scuro); }
.s-main img { max-width: 100%; height: auto; border-radius: 6px; }
.s-main ul { padding-left: 1.3em; }
.s-main li { margin: 4px 0; }
.s-main hr { border: 0; border-top: 1px solid var(--bordo); margin: 24px 0; }

/* Titoli di sezione degli script ("Progetto AVI - Archivio Frane", "RICERCA PER COMUNE") */
.s-main center > table:first-child b, .s-main .s-titolo-pagina { font-size: 20px; }

/* Tabelle di dati: quelle con bordo */
.s-main table[border]:not([border="0"]) {
  border: 1px solid var(--bordo); border-radius: 8px; overflow: hidden; background: #fff; margin: 12px auto; }
.s-main table[border]:not([border="0"]) th,
.s-main table[border]:not([border="0"]) td { border: 1px solid var(--bordo); padding: 7px 10px; vertical-align: top; }
.s-main table[border]:not([border="0"]) tr:first-child td,
.s-main table[border]:not([border="0"]) th { background: var(--azzurro); color: var(--blu-scuro); font-weight: 600; }
.s-main table[border]:not([border="0"]) tr:nth-child(even) td { background: #f8fafd; }
.s-main table[border]:not([border="0"]) tr:hover td { background: #eef4fc; }

/* Moduli di ricerca */
.s-main select, .s-main input[type="text"], .s-main input:not([type]), .s-main textarea {
  font: 16px "Titillium Web", sans-serif; padding: 8px 10px; border: 1px solid #b9c6d6; border-radius: 6px;
  background: #fff; color: var(--testo); max-width: 100%; }
.s-main select:focus, .s-main input:focus, .s-main textarea:focus { outline: 2px solid var(--blu); outline-offset: 1px; border-color: var(--blu); }
.s-main input[type="submit"], .s-main input[type="button"], .s-main input[type="reset"], .s-main button {
  font: 600 15px "Titillium Web", sans-serif; background: var(--blu); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 18px; cursor: pointer; }
.s-main input[type="submit"]:hover, .s-main button:hover { background: var(--blu-scuro); }
.s-main form { margin: 8px 0; }

.s-scorri { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* ---------- Home ---------- */
.s-hero { background: linear-gradient(120deg, rgba(7, 29, 63, .92), rgba(11, 74, 158, .78)),
    url("/images/valderchia.GIF") center/cover no-repeat;
  color: #fff; border-radius: var(--raggio); padding: 56px 48px; margin-bottom: 32px; position: relative; overflow: hidden; }
.s-hero h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.15; font-weight: 700; max-width: 760px; }
.s-hero p { margin: 0 0 24px; font-size: 19px; max-width: 720px; color: #e4ecf8; }
.s-hero .s-etichetta { display: inline-block; background: var(--accento); color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; margin-bottom: 14px; }
.s-bottone { display: inline-block; padding: 12px 22px; border-radius: 8px; font-weight: 700; text-decoration: none !important;
  margin: 0 10px 10px 0; transition: transform .15s, box-shadow .15s; }
.s-bottone:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.s-bottone-pieno { background: var(--accento); color: #fff !important; }
.s-bottone-vuoto { border: 2px solid rgba(255, 255, 255, .8); color: #fff !important; }

.s-schede { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin: 8px 0 36px; }
.s-scheda { display: block; background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 22px;
  text-decoration: none !important; color: var(--testo) !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.s-scheda:hover { transform: translateY(-3px); box-shadow: var(--ombra); border-color: var(--blu); }
.s-scheda h3 { margin: 0 0 6px; color: var(--blu-scuro); font-size: 20px; }
.s-scheda p { margin: 0; color: var(--testo-soft); font-size: 15px; }
.s-scheda .s-icona { display: inline-flex; width: 42px; height: 42px; border-radius: 10px; background: var(--azzurro);
  color: var(--blu); align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.s-galleria { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.s-galleria figure { margin: 0; background: #fff; border-radius: var(--raggio); overflow: hidden; border: 1px solid var(--bordo); }
.s-galleria img { width: 100%; height: 170px; object-fit: cover; display: block; border-radius: 0; }
.s-galleria figcaption { padding: 10px 14px; font-size: 14px; color: var(--testo-soft); }
.s-sezione-titolo { font-size: 24px; margin: 0 0 14px; color: var(--blu-scuro); }

/* ---------- Piede ---------- */
.s-piede { background: var(--notte); color: #c3d0e4; font-size: 15px; }
.s-piede a { color: #fff; }
.s-piede-griglia { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 24px 72px; padding-top: 22px; padding-bottom: 18px; text-align: center; }
.s-piede-griglia p { margin: 0; line-height: 1.7; }
.s-piede h2 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
.s-piede-marchio { font-size: 30px; font-weight: 700; color: #fff; letter-spacing: .06em; margin: 0 0 6px; line-height: 1; }
.s-piede-marchio span { color: var(--accento); }
.s-piede-link { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; max-width: 680px; }
.s-piede-link a { text-decoration: none; line-height: 1.9; }
.s-piede-link a:hover { text-decoration: underline; }
.s-piede-fondo { border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.s-piede-fondo .s-wrap { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 24px; padding-top: 10px; padding-bottom: 10px; }

/* ---------- Schermi piccoli ---------- */
/* Testata, menu e piede larghi quanto il riquadro del contenuto */
@media (min-width: 961px) {
  .s-testata, .s-piede { max-width: calc(var(--larghezza) - 48px); margin-left: auto; margin-right: auto; }
  .s-testata .s-wrap, .s-piede .s-wrap { max-width: none; }
  .s-piede { border-radius: var(--raggio) var(--raggio) 0 0; overflow: hidden; }
}

@media (max-width: 960px) {
  .s-marchio .s-wrap { flex-direction: column; gap: 12px; }
  body.s-body { font-size: 16px; }
  .s-wrap { padding: 0 16px; }
  .s-logo img { height: 46px; }
  .s-hamburger { display: inline-flex; }
  .s-nav { display: none; }
  .s-nav.s-aperta { display: block; }
  .s-menu { flex-direction: column; padding: 6px 0 10px; }
  .s-voce-link { width: 100%; justify-content: space-between; padding: 13px 4px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .s-pannello { position: static; box-shadow: none; border-top: 0; max-height: none; background: #f7f9fc; border-radius: 6px; margin: 4px 0 8px; }
  .s-pannello .s-wrap { padding: 14px 14px 6px; }
  .s-colonne { columns: 1; }
  .s-main { padding: 16px 0 32px; }
  .s-content { padding: 20px 16px; border-radius: 8px; }
  .s-hero { padding: 32px 22px; }
  .s-hero h1 { font-size: 28px; }
  .s-hero p { font-size: 17px; }
  .s-piede-griglia { gap: 18px; }
  .s-barra-ente-dx { display: none; }
}

@media print {
  .s-testata, .s-piede, .s-salta { display: none !important; }
  .s-content { box-shadow: none; padding: 0; }
  body.s-body { background: #fff !important; }
}

/* Data in testa alle pagine dinamiche: discreta, a destra */
.s-content > center.sicicss:first-child, .s-content > center:first-child {
  text-align: right; font-size: 14px; color: var(--testo-soft); margin: -8px 0 4px; }
.s-content > center:first-child br { display: none; }

/* Tabelle dei risultati: sempre dentro la pagina, senza scorrimento orizzontale */
.s-main table { max-width: 100%; }
.s-main td, .s-main th { overflow-wrap: anywhere; }
.s-main td[nowrap], .s-main th[nowrap] { white-space: normal !important; }
.s-main table[border]:not([border="0"]) { width: auto; table-layout: auto; }
.s-main table.s-tabella-larga { width: 100% !important; font-size: 14px; line-height: 1.4; }
.s-main table.s-tabella-larga td, .s-main table.s-tabella-larga th { padding: 5px 6px; }
@media (max-width: 960px) {
  .s-main table[border]:not([border="0"]) { font-size: 13px; line-height: 1.35; }
  .s-main table[border]:not([border="0"]) td, .s-main table[border]:not([border="0"]) th { padding: 4px 5px; }
  .s-main table, .s-main tbody, .s-main tr { max-width: 100%; }
  .s-main table[width] { width: 100% !important; }
}
/* menu a tendina con voci molto lunghe: non allargano la pagina */
.s-main select { max-width: calc(100vw - 96px); text-overflow: ellipsis; }
@media (min-width: 961px) { .s-main select { max-width: 900px; } }
@media (max-width: 960px) {
  .s-main table.s-tabella-modulo, .s-main table.s-tabella-modulo > tbody,
  .s-main table.s-tabella-modulo > tbody > tr, .s-main table.s-tabella-modulo > tbody > tr > td {
    display: block; width: 100% !important; }
}
.s-main input[type="submit"], .s-main input[type="button"] { white-space: normal; max-width: 100%; }
@media (min-width: 961px) { .s-main select { max-width: 520px; } }
/* intestazioni delle tabelle: le parole non vengono spezzate */
@media (min-width: 961px) {
  .s-main table[border]:not([border="0"]) tr:first-child td,
  .s-main table[border]:not([border="0"]) th { overflow-wrap: normal; word-break: keep-all; }
}
/* titoli e elenchi delle pagine di testo (Credits) */
.s-main h1.s-titolo-pagina { color: var(--blu-scuro); font-size: 30px; margin: 0 0 16px; }
.s-main ul.s-credits { list-style: none; padding: 0; margin: 0 0 24px; }
.s-main ul.s-credits li { padding: 6px 0; border-bottom: 1px solid var(--bordo); }
.s-main ul.s-credits strong { color: var(--testo); }

/* avviso di errore interno a metà pagina */
.s-avviso { margin: 24px 0; padding: 12px 16px; border-left: 4px solid var(--accento); background: #fdf3e8; }
