/* =========================
   Palette & Base Typography
   ========================= */
:root {
  --primary-color: #95C11F;   /* verde */
  --secondary-color: #F0E7DA; /* avorio/sabbia */
  --text-color: #222222;
  --muted-color: #5c5c5c;
  --surface: #ffffff;
  --surface-alt: #faf7f1;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background: linear-gradient(180deg, var(--secondary-color), #fff);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; 
  display: flex; 
  flex-direction: column;
}

.hidden { display: none !important; }

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.site-main { flex: 1 0 auto; }

/* =========================
   Header
   ========================= */
header,
.site-header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 16px 0;
}

.site-header .header-inner,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo img {
  width: 140px;
  border-radius: 8px;
  
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-name { font-weight: 700; font-size: 1.1rem; }

.header-actions {
  display: inline-flex;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-solid {
  background: #fff;
  color: var(--primary-color);
}
.btn-solid:hover { filter: brightness(0.96); }

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.btn-outline:hover { background: #ffffff22; }

/* =========================
   Titles
   ========================= */
.page-title {
  margin: 26px 0 12px;
  font-size: 1.6rem;
  font-weight: 700;
}

/* =========================
   Cards Grid (Flexbox)
   Layout richiesto:
   - prime 2 card: 50/50
   - successiva riga: 3 card a pari larghezza
   ========================= */
.modules-grid,
.griglia {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-block: 12px 40px;
}

/* Card base */
.card,
.griglia > a,
.griglia > div {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid #eadfcd;
  border-radius: 14px;
  padding: 40px 28px 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 110px;
  flex: 1 1 calc(50% - 16px); /* default: prime due -> 50/50 */
}

.card:hover,
.griglia > a:hover,
.griglia > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  border-color: #e1d6c3;
}

.card-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.card-desc  { margin: 0; color: var(--muted-color); font-size: .95rem; }

/* Dal terzo elemento in poi -> tre colonne */
.modules-grid .card:nth-child(n+3),
.griglia > *:nth-child(n+3) {
  flex: 1 1 calc(33.333% - 16px);
}

/* =========================
   Footer (2 colonne pari)
   ========================= */
.site-footer,
footer {
  background: var(--secondary-color);
  color: var(--text-color);
  padding: 28px 0;
  border-top: 1px solid #e6dccf;
}

.footer-grid {
  display: flex;
  gap: 40px;
}

.footer-grid > * {
  flex: 1 1 50%;
}

.footer-grid p {
  margin: 0;
  color: #4d4d4d;
  line-height: 1.6;
  font-size: 14px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 900px) {
  /* prime due full width, poi 2 colonne */
  .modules-grid .card,
  .griglia > * {
    flex: 1 1 100%;
  }
  .modules-grid .card:nth-child(n+3),
  .griglia > *:nth-child(n+3) {
    flex: 1 1 calc(50% - 16px);
  }
}

@media (max-width: 640px) {
  .brand-name { font-size: 1rem; }

  .modules-grid .card,
  .modules-grid .card:nth-child(n+3),
  .griglia > *,
  .griglia > *:nth-child(n+3) {
    flex: 1 1 100%;
  }

  .footer-grid {
    flex-direction: column;
  }
}