/* design-system.css — utility classes e base globale */

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-6);
}

.container--md {
    max-width: var(--container-md);
}

/* ============================================================
   SEZIONI
   ============================================================ */

.section {
    padding-block: var(--space-20);
}

.section--sm {
    padding-block: var(--space-12);
}

.section--lg {
    padding-block: var(--space-24);
}

.section--tall {
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.section--alt {
    background-color: var(--color-bg-alt);
}

.section--dark {
    background-color: var(--color-bg);
}

/* ============================================================
   GRIGLIA
   ============================================================ */

.grid {
    display: grid;
    gap: var(--space-8);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--auto-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

@media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid--2,
    .grid--3,
    .grid--4 { grid-template-columns: 1fr; }
}

/* ============================================================
   FLEX UTILITY
   ============================================================ */

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

/* ============================================================
   TESTO UTILITY
   ============================================================ */

.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-accent  { color: var(--color-accent); }
.text-muted   { color: var(--color-text-muted); }
.text-sm      { font-size: var(--text-sm); }
.text-lg      { font-size: var(--text-lg); }

/* ============================================================
   SPAZIATURA UTILITY
   ============================================================ */

.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mt-8  { margin-top: var(--space-8); }

/* ============================================================
   SECTION HEADER (titolo + sottotitolo sezione)
   ============================================================ */

.section-header {
    margin-bottom: var(--space-12);
}

.section-header--center {
    text-align: center;
    max-width: 680px;
    margin-inline: auto;
    margin-bottom: var(--space-12);
}

.section-label {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
}

.section-title {
    margin-bottom: var(--space-4);
}

.section-desc {
    color: var(--color-text-secondary);
    font-size: var(--text-lg);
    max-width: 600px;
}

.section-header--center .section-desc {
    margin-inline: auto;
}

/* ============================================================
   ANIMATION — fade-in on scroll (aggiunto via JS)
   ============================================================ */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }
