/* =========================================
   1. RESET E VARIABILI GLOBALI
   ========================================= */
:root {
    --brand-red: #9E2A2B;    /* Rosso "Mario Cuzzolin" */
    --brand-dark: #333333;   /* Grigio Scuro quasi nero (Titoli) */
    --text-color: #444444;   /* Testo corpo */
    --bg-grey: #f4f4f4;      /* Sfondo sezioni alterne */
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif; /* Font per il testo lungo */
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--white);
}

/* =========================================
   2. TIPOGRAFIA (Stile "Studio Tecnico")
   ========================================= */

/* H1 e H2: Stile pesante, compatto, grigio scuro */
h1, h2, .big-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900; /* BLACK (Molto grassetto) */
    color: var(--brand-dark);
    letter-spacing: -1.5px; /* Lettere vicine come nel logo Studio Tecnico */
    margin-bottom: 0.5rem;
    line-height: 1.1;
    text-transform: none; /* Rispetta le maiuscole/minuscole HTML (Capitalize) */
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.8rem;
}

/* Sottotitoli Rossi (es. "Mario Cuzzolin", "Process Specialist") */
h3, h4, .red-subtitle, .accent-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; /* Bold */
    color: var(--brand-red);
    letter-spacing: -0.5px;
}

h3 {
    font-size: 1.5rem;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* =========================================
   3. ELEMENTI E COMPONENTI
   ========================================= */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

ul {
    list-style: none;
    padding: 0;
}

/* Linea divisoria rossa spessa */
.divider-red {
    width: 80px;
    height: 7px;
    background-color: var(--brand-red);
    margin: 15px 0 25px 0;
}

.divider-center {
    width: 80px;
    height: 7px;
    background-color: var(--brand-red);
    margin: 15px auto 40px auto;
}

/* Pulsanti */
.btn-header {
    background-color: var(--brand-red);
    color: #fff !important;
    padding: 10px 25px;
    border-radius: 4px;
    transition: background 0.3s;
    font-weight: 600;
}

.btn-header:hover {
    background-color: #7a1f20;
}

.btn-primary {
    background-color: var(--brand-red);
    color: #fff;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    display: inline-block;
    margin-top: 20px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #7a1f20;
}

/* =========================================
   4. HEADER DI NAVIGAZIONE
   ========================================= */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* LOGO: Immagine */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 55px; /* Altezza ottimale per header */
    width: auto;
    display: block;
}

.site-header nav a {
    text-decoration: none;
    color: var(--brand-dark);
    margin-left: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.site-header nav a.active {
    color: var(--brand-red);
}

/* =========================================
   5. HERO SECTION (Centrata e "Abbassata")
   ========================================= */
.hero-section {
    /* Gradiente scuro + Immagine 'sfondo.jpg' */
    background: linear-gradient(rgba(20, 20, 20, 0.5), rgba(20, 20, 20, 0.7)), url('sfondo.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;

    /* FLEXBOX: Centra il contenuto verticalmente e orizzontalmente */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Altezza minima per permettere il centraggio visivo */
    min-height: 80vh; 
    padding: 0;
    text-align: center;
}

.hero-section h1 {
    color: #fff; /* Forza il bianco su sfondo scuro */
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

.category-tag {
    background-color: var(--brand-red);
    color: #fff;
    padding: 16px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: inline-block;
    
    /* Margini per staccare dal titolo */
    margin-bottom: 30px;
    
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    text-transform: none; 
    border-radius: 2px;
}

.hero-section .subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.hero-desc {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    color: #ddd;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    line-height: 1.5;
}

/* =========================================
   6. SEZIONI E LAYOUT (Intro, Grid)
   ========================================= */
.section-block {
    padding: 80px 0;
}

.white-bg { background-color: var(--white); }
.grey-bg { background-color: var(--bg-grey); }

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Box "Studio Tecnico" (stile scheda bianca con bordo rosso) */
.intro-image-box {
    background: #fff;
    padding: 30px;
    border-left: 10px solid var(--brand-red);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.cuzzolin-style {
    margin-bottom: 20px;
}

.img-placeholder {
    width: 100%;
    height: 250px;
    background-color: #ddd;
    background-image: url('https://images.unsplash.com/photo-1581092160562-40aa08e78837?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    margin-top: 20px;
    border-radius: 4px;
}

.styled-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.styled-list li::before {
    content: "•";
    color: var(--brand-red);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* =========================================
   7. CURRICULUM (Box Scuri)
   ========================================= */
.curriculum-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.curriculum-box {
    flex: 1;
    min-width: 300px;
    display: flex;
    background-color: #2c2c2c; /* Sfondo scuro */
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.vertical-red-bar {
    width: 15px; /* Barra rossa laterale spessa */
    background-color: var(--brand-red);
    flex-shrink: 0;
}

.box-content {
    padding: 30px;
    flex-grow: 1;
}

.box-content h3 {
    color: #fff; /* Titolo bianco su sfondo scuro */
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.box-content ul li {
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 5px;
    font-size: 0.95rem;
}

/* =========================================
   8. SERVIZI (Grid Cards)
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.service-card {
    background: #fff;
    border: 2px solid #eee;
    padding: 25px;
    transition: all 0.3s ease;
    text-align: center;
}

.service-card:hover {
    border-color: var(--brand-red);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.service-card h4 {
    color: var(--brand-dark);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 800;
}

/* =========================================
   9. TABELLA ORARIA
   ========================================= */
.table-responsive {
    overflow-x: auto;
}

.astori-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.astori-table th {
    background-color: #fcebeb; /* Rosso molto chiaro */
    color: var(--brand-red);
    padding: 15px;
    text-align: center;
    border: 1px solid #fff;
    font-weight: 700;
}

.astori-table th:first-child {
    background: #fff;
    color: var(--brand-dark);
    text-align: right;
    padding-right: 20px;
}

.astori-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #eee;
}

.astori-table td:first-child {
    text-align: right;
    font-weight: 600;
    color: var(--brand-dark);
    padding-right: 20px;
}

/* Footer della tabella (Totale Ore) */
.table-footer td {
    background-color: var(--brand-red);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================================
   10. CTA FOOTER & FOOTER
   ========================================= */
.cta-section {
    background-color: var(--brand-dark);
    color: #fff;
    text-align: center;
    padding: 70px 0;
}

.cta-section h2 {
    color: #fff;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

footer {
    background-color: #1a1a1a;
    color: #888;
    text-align: center;
    padding: 30px;
    font-size: 0.9rem;
}

/* =========================================
   11. RESPONSIVE (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .logo img {
        height: 40px; /* Logo più piccolo su mobile */
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .hero-section { min-height: 60vh; }
    
    .site-header nav { display: none; } /* Menu semplificato */
    
    .curriculum-container {
        flex-direction: column;
    }
}

/* =========================================
   12. GALLERY MODERNA & LIGHTBOX
   ========================================= */

/* Griglia contenitore */
.gallery-grid {
    display: grid;
    /* Crea colonne automatiche (minimo 280px larghezza) */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Card Immagine */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    height: 250px; /* Altezza fissa per uniformità */
}

/* L'immagine dentro la card */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Taglia l'immagine per riempire il box */
    transition: transform 0.5s ease;
    display: block;
}

/* Effetto Hover: Zoom */
.gallery-item:hover img {
    transform: scale(1.1);
}

/* Overlay scuro al passaggio del mouse */
.gallery-item::after {
    content: '\002B'; /* Segno + */
    font-size: 3rem;
    color: #fff;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(158, 42, 43, 0.6); /* Rosso Brand trasparente */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    
    pointer-events: none; 
}

.gallery-item:hover::after {
    opacity: 1;
}

/* --- LIGHTBOX (Finestra Modale) --- */
.lightbox {
    display: none; /* Nascosto di default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9); /* Sfondo nero scuro */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

/* Immagine ingrandita */
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Didascalia */
#caption {
    margin: 15px auto;
    width: 80%;
    text-align: center;
    color: #ccc;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
}

/* Bottone Chiudi (X) */
.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--brand-red);
    text-decoration: none;
    cursor: pointer;
}

/* Animazione comparsa */
@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

/* =========================================
   13. STILE PULSANTI CTA (Chiamata, Brochure, Video)
   ========================================= */

/* Contenitore flessibile per allineare i 3 bottoni */
.cta-buttons {
    display: flex;
    justify-content: center; /* Centrati orizzontalmente */
    gap: 20px; /* Spazio tra i bottoni */
    flex-wrap: wrap; /* Su mobile vanno a capo se non c'è spazio */
    margin-top: 30px;
}

/* Modifica al bottone standard per funzionare bene nel gruppo */
.cta-buttons .btn-primary {
    margin-top: 0; 
    min-width: 180px; 
}

/* Nuovo stile: Bottone "Outline" (Bordo bianco, sfondo trasparente) */
.btn-outline {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 13px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    min-width: 180px;
    display: inline-block;
}

.btn-outline:hover {
    background-color: #fff;
    color: var(--brand-dark); 
}

/* SU MOBILE: I bottoni si impilano verticalmente */
@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-outline {
        width: 100%; 
        max-width: 300px;
    }
}