
/* ========== CSS GENERALE DEL SITO ========== */

/* ================= BODY ================= */
body {
    margin: 0;
    font-family: 'Jost', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 1.05px;
    word-spacing: 1.5px;
    margin-top: 0;
    margin-bottom: 0;
    color: #222; /* grigio scurissimo che sembra nero */
    background-color: #f5f5f5; /* grigio chiaro */
}

section {padding: 0px 0 30px 0;} /* top, right, bottom, left */

p { text-align: justify;
    margin-top: 0.5rem;
    margin-bottom: 0.7rem; }  /* tutti i testi sono giustificati */

html {scroll-behavior: smooth; }

/* ================= classi <p> per TRAFILETTI e CIT ================= */

.center-italic {
    font-family: 'Jost', sans-serif;
    font-style: italic;
    font-size: 1.2rem;
    text-align: center;
}

.center {
    font-family: 'Jost', sans-serif;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.2rem;
    text-align: center;
}

.big {
    font-family: 'Jost', sans-serif;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    font-size: 1.3rem;
    text-align: center;
}

.list {
    font-family: 'Jost', sans-serif;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.2rem;
    text-align: left;
}

/* ================= TITOLETTI H2 DECORATI ================= */
h2 {
    clear: both;
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: #222;
    margin: 2rem 0 1rem 0;
    letter-spacing: 1px;
    text-align: center;
    position: relative;
}

h2::before,                /* aggiunge == prima e dopo */
h2::after {
    content: " == ";
    margin: 0 0.5rem;      /* spazio tra simboli e testo */
    /* niente color qui, eredita il colore del h2 */
}

/* ================= H2 ANIMAZIONE SCROLL ================= */
h2.reveal {
    position: relative;          /* serve per la trasformazione */
    opacity: 0;                  /* invisibile all’inizio */
    transform: translateX(-30px); /* parte leggermente a sinistra */
    transition: all 1.2s ease;  /* durata e easing */
}

h2.reveal.active {
    opacity: 1;                  /* diventa visibile */
    transform: translateX(0);    /* si ferma al centro */
}

/* ================= TITOLETTI H3 SEMPLICI ================= */
h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: #222;
    margin: 0 0 10px 0; /* rientro sotto minimo */
    line-height: 100%; /* rientro sopra */
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 0.8rem;
    text-align: center;
    position: relative;
}

/* ================= TITOLETTI H4 MINIMALI ================= */
h4 {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #222;
    margin-top: 0.5rem;
    margin-bottom: 0.7rem;
    letter-spacing: 1px;
    text-align: center;
    position: relative;
}

/* ================= TITOLETTI H5 SEMPLICI ================= */
h5 {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: #222;
    margin: 15px 0 20px 0; /* rientro sotto minimo */
    line-height: 100%; /* rientro sopra */
    letter-spacing: 1px;
    margin-top: 0;
    margin-bottom: 0.8rem;
    text-align: center;
    position: relative;
}

/* ================= CONTENITORE CENTRALE ================= */
.container {
    max-width: 1050px;
    margin: 0 auto;   /* 1° valore è margine sopra e sotto il secondo lasciare auto*/
    padding: 0 1.2rem; /* 1.2rem è lo spazio minimo a dx e sx*/
    text-align: center;
}

/* ================= CONTENITORE CENTRALE SMALL ================= */
.container-small {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.2rem; 
    text-align: center;
}

/* ================= CONTENITORE CENTRALE LARGE ================= */
.container-large {
    max-width: 1125px;
    margin: 0 auto;
    padding: 0 1.2rem; 
    text-align: center;
}


/* ================= HERO ================= */
.hero {
    height: 30vh;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)),
        url('/images/mechanism.jpg');
    background-size: cover;
    background-position: center;
}

/* LOGO ANIMATO */
.hero .logo {
    position: relative; /* NON absolute per lasciare spazio alla NAV */
    width: 100%;
    max-width: 500px;
    opacity: 0;
    animation: fadeUp 1.5s ease forwards;
}

/* H1 HERO */
.hero h1 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 800;
    font-size: 2.6rem;
    letter-spacing: 0.8px;
    text-align: center;
    color: black;
    margin: 50px 0 0 0;
    
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 2.2s ease forwards;
    animation-delay: 0.6s;
}

/* H1 nomi delle macchine per scrivere */
.typewriter-name {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: 1px;
    text-align: center;
    color: #111;
    margin: 30px 0 20px 0;
    
    animation: fadeIn 1.6s ease forwards;
}

/* ANIMAZIONI UNIFICATE */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* ================= HERO NAV ================= */
.hero-nav {
    background: #000;
    padding: 12px 0;
    width: 100%;
}

.hero-nav .container {
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 5.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-nav a {
    color: #bbb; /* grigio elegante */
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    word-spacing: 5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.hero-nav a:hover { color: #f0c000; }

.hero-nav a.active {
    color: #f0c000;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    font-size: 1.8rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}


/* ============ IMMAGINE EDITORIALE DX o SX standard (18 righe) ============ */
.right-img {
    float: right;                /* posizione a destra */
    width: auto;                 /* lunghezza fino al massimo consentito */
    max-width: 100%;             /* non oltre la larghezza del container */
    height: 30.2rem;               /* altezza “fissa” per imboccare numero righe */
    max-height: 100vh;           /* non oltre l’altezza visibile della finestra */
    object-fit: cover;           /* mantiene proporzioni senza distorsione */
    display: block;
    margin: 0.7rem 0 0.5rem 1.2rem; /* top | right | bottom | left */
}

.left-img {
    float: left;                /* posizione a destra */
    width: auto;                 /* lunghezza fino al massimo consentito */
    max-width: 100%;             /* non oltre la larghezza del container */
    height: 30.2rem;               /* altezza “fissa” per imboccare numero righe */
    max-height: 100vh;           /* non oltre l’altezza visibile della finestra */
    object-fit: cover;           /* mantiene proporzioni senza distorsione */
    display: block;
    margin: 0.7rem 1.2rem 0.5rem 0; /* top | right | bottom | left */
}

.container::after {
    content: "";
    display: block;
    clear: both;
}

/* ============ IMMAGINI EDITORIALI DX o SX h=n°di righe ============ */
.right-img.h8, .left-img.h8 {height: 12.8rem;}

.right-img.h9, .left-img.h9 {height: 14.5rem;}

.right-img.h10, .left-img.h10 {height: 16rem;}

.right-img.h11, .left-img.h11 {height: 17.8rem;}

.right-img.h12, .left-img.h12 {height: 21.2rem;}

.right-img.h13, .left-img.h13 {height: 23rem;}

.right-img.h14, .left-img.h14 {height: 24.8rem;}

.right-img.h15, .left-img.h15 {height: 26.5rem;}

.right-img.h16, .left-img.h16 {height: 28.3rem;}

.right-img.h17, .left-img.h17 {height: 29.2rem;}

.right-img.h18, .left-img.h18 {height: 30.2rem;}

.right-img.h19, .left-img.h19 {height: 32rem;}

.right-img.h20, .left-img.h20 {height: 35.2rem;}

.right-img.h21, .left-img.h21 {height: 36.8rem;}

.right-img.h22, .left-img.h22 {height: 38.7rem;}

.right-img.h23, .left-img.h23 {height: 39rem;}

.right-img.h24, .left-img.h24 {height: 40.5rem;}

.right-img.h25, .left-img.h25 {height: 42.4rem;}

.right-img.h26, .left-img.h26 {height: 44.2rem;}

.right-img.h27, .left-img.h27 {height: 45.8rem;}

.right-img.h28, .left-img.h28 {height: 47.5rem;}


/* ============ IMMAGINE SINGOLA 100% ============ */
.full-img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    display: block;
    margin: 25px auto 20px auto;  /* top | right | bottom | left */
}

/* ============ GRIGLIA 2 COLONNE PER FOTO ============ */
.grid2cl {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px auto 20px auto; /* top | right | bottom | left */
}

.grid2cl img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s;
}

.grid2cl figure {
  margin: 0;
  text-align: center;  /* centra didascalia e immagine */
}

.grid2cl figure p {
  margin-top: 20px;
  text-align: justify;
  line-height: 1.5;
}

figcaption {
  margin-top: 10px; /* modifiche al font figcaption */
  font-size: 1.15rem;
  font-style: italic;
}

.grid2cl-cf {   /* 2x3 con lettura per colonne */
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* due colonne desktop */
  grid-template-rows: repeat(3, auto);  /* tre righe */
  gap: 15px;
  margin: 25px auto;
  grid-auto-flow: column;
}

.grid2cl-cf img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s;
}

.grid2cl-cf figure {
  margin: 0;
  text-align: center;  /* centra didascalia e immagine */
}

/* ============ GRIGLIA 3 COLONNE PER FOTO ============ */
.grid3cl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px auto 20px auto; /* top | right | bottom | left */
}

.grid3cl img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s;
}

.grid3cl figure {
  margin: 0;
  text-align: center;  /* centra didascalia e immagine */
}

.grid3cl figure p {
  margin-top: 20px;
  text-align: justify;
  line-height: 1.5;
}

figcaption {
  margin-top: 10px; /* modifiche al font figcaption */
  font-size: 1.15rem;
  font-style: italic;
}

/* ============ GRIGLIA AUTOMATICA per coppie di foto con ridim. automatico ============ */
.grid-auto {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.row {
    display: flex;
    gap: 15px;
    width: 100%;
    overflow: hidden;
}

.row img {
    display: block;
    height: 100%;
    width: auto;
    flex-shrink: 0;
}

/* ============ GRIGLIA 3 COLONNE PER FOTO homepage ============ */
.restoration-preview .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px auto 25px auto; /* top | right | bottom | left */
}

.grid img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s;
}

.grid img:hover { transform: scale(1.05); }

/* ============ GRIGLIA 3 COLONNE 2 colonne su mobile per sez. restauri ============ */
.restoration-preview .grid3-2cl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px auto 25px auto; /* top | right | bottom | left */
}

.grid3-2cl img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s;
}

.grid3-2cl img:hover { transform: scale(1.05); }

/* ================= BUTTONS ================= */
.btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: #222;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
    max-width: 100%;
}

/* ===== TESTO + BOTTONE AFFIANCATI ===== */
.text-btn-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
    gap: 25px;
}

.text-btn-row p {
    flex: 1;
    margin: 0;
}

.text-btn-row .btn {
    margin-top: 0;
    white-space: nowrap;
}

/* ===== CONTENITORI VIDEO ===== */

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* rapporto 16:9 */
  height: 0;
  overflow: hidden;
  width: 100%; /* riempie tutto lo spazio del container-small */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ================= FOOTER ================= */
footer {
    padding: 38px 0 42px;
    background: #111;
    color: #aaa;
    font-size: 0.95rem;
    letter-spacing: 1.08px;
    word-spacing: 1.3px;
}

footer p {
    font-size: 0.9rem;
    text-align: left;
    margin: 0.2rem 0;
}

.footer-top, .footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* bottom alignment */
}

.footer-right a {
    display: inline-block; 
    margin-left: 20px;
    color: #aaa;
    text-decoration: none;
}

.footer-right a:hover {
    color: #fff;
}

.footer-left a {
  color: #4a6fa5;
  text-decoration: none;
}

.footer-left a:hover {
  color: #2f5fa3;
}

/* ================= custom-line ================= */
.custom-line1t {
  border-top: 1px solid #222;
  margin: 0.5rem 15px 2.4rem 15px;   /* top | right | bottom | left */
}
.custom-line1b {
  border-top: 1px solid #222;
  margin: 2.4rem 15px 0.5rem 15px;   /* top | right | bottom | left */
}

.custom-line2t {
  border-top: 1px solid #222;
  margin: 0 0 2.4rem 0;    /* top | right | bottom | left */
}

.custom-line2b {
  border-top: 1px solid #222;
  margin: 2.4rem 0 0 0;    /* top | right | bottom | left */
}

.custom-line3 {
  border-top: 1px solid #222;
  margin: 1.6rem 0 0.5rem 0;    /* top | right | bottom | left */
}


/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
.hero-nav ul {gap: 0.6rem 4rem;}
.hero-nav .container {max-width: 1050px;}
}

@media (max-width: 970px) {
    .hero-nav ul {gap: 0.6rem 5rem;}
    
    .restoration-preview .grid {grid-template-columns: repeat(2, 1fr);}
    
    .right-img,
    .left-img,
    .right-img.h8,  .left-img.h8,
    .right-img.h9,  .left-img.h9,
    .right-img.h10, .left-img.h10,
    .right-img.h11, .left-img.h11,
    .right-img.h12, .left-img.h12,
    .right-img.h13, .left-img.h13,
    .right-img.h14, .left-img.h14,
    .right-img.h15, .left-img.h15,
    .right-img.h16, .left-img.h16,
    .right-img.h17, .left-img.h17,
    .right-img.h18, .left-img.h18,
    .right-img.h19, .left-img.h19,
    .right-img.h20, .left-img.h20,
    .right-img.h21, .left-img.h21,
    .right-img.h22, .left-img.h22,
    .right-img.h23, .left-img.h23,
    .right-img.h24, .left-img.h24,
    .right-img.h25, .left-img.h25,
    .right-img.h26, .left-img.h26,
    .right-img.h27, .left-img.h27,
    .right-img.h28, .left-img.h28 {
        float: none;
        width: 100%;
        height: auto;
        margin: 1rem 0;
    }
    
    .footer-top, .footer-container {
        flex-direction: column;
        align-items: stretch; 
    }

    .footer-right {
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }

    .footer-right a {
        margin: 0 10px;
        display: inline-block;
    }
    
    footer p { text-align: center; }
}

@media (max-width: 768px) {
    body { background-color: #fafafa; }
    
    h2 { font-size: 1.5rem; }
    h2 { margin-top: 2.2rem; }
    h2::before, h2::after {display:none;}
    h5 { font-size: 1.5rem; }

    .restoration-preview .grid { grid-template-columns: 1fr; }
    .restoration-preview .grid3-2cl{ grid-template-columns: repeat(2, 1fr); gap: 5px; }
    .grid2cl { grid-template-columns: 1fr; }
    .grid2cl-cf { grid-template-columns: 1fr; grid-auto-flow: row; }
    .grid3cl { grid-template-columns: 1fr; }
    .grid-auto, .row { gap: 4px; }
    
    .keyboard, 
    .about { flex-direction: column; }
    
    .hero .logo { width: 70%; margin-top: 40px; }
    
    .hero h1 {
        max-width: 90%;
        font-size: 2.4rem;
        margin: 35px 0 0 0;
    }
    
    .typewriter-name {
        max-width: 90%;
        font-size: 2.0rem;
    }
    
    .hero-nav a { color: #e0e0e0;  } /* grigio elegante */

    .hero-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.35); /* semitrasparente */
        backdrop-filter: blur(6px);      /* l'errore non è reale, effetto vetro moderno */
        -webkit-backdrop-filter: blur(6px);
        z-index: 999;
        transition: transform 0.4s ease, opacity 0.4s ease;
    }

    .hero-nav.hide {
        transform: translateY(-100%);
        opacity: 0;
    }

    .hero-nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px 20px;
    }

    .nav-toggle {
        display: block;
    }

    .hero-nav ul {
        display: none;
        flex-direction: column;
        gap: 1rem;
        margin-top: 10px;
    }

    .hero-nav ul.active {
        display: flex;
    }
    
    .btn {
        white-space: normal;
        display: inline-block;
        overflow-wrap: break-word;
        text-align: center;
    }
    
    .text-btn-row { flex-direction: column; }
    .text-btn-row .btn { margin-top: 0rem; }
    
    .hide-mobile {display: none;}
}


@media (max-width: 480px) {
    .hero .logo { width: 70%; margin-top: 35px; }
    
    .hero h1 {
        max-width: 90%;
        font-size: 1.9rem;
    }
    
    .typewriter-name {
        max-width: 90%;
        font-size: 1.6rem;
    }
    
    .hero { height: 35vh; min-height: 300px; }
    .hero-nav ul { gap: 1rem; }
    
    .btn { font-size: 1.1rem; }
    
    footer { font-size: 0.9rem; }
    
    footer p{ font-size: 0.86rem; word-spacing: 0.4px; text-align: center; }    
}


@media (max-width: 420px) {
    .hero .logo { width: 65%; margin-top: 32px; }
    
    .hero h1 {
        max-width: 90%;
        font-size: 1.55rem;
        margin: 35px 0 0 0;
    }
    
    .typewriter-name {
        max-width: 90%;
        font-size: 1.4rem;
    }
    
    .hero { height: 30vh; min-height: 200px; }
    .hero-nav ul { gap: 1rem; }
    
    p { font-size: 1.05rem; word-spacing: 1.2px; }
    
    h2 { font-size: 1.2rem; }
    
    footer { font-size: 0.76rem; }
    
    footer p { font-size: 0.72rem; word-spacing: normal; text-align: center; }

}