/* US Garibaldi ASD — stile istituzionale minimale
   Palette: bianco dominante, azzurro #1AB6E8 accento, testo #1f2a37 */

:root {
  --bianco: #ffffff;
  --azzurro: #014A75;
  --azzurro-scuro: #0f7ea3;
  --blu-header: #0e4c8a;
  --azzurro-accent: #1ab6e8;
  --testo: #1f2a37;
  --grigio: #4b5563;
  --bordo: #d7dde3;
  --fondo-tenue: #f4f8fb;
  --max: 880px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--testo);
  background: var(--bianco);
  line-height: 1.55;
}

a {
  color: var(--azzurro-scuro);
}

a:hover,
a:focus {
  color: var(--testo);
}

/* ---------- Home ---------- */

.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.construction {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grigio);
  text-align: center;
}

.logo {
  width: clamp(200px, 60vw, 320px);
  height: auto;
}

/* ---------- Footer comune ---------- */

.site-footer {
  border-top: 3px solid var(--azzurro);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--grigio);
  font-size: 0.875rem;
}

.footer-org {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--testo);
}

.footer-data {
  margin: 0 0 0.75rem;
}

.footer-link {
  margin: 0;
}

.footer-link a {
  text-decoration: underline;
}

.footer-link .sep {
  margin: 0 0.5rem;
  color: var(--bordo);
}

/* ---------- Pagina documento ---------- */

.doc-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1rem 1rem;
  border-bottom: 3px solid var(--azzurro);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.doc-logo {
  width: clamp(64px, 16vw, 96px);
  height: auto;
  display: block;
}

.entity {
  font-style: normal;
  font-size: 0.95rem;
  color: var(--grigio);
}

.entity strong {
  color: var(--testo);
}

.doc-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

h1 {
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 700;
  margin: 0.5rem 0 1.25rem;
}

.intro {
  font-size: 0.97rem;
  color: var(--grigio);
  margin: 0 0 1.75rem;
}

/* ---------- Tabella ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bordo);
  border-radius: 6px;
}

.table-wrap:focus {
  outline: 2px solid var(--azzurro);
  outline-offset: 2px;
}

.contributi {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 640px;
}

.contributi th,
.contributi td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--bordo);
  vertical-align: top;
}

.contributi thead th {
  background: var(--blu-header);
  color: var(--bianco);
  font-weight: 600;
  white-space: nowrap;
}

.contributi tbody tr:nth-child(even) {
  background: var(--fondo-tenue);
}

.contributi .num {
  text-align: right;
  white-space: nowrap;
}

.contributi .totale {
  background: var(--azzurro-accent);
  color: var(--bianco);
  font-weight: 700;
}

.contributi .totale th,
.contributi .totale td {
  border-top: 2px solid var(--blu-header);
  border-bottom: none;
  font-weight: 700;
  color: var(--bianco);
}

.contributi .totale th {
  text-align: right;
}

.totale-spacer {
  border-bottom: none;
}

/* ---------- Link PDF ---------- */

.pdf-link {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
}

.pdf-link a {
  text-decoration: underline;
}

/* ---------- Mobile ---------- */

@media (max-width: 560px) {
  .doc-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.85rem;
  }

  h1 {
    font-size: 1.2rem;
  }

  /* ---- Tabella a card ---- */

  .table-wrap {
    overflow-x: visible;
    border: none;
    border-radius: 0;
  }

  .contributi {
    min-width: 0;
    font-size: 0.95rem;
  }

  .contributi thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .contributi tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    border: 1px solid var(--bordo);
    border-radius: 6px;
    overflow: hidden;
  }

  .contributi tbody tr:nth-child(even) {
    background: var(--bianco);
  }

  .contributi tbody td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--bordo);
  }

  .contributi tbody td:last-child {
    border-bottom: none;
  }

  .contributi tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--grigio);
    flex: 0 0 45%;
  }

  .contributi tbody td.num {
    text-align: left;
  }

  .contributi tfoot .totale {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--blu-header);
    border-radius: 6px;
  }

  .contributi tfoot .totale-spacer {
    display: none;
  }

  .contributi tfoot .totale th,
  .contributi tfoot .totale td {
    border: none;
    padding: 0;
  }
}
