/*
 * ============================================================
 * Theme Name:  Mantini Holding Theme
 * Theme URI:   https://mantiniholding.it
 * Description: Tema premium, monopagina e ad alte prestazioni per Mantini Holding SRL. Ottimizzato per Core Web Vitals, GDPR e gestito nativamente tramite il Personalizzatore di WordPress senza plugin esterni.
 * Version:     1.2.0
 * Author:      Mantini Holding Architect
 * Author URI:  https://mantiniholding.it
 * Text Domain: mantini-holding-theme
 * ============================================================
 *
 * INDICE DEI CONTENUTI
 * ============================================================
 * 01. Caricamento Font Locali (Playfair Display & Inter)
 * 02. Design System — Variabili CSS Custom Properties
 * 03. Reset Universale & Box-Model
 * 04. Tipografia di Base
 * 05. Utilità Generali di Layout
 * 06. Accessibilità — Skip Link
 * ============================================================
 */


/* ============================================================
 * 01. CARICAMENTO FONT LOCALI
 * I font vengono serviti direttamente dalla cartella /assets/fonts/
 * del tema per eliminare le richieste di rete esterne (GDPR) e
 * ottenere il massimo punteggio LCP nei Core Web Vitals.
 * ============================================================ */

@font-face {
    font-family: 'Playfair Display';
    src: url('assets/fonts/playfair-display.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap; /* Evita il FOIT per non bloccare il First Contentful Paint */
}

@font-face {
    font-family: 'Inter';
    src: url('assets/fonts/inter.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}


/* ============================================================
 * 02. DESIGN SYSTEM — VARIABILI CSS CUSTOM PROPERTIES
 *
 * Tutte le variabili di brand sono definite qui e sostituite
 * dinamicamente da functions.php tramite wp_add_inline_style()
 * quando l'utente personalizza i colori nel Customizer.
 * ============================================================ */

:root {

    /* --- Colori Primari del Brand --- */
    --mantini-primary:        hsl(217, 33%, 17%);   /* Blu navy istituzionale */
    --mantini-primary-dark:   hsl(217, 33%, 12%);   /* Variante scura per sfondi profondi */
    --mantini-secondary:      hsl(210, 22%, 24%);   /* Blu acciaio secondario */

    /* --- Colore Accent (Oro istituzionale) --- */
    --mantini-accent:         hsl(38, 32%, 58%);    /* Oro principale */
    --mantini-accent-hover:   hsl(38, 32%, 48%);    /* Oro scurito per stati hover */
    --mantini-accent-light:   hsl(38, 30%, 94%);    /* Oro pallido per sfondi subtle */

    /* --- Palette Sfondi --- */
    --mantini-bg-light:       hsl(210, 20%, 98%);   /* Grigio luce per sezioni alternate */
    --mantini-bg-white:       hsl(0, 0%, 100%);     /* Bianco puro */

    /* --- Palette Testi --- */
    --mantini-text-main:      hsl(215, 28%, 17%);   /* Testo principale su sfondo chiaro */
    --mantini-text-muted:     hsl(215, 16%, 47%);   /* Testo secondario e didascalie */
    --mantini-text-light:     hsl(210, 20%, 95%);   /* Testo su sfondi scuri */

    /* --- Bordi & Separatori --- */
    --mantini-border:         hsl(215, 15%, 88%);   /* Bordo neutro standard */

    /* --- Tipografia: Famiglie --- */
    --font-headers: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* --- Tipografia: Dimensioni Fluide (Fluid Type Scale) --- */
    /* Scala da mobile (min) a desktop (max) usando clamp() */
    --fs-h1: clamp(2.25rem, 5vw, 3.5rem);
    --fs-h2: clamp(1.75rem, 4vw, 2.5rem);
    --fs-h3: clamp(1.35rem, 3vw, 1.75rem);
    --fs-h4: clamp(1.1rem,  2vw, 1.25rem);
    --fs-body:   1rem;       /* 16px — base unitaria */
    --fs-small:  0.875rem;   /* 14px */
    --fs-label:  0.75rem;    /* 12px — etichette maiuscole */

    /* --- Dimensioni Layout --- */
    --max-width:            1280px;
    --header-height:        80px;
    --header-shrink-height: 70px;

    /* --- Bordi --- */
    --border-radius: 4px;

    /* --- Animazioni & Transizioni --- */
    --transition:   all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    /* --- Ombre --- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(29, 43, 65, 0.08);
    --shadow-lg: 0 16px 48px rgba(29, 43, 65, 0.12);

    /* --- Spaziature Sezionali (Section Padding) --- */
    --section-py: clamp(4rem, 8vw, 7rem);
}


/* ============================================================
 * 03. RESET UNIVERSALE & BOX-MODEL
 * Approccio moderno basato su Andy Bell's CSS Reset (2024).
 * Garantisce coerenza cross-browser e rimuove stili agente.
 * ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin:  0;
    padding: 0;
}

/* Previene overflow orizzontale indesiderato */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;      /* Scrolling fluido per i link ancorati */
    text-size-adjust: 100%;       /* Previene il ridimensionamento automatico del testo su iOS */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size:   var(--fs-body);
    line-height: 1.7;
    color:       var(--mantini-text-main);
    background-color: var(--mantini-bg-white);
    -webkit-font-smoothing:  antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Reset per elementi multimediali — previene overflow nei container */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* Reset per elementi di input — eredita la font-family dal documento */
input,
button,
textarea,
select {
    font: inherit;
}

/* Previene overflow del testo in blocchi di testo statici */
p,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Reset liste — la semantica è garantita dal markup HTML */
ul,
ol {
    list-style: none;
}

/* Reset link */
a {
    color: inherit;
    text-decoration: none;
}

/* Normalizzazione dei pulsanti */
button {
    cursor: pointer;
    background: none;
    border: none;
}

/* Tabelle — ripristino separazione celle */
table {
    border-collapse: collapse;
    border-spacing: 0;
}


/* ============================================================
 * 04. TIPOGRAFIA DI BASE
 * Applica la scala fluida definita nel design system alle
 * intestazioni e ai blocchi di testo del documento.
 * ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family:  var(--font-headers);
    line-height:  1.2;
    color:        var(--mantini-text-main);
    font-weight:  700;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
    margin-bottom: 1.25em;
    color: var(--mantini-text-muted);
}

p:last-child {
    margin-bottom: 0;
}

/* Stile per le etichette di sezione (es: "La Governance", "I Nostri Settori") */
.section-label {
    display:        inline-block;
    font-family:    var(--font-body);
    font-size:      var(--fs-label);
    font-weight:    600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color:          var(--mantini-accent);
    margin-bottom:  1rem;
}


/* ============================================================
 * 05. UTILITÀ GENERALI DI LAYOUT
 * Classi di supporto riutilizzabili nei template PHP.
 * ============================================================ */

/* Contenitore principale a larghezza massima centrato */
.container {
    width:     100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* Spaziatura verticale standard per le sezioni della homepage */
.section {
    padding-block: var(--section-py);
}

/* Sezione con sfondo alternato (grigio chiarissimo) */
.section--alt {
    background-color: var(--mantini-bg-light);
}

/* Separatore geometrico dorato (usato affianco alla tagline Hero) */
.divider-accent {
    display:    inline-block;
    width:      40px;
    height:     2px;
    background: var(--mantini-accent);
    vertical-align: middle;
    margin-inline: 0.75rem;
}

/* Classe di utilità per nascondere visivamente ma mantenere accessibile agli screen reader */
.sr-only {
    position:   absolute;
    width:      1px;
    height:     1px;
    padding:    0;
    margin:     -1px;
    overflow:   hidden;
    clip:       rect(0, 0, 0, 0);
    white-space: nowrap;
    border:     0;
}

/* Animazione base di fade-in per gli elementi con Intersection Observer */
.animate-on-scroll {
    opacity:    0;
    transform:  translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
    opacity:   1;
    transform: translateY(0);
}


/* ============================================================
 * 06. ACCESSIBILITÀ — SKIP LINK
 * Permette agli utenti di tastiera e screen reader di saltare
 * direttamente al contenuto principale della pagina.
 * ============================================================ */

.skip-link {
    position:   absolute;
    top:        -100%;
    left:       1rem;
    z-index:    9999;
    padding:    0.75rem 1.5rem;
    background: var(--mantini-primary);
    color:      var(--mantini-text-light);
    font-weight: 600;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}
