/* ==========================================================================
   ASGroup 2026 — Utilities (layout primitives + helper tipografici)
   Tutte scopate sotto .asgroup-theme, prefisso .ag- (nessuna collisione .asg-).
   ========================================================================== */

.asgroup-theme .ag-container {
  width: 100%;
  max-width: var(--ag-container);
  margin-inline: auto;
  padding-inline: var(--ag-gutter);
}
.asgroup-theme .ag-container--narrow { max-width: var(--ag-container-narrow); }
.asgroup-theme .ag-container--wide { max-width: var(--ag-container-wide); }

.asgroup-theme .ag-section {
  padding-block: var(--ag-section-y);
}
.asgroup-theme .ag-section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.asgroup-theme .ag-section--ink {
  background: var(--ag-ink);
  color: var(--ag-on-ink);
}
.asgroup-theme .ag-section--ink :where(h1, h2, h3, h4) { color: var(--ag-on-ink); }
.asgroup-theme .ag-section--alt { background: var(--ag-surface-2); }

/* Eyebrow / etichetta sezione */
.asgroup-theme .ag-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--ag-fs-xs);
  font-weight: var(--ag-fw-medium);
  letter-spacing: var(--ag-tracking-wide);
  text-transform: uppercase;
  color: var(--ag-accent-strong);
}
.asgroup-theme .ag-section--ink .ag-eyebrow { color: var(--ag-on-ink-2); }
.asgroup-theme .ag-eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* Titoli */
.asgroup-theme .ag-display { font-size: var(--ag-fs-display); font-weight: var(--ag-fw-bold); line-height: var(--ag-lh-tight); letter-spacing: var(--ag-tracking-tight); }
.asgroup-theme .ag-h1 { font-size: var(--ag-fs-h1); }
.asgroup-theme .ag-h2 { font-size: var(--ag-fs-h2); }
.asgroup-theme .ag-h3 { font-size: var(--ag-fs-h3); }

/* Lead / testo introduttivo */
.asgroup-theme .ag-lead {
  font-size: var(--ag-fs-lead);
  line-height: 1.5;
  color: var(--ag-ink-2);
  max-width: 56ch;
}
.asgroup-theme .ag-section--ink .ag-lead { color: var(--ag-on-ink-2); }

.asgroup-theme .ag-muted { color: var(--ag-muted); }
.asgroup-theme .ag-accent-text { color: var(--ag-accent-strong); }
.asgroup-theme .ag-measure { max-width: 62ch; }
.asgroup-theme .ag-center { text-align: center; }
.asgroup-theme .ag-center .ag-lead { margin-inline: auto; }

/* Stack verticale */
.asgroup-theme .ag-stack > * + * { margin-top: var(--ag-space-4); }
.asgroup-theme .ag-stack-lg > * + * { margin-top: var(--ag-space-6); }

/* Griglie responsive */
.asgroup-theme .ag-grid { display: grid; gap: var(--ag-gutter); }
.asgroup-theme .ag-grid--2 { grid-template-columns: repeat(2, 1fr); }
.asgroup-theme .ag-grid--3 { grid-template-columns: repeat(3, 1fr); }
.asgroup-theme .ag-grid--4 { grid-template-columns: repeat(4, 1fr); }
.asgroup-theme .ag-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 900px) {
  .asgroup-theme .ag-grid--3,
  .asgroup-theme .ag-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .asgroup-theme .ag-grid--2,
  .asgroup-theme .ag-grid--3,
  .asgroup-theme .ag-grid--4 { grid-template-columns: 1fr; }
}

/* Header di sezione (eyebrow + titolo + lead) */
.asgroup-theme .ag-section-head { max-width: 64ch; }
.asgroup-theme .ag-section-head.ag-center { margin-inline: auto; }
.asgroup-theme .ag-section-head > * + * { margin-top: var(--ag-space-4); }

.asgroup-theme .ag-divider {
  height: 1px;
  background: var(--ag-line);
  border: 0;
}

/* Spacing helpers (per evitare style inline) */
.asgroup-theme .ag-mt-3 { margin-top: var(--ag-space-3); }
.asgroup-theme .ag-mt-4 { margin-top: var(--ag-space-4); }
.asgroup-theme .ag-mt-5 { margin-top: var(--ag-space-5); }
.asgroup-theme .ag-mt-6 { margin-top: var(--ag-space-6); }
.asgroup-theme .ag-mx-auto { margin-inline: auto; }
.asgroup-theme .ag-py-xl { padding-block: var(--ag-space-8); }
.asgroup-theme .ag-hidden { display: none; }

/* Cluster: riga di azioni/elementi con wrap */
.asgroup-theme .ag-cluster { display: flex; flex-wrap: wrap; gap: var(--ag-space-4); }
.asgroup-theme .ag-cluster--center { justify-content: center; }

/* Chips (es. elenco zone servite) */
.asgroup-theme .ag-chips { display: flex; flex-wrap: wrap; gap: var(--ag-space-3); }
.asgroup-theme .ag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--ag-line-2);
  border-radius: var(--ag-radius-pill);
  font-size: var(--ag-fs-sm);
}
