/* Setto le variabili CSS */
:root{
    /* Tavolozza colore */
    --primary-color:#ffffff;
    --secondary-color:#1A5F40;
    --accent-color:#D90B31;
    --dark-color:#111010;
    --light-color: #d8d1d1;
    --grey-color: #b4abab;


    /* Fonts */
    --font-display: "neue-haas-unica", sans-serif;
    --font-text: "neue-haas-unica", sans-serif;

    /* Size */
    --xs: 5px;
    --s: 10px;
    --m: 15px;
    --l: 20px;
    --xl: 30px;
    --xxl: 70px;

}

/* RESET */
*{
    margin: 0;
    padding: 0;
}

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


li{
    list-style-type: none;
}

a{
    text-decoration: none;
    display: block;
}

html{
    scroll-behavior: smooth;
}

/* UTILITY */
.res{
    width: 100%;
    max-width: 480px;
}

.clip{
    clip-path: circle();
}

.wrapper{
    max-width: 900px;
    margin: 0 auto;
    padding: 0 50px;
}

/* Tipografia */
body{
    font-family: var(--font-text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    margin-bottom: var(--m);
}

p.leading{
    font-size: 1.3em;
    margin-bottom: var(--s);
}

p {
    margin-bottom: var(--xs);
}

/* HEADER */
header.cover{
    background: var(--primary-color);
    padding: var(--m) 0;
    border-bottom: 1px solid var(--light-color);
    transition: all 0.6s cubic-bezier(.18,.98,.52,.94);
}

header.cover div.wrapper{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;

}

.cover__menu{
    order: 3;
    width: 100%;
    text-align: right;

    max-height: 0;
    overflow: hidden;
    opacity: 0;

    transition: all 0.4s ease;
}

header.cover.active .cover__menu{
    max-height: 300px;
    opacity: 1;
}

.cover__hb .material-symbols-outlined{
    font-size: 32px;
    font-weight: 200;
    line-height: 1;
}

.cover__hb{
    color: var(--dark-color);
    cursor: pointer;
}

.cover__hb .material-symbols-outlined{
    font-size: 32px;
    font-weight: 200;
    line-height: 1;
}

ul.main-menu li a {
        color: var(--dark-color);
        margin: 20px;
        font-weight: 200;
    } 

/* CTA */
.cta-group{
    font-size: 1.1em;
    display: flex;
    gap: 5px;
    margin-top: 15px;
    flex-direction: column; /* pulsanti impilati su mobile */
    align-items: flex-start;
}

.cta-group a{
    border: 1px solid var(--primary-color);
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 200;
}

/* Pulsante bianco e nero */
a.cta-primary {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--dark-color); /* nero di base */
    color: var(--primary-color);      /* testo bianco */
    font-weight: 200;
    font-size: 1.1rem;
    text-transform: none;       /* niente maiuscolo */
    border: 1px solid #111010;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

a.cta-primary:hover {
    background-color: #ffffff; /* bianco al passaggio */
    color: var(--dark-color);            /* testo nero */
    border: 1px solid var(--dark-color);
}

a.cta-secondary {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--primary-color);
    color: var(--dark-color);
    font-weight: 200;
    font-size: 1.1rem;
    text-transform: none;       /* niente maiuscolo */
    border: 1px solid var(--dark-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
}

a.cta-secondary:hover{
    font-weight: 500;
    border: 1px solid var(--dark-color);
     font-size: 1.07rem; /* sennò va su due righe */
}

/* HERO */
.hero {
    display: flex;
    flex-direction: column-reverse; /* testo sopra immagine */
    align-items: center;
    gap: var(--l);
    padding-top: var(--l); /* spinge tutto il contenuto della hero verso il basso */
}
section.hero{
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: var(--xl) 0;
}
.hero.cover {
    display: flex;
    justify-content: center; 
    margin-bottom: var(--l);
    margin-top: var(--l);
}

.hero__cover img {
    width: 100%;
    max-width: 300px;  /* limite massimo su smartphone */
    height: auto;
    border-radius: 2px;
}


.hero__text h1{
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    line-height: 1.05;
    margin-bottom: var(--s);
    text-transform: uppercase;
}

.hero__text h3{
    font-weight: 400;
    margin-bottom: var(--l);
    color: var(--dark-color);
}
.hero__text p{
    max-width: 360px;
    line-height: 1.5;
    margin-bottom: var(--m);
}

/* Dimensione prezzi hero */
.hero__price{
    margin: var(--l) 0;
}

.price-main{
    font-size: 1.4rem;
    font-weight: 700;
}

.price-label{
    font-size: 0.85rem;
    color: #666;
    margin-bottom: var(--s);
}

/* Hero info: tutte le coppie in colonna verticale */
.hero__info {
    display: flex;
    flex-direction: column;  /* ogni coppia su una riga */
    gap: var(--s);
    margin-top: var(--xl);    /* distanza dai bottoni */
    align-items: flex-start; /* forza l’allineamento a sinistra */
    width: 100%;             
}

/* Ogni riga: categoria + nome */
.hero__info > div {
    display: flex;
    flex-direction: row;     /* categoria e valore affiancati */
    justify-content: flex-start;
    gap: var(--s);           
}

.hero__info .info-pair {
    display: flex;
    flex-direction: row;     /* riga */
    gap: var(--s);
}

/* Categoria */
.info-categories {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Valore */
.info-name {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0; /*  margine zero per uniformare */
}

/* Wrapper leggi tutto */
.read-more-wrapper {
    margin-top: var(--l);
    font-size: 1rem;
}

/* Bottone Leggi tutto con testo a sinistra e icona a destra */
.read-more-btn {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--s) 0;
    display: flex;
    justify-content: space-between; /* testo a sinistra, icona a destra */
    align-items: center;
    border-bottom: 1px solid var(--light-color);
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1rem;
}

/* Icona + o – */
.add-icon {
    font-size: 1.2em;
    line-height: 1;
    transition: all 0.3s ease;
}

/* Testo normale */
.add-text {
    flex: 1; /* occupa tutto lo spazio a sinistra */
    text-align: left;
}

/* Testo esteso nascosto */

.read-more-full {
    max-height: 0;          /* altezza iniziale 0 */
    overflow: hidden;       /* nasconde il testo */
    transition: max-height 0.5s ease;
    color: var(--dark-color);
    line-height: 1.5;
}

/* Quando aperto */
.read-more-wrapper.open .read-more-full {
    max-height: 2000px; /* aumentare se non ci sta il contenuto */
}

/* Titolo interno alla sezione Leggi tutto */
.read-more-full .text-title {
    font-family: var(--font-display);
    font-size: 1.5rem;    /* leggermente più piccolo di h1 */
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-color);
    margin-bottom: var(--s); 
    margin-top: var(--m);
}

/* Sottotitolo interno */
.read-more-full .text-subtitle {
    font-family: var(--font-display);
    font-size: 1.2rem;      /* più piccolo del titolo (che è 1.5 vedi su) */
    font-weight: 400;
    line-height: 1.3;
    color: var(--dark-color);
    margin-bottom: var(--m); /* spazio sotto il sottotitolo */
}

/* Corpo testo esteso */
.read-more-full .text-body {
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark-color);
    margin-bottom: var(--m);
}

/* Griglia immagini */
.images-grid {
    display: grid;
    grid-template-columns: 1fr; /* iphone: colonna singola */
    gap: var(--s);
    margin-top: var(--l);
}

/* Immagini */
.images-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

/*Articoli che potrebbero interessare */
.related {
    margin-top: var(--xl);
}

.related__title {
    font-size: 1.4rem;
    margin-bottom: var(--l);
    text-align: center;
}

.related__grid {
    display: grid;
    grid-template-columns: 1fr;   /* iphone */
    gap: var(--l);
    justify-items: center;       /* centra le card */
}
.related__item {
    text-align: center;
    max-width: 200px;   /* simile alle immagini della gallery */
}

.related__item img {
    width: 100%;
    height: auto;
    display: block;
    margin-top: var(--s);
    border-radius: 2px;
}

.related__item h3 {
    font-size: 1rem;
    margin-bottom: 2px;
    margin-top: var(--s);
}

.related__item p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: var(--m);
}

.related__cta {
    margin-bottom: var(--m);
}

/* Newsletter e Tasto mail */
.newsletter-form {
    display: flex;
    flex-direction: column; /* pulsante sotto input su mobile */
    align-items: center;    /* centra input e pulsante */
    gap: var(--xs);
    width: 100%;
    max-width: 300px;       /* lunghezza massima del box mail */
    margin: 0 auto;         /* centra il form */
    padding: 0 15px;
    box-sizing: border-box;
}

.newsletter-form input[type="email"] {
    width: 100%;           
    padding: 10px;
    margin-top: var(--m);
    margin-bottom: var(--xs);
    border-radius: 2px;
    text-align: center;
    border: 1px solid var(--light-color);
    font-size: 1rem;
}

.newsletter-form a.cta-mail {
    display: inline-block;
    padding: 5px 15px;
    text-align: center;
    width: auto;      
    cursor: pointer;
    font-weight: 200;
    text-transform: none;
    border: 1px solid var(--dark-color);
    border-radius: 2px;
    background-color: var(--primary-color); /* bianco di base */
    color: var(--dark-color);               /* testo nero */
    transition: all 0.3s ease;
}

.newsletter-form a.cta-mail:hover {
    background-color: var(--dark-color);   /* nero al passaggio */
    color: var(--primary-color);           /* testo bianco */
    border: 1px solid var(--dark-color);
}

/* Social */
.social__item {
    display: flex;
    flex-direction: column;
    margin-top: var(--l);
    align-items: center;
}
.social__item h3{
    font-size: 1rem;
    font-weight: 300;
}
.social__item a{
    color: var(--dark-color);
}
.social__item a:hover{
    color: var(--secondary-color);
}

/* FOOTER */
.site-footer {
    background-color: var(--primary-color);
    padding: var(--m) 0;
    margin-top: var(--l);
    border-top: 1px solid var(--light-color); /* linea identica all'header */
    display: flex;
    justify-content: center; /* centra il logo */
    align-items: center;
    flex-direction: column; /* logo sopra tutto */
    position: relative; /* necessario per scroll-top */
}

.footer-logo img {
    display: block;
    max-width: 160px;
}

.scroll-top {
    position: fixed;       /* mantiene tasto fisso */
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: var(--primary-color);
    padding: 10px;
    border-radius: 50%;
    font-size: 2rem;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-top:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

/* Logo più piccolo su mobile */
@media (max-width: 767px) {
    .cover__logo img {
        width: 180px;  /* prima era 240px, meglio + più piccolo su iphone */
    }
}

/* Interruzione per tablet (Medium) */
@media(min-width: 768px){
    section.hero {
        flex-direction: row;
    }
    .hero {
        flex-direction: row; /* testo a sinistra, immagine a destra */
        align-items: flex-start;
        gap: var(--l);
    }

    .hero__text {
        max-width: 50%;       /* metà della sezione per il testo */
        margin-right: 100px;   /* spazio tra testo e immagine */
    }
    .hero__cover {
        max-width: 50%;       /* metà della sezione per l’immagine */
        justify-content: flex-start; /* allinea immagine a sinistra del contenitore */
        margin-bottom: 0;      /* togli spazio sotto su desktop */
    }
    .hero__cover figure {
        margin: 0; /* dovrebbe allineare immagine testo :,) */
    }

    .hero__cover img {
        width: 100%;
        height: auto;
        max-width: 100%;
}
    .cta-group{
        flex-direction: row; /* affiancati su tablet/desktop */
    }
    
    .related__grid {
        display: grid;
        grid-template-columns: repeat(2, auto); /* larghezza minima necessaria per le card */
        justify-content: center; 
        column-gap: var(--xxl);    /* distanza colonne */
        row-gap: var(--m);       /* distanza righe */
    }
    .images-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    .images-grid img {
        max-width: 100%; /* immagini riempiono tutta la colonna */
        height: auto;
    }
    .social__item{
        flex-direction: row;
        justify-content: center; 
        gap: var(--xl);
    }
}

/* Interruzione per desktop (Large) */
@media(min-width: 1024px){
    section.hero {
        flex-direction: row;
    }
    .hero {
        flex-direction: row; /* testo a sinistra, immagine a destra */
        align-items: flex-start;
        gap: var(--l);
    }

    .hero__text {
        max-width: 50%;       /* metà della sezione per il testo */
        margin-right: 100px;   /* spazio tra testo e immagine */
    }
    .hero__cover {
        max-width: 50%;       /* metà della sezione per l’immagine */
        justify-content: flex-start; /* allinea immagine a sinistra del contenitore */
        margin-bottom: 0;      /* togli spazio sotto su desktop */
    }

    .hero__cover img {
        max-width: 100%;      /* riempie solo il contenitore */
        height: auto;
    }

    .cover__menu{
    order: unset;
    width: auto;
    max-height: none;
    opacity: 1;
    overflow: visible;
    }

    .cover__hb{
        display: none;
    }

    ul.main-menu{
        display: flex;
        gap: var(--m);
    }
    .images-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
    .images-grid img {
        max-width: 100%; /* immagini riempiono tutta la colonna */
        height: auto;
    }

    .read-more-wrapper.open .read-more-full {
        display: grid; /* visibile quando aperto */
    }

    .related__grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--s);
    }
    .social__item{
        flex-direction: row;
        justify-content: center; 
        gap: var(--xl);
    }

}
