@import url('global.css');

body{
    font-family: var(--font-family);
    font-size: var(--fs);
    background-color: var(--primary);
    color: var(--secondary);
}
body.active{position: fixed; overflow:hidden;}
h5 a{color:var(--primary);}

.container{width: 100%; max-width: 100%; padding-left: var(--gutter); padding-right: var(--gutter);}

.header{
    position: fixed;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 999;
    background-color: var(--primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-header{
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 4vw;
    z-index: 999;
    background-color:var(--primary);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header.is-hidden,
.page-header.is-hidden{
    transform: translateY(-100%);
}

header.is-scrolled,
.page-header.is-scrolled{
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}


/* ==================== */
/* INTRO SECTION IMAGE  */
/* ==================== */

.intro-section .intro-image {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
}

.intro-section .intro-image img {
    height: 82svh;
    width: auto;
    object-fit: contain;
    object-position: bottom right;
}

@media (width < 992px) {
    .intro-section .intro-image {
        justify-content: center;
        margin-top: var(--md);
    }
    
    .intro-section .intro-image img {
        max-height: 40rem;
    }
}

@media (width < 576px) {
    .intro-section .intro-image img {
        max-height: 30rem;
    }
}

.section img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.page-header .container {
    display: flex;
    align-items: center;
    justify-content: center; /* centra il nav */
    width: 100%;
}

.page-header .logo-wrap {
    display: none; /* nasconde il logo */
}

.page-header nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between; /* voci distribuite */
    width: 100%;
    margin-left: 0;
}

header nav a {
    padding: 1rem 0;
    font-size: 2.2rem;
    text-transform: uppercase ;
    font-weight: 500;
}
header nav a.active { color: var(--tertiary); }
.header .nav-home { display: none; }

@media (width < 1500px) {
    header nav a {
    font-size: 2rem;
}}

@media (width < 1200px) {
    .page-header nav {
        /* mantieni lo stesso comportamento mobile */
        overflow: hidden;
        flex-direction: column;
        align-items: start;
        justify-content: center;
        gap: 5% 0;
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100svh;
        z-index: 99;
        background-color: var(--primary);
        padding: 0 var(--gutter);
        opacity: 0 !important;
        visibility: hidden;
        transform: translateY(-100%);
        transition: transform 1s cubic-bezier(0.25, 1.05, 0.5, 1);
    }

    .page-header .container {
    display: flex;
    align-items: center;
    justify-content: end; /* centra il nav */
    width: 100%;
}
}

header .container{position: relative; padding: 0; display: flex; align-items: center; justify-content: space-between;}
header .logo-wrap{display: flex;}
header .logo{
    width: 22rem;
    height: 100%;
    display: flex;
}
header .logo img{max-width: 100%;}
.logo-mobile{display: none;}
@media(width < 768px){
    .logo-desktop{display: none;}
    .logo-mobile{display: block; height: 4.5rem; width: auto;}
}
header nav{flex: 1 0 0%; display: flex; align-items: center; justify-content: space-between; height:var(--md); }
header nav a{color: var(--secondary);}
.page-header .logo-wrap{width: 25%;}
@media(width > 991px){
    .header .logo{position: absolute; left: 0; top: 0;}
    .header .logo, header .logo img{transform-origin: top left;}
}
@media(width < 992px){
    .header .logo-wrap{width: 25%;}
}
@media(width < 768px){
    .page-header .logo-wrap{display: flex; width: 100%;}
    header nav{background-color: hsl(var(--dark-grey)); overflow: hidden; flex-direction: column; align-items: start; justify-content: center; gap: 5% 0; position: fixed; left: 0; top: 0; width: 100vw; height: 100svh; z-index: 99; padding: 0 var(--gutter);}
    header nav a{display: block; font-size: 3rem; line-height: 1; opacity: 0; transform: translateY(100%); transition-property: transform, opacity;  transition-duration: 0s, 0.35s; transition-delay: 700ms, 0;}
    body.active header nav a{display: block; font-size: 2rem; line-height: 1; opacity: 1; transform: translateY(0); transition: all 700ms cubic-bezier(0.25, 1.05, 0.5, 1);  transition-delay: calc(0.7s);} 
    header .logo{position: relative; z-index: 999;}
    header nav{opacity: 0 !important; visibility: hidden; transform: translateY(-100%); transition: transform 1s cubic-bezier(0.25, 1.05, 0.5, 1);}
    body.active header nav{opacity: 1 !important; visibility: visible; transform: translateY(0%);}
    body.close header nav{opacity: 1 !important; visibility: visible; transform: translateY(-100%);}
}
.hero-section{height: 50svh; overflow: hidden; position: relative;}
.hero-section img{object-fit:cover; width: 100%; height: 100%;}
.scrollToBottom-link{font-size: var(--fs); color: white; position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; align-items: center; gap: 1rem; white-space: nowrap; line-height: 1; padding: .5rem 0; border-bottom: .2rem dotted white;}
@keyframes jumpInfinite{
    0% {
        transform: translateY(-5px);
    }
    50% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}
.down-arrow{animation: jumpInfinite 1.5s infinite;}

.section{padding: var(--xxl) 0;}

/* Spazio superiore per compensare l'header fixed sulla prima sezione visibile */
.hero-section,
.page-hero,
.primary-bg.intro-section{
    margin-top: var(--header-height);
}

/* Su mobile la home non ha bisogno dello spacing iniziale extra */
@media (width < 768px) {
    /* nascondi completamente la hero in home */
    .hero-section{
        display: none;
        margin-top: 0;
        height: 0;
    }

    /* compensa l'header fixed sulla prima section visibile */
    .intro-section{
        margin-top: var(--header-height);
        padding-bottom: 0;
    }

    /* titolo principale home piu piccolo */
    .intro-section h1{
        font-size: var(--h2);
        line-height: 1.1;
    }

    /* immagine di Sergio piu grande e agganciata al fondo sezione */
    .intro-section .grid-column:last-child{
        padding-bottom: 0;
    }

    .intro-section .intro-image{
        justify-content: center;
        align-items: flex-end;
        margin-top: var(--sm);
    }

    .intro-section .intro-image img{
        height: 55svh;
        max-height: none;
    }
}

/* Spaziatura verticale per titoli e blocchi testo */
.section h2,
.section h3{
    margin-top: var(--lg);
}
footer{padding: var(--xxl) 0 calc(var(--xxl) * 2)  0 ;}
article > :not(:last-child){margin-bottom: 3rem;}
article p{font-size: var(--h5);}

.intro-section{background-color: var(--secondary); color: var(--primary); padding: 0;}
.intro-section .grid-column{padding-block: var(--xxl); height: 100%;}
.intro-section .grid.two-column{grid-template-columns: 3fr 2fr; gap:0;}

.intro-section .image{height: 100%; width: 100%;}
.intro-section .image img{object-fit: contain; height: 100%; object-position: bottom;}
.intro-section article{max-width: 90%;}


@media (width < 1200px) {
.intro-section .grid.two-column{grid-template-columns: 1fr; gap:0;}
.intro-section article{max-width: 100%;}
}

/* Adattamenti specifici per pagina "Chi sono" su mobile */
@media (width < 768px) {
    .intro-section.primary-bg .big-title{
        font-size: var(--h2);
        line-height: 1.1;
        text-align: left;
    }

    .intro-section.primary-bg .grid-column:first-child{
        text-align: left;
    }

    .intro-section.primary-bg .circle-frame--lg{
        width: 32rem;
        height: 32rem;
    }
}

@media (width < 576px) {
    .intro-section.primary-bg .circle-frame--lg{
        width: 28rem;
        height: 28rem;
    }
}

.grid.three-column{margin-top: var(--lg);}
.grid-item {
    background-color: var(--primary);
    color: var(--secondary);
    padding: var(--xs);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.grid-image {
    width: 120px;
    min-width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0;
}

.grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

/* Layout mobile/mid per le card "A chi" e tecniche */
@media (width < 992px) {
    .grid.three-column{
        grid-template-columns: repeat(2, minmax(0,1fr));
        row-gap: var(--md);
        column-gap: var(--md);
    }
}

@media (width < 768px) {
    .grid.three-column{
        grid-template-columns: 1fr;
    }

    .grid-item{
        align-items: flex-start;
    }

    .section{
        padding: var(--xl) 0;
    }

    .page-hero{
        min-height: 50vh;
        padding: var(--xl) 0 var(--lg);
    }
}

.icon-list{
    display: flex;
    justify-content:  end;
    gap: var(--sm);
}

@media (width < 992px) {
    .icon-list{
    display: flex;
    justify-content:  start;
}
}

/* ==================== */
/* COMPONENTI RIUTILIZZABILI */
/* ==================== */

/* Utility */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Circle Frame - Immagine circolare con bordo */
.circle-frame {
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.circle-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* Varianti dimensioni */
.circle-frame--sm {
    width: 12rem;
    height: 12rem;
}

.circle-frame--md {
    width: 25rem;
    height: 25rem;
}

.circle-frame--lg {
    width: 50rem;
    height: 50rem;
    border-width: 1.2rem;
}

.circle-frame--xl {
    width: 50rem;
    height: 50rem;
    border-width: 1.5rem;
}

/* Varianti colore bordo */
.circle-frame--primary {
    border-color: var(--primary);
}

.circle-frame--tertiary {
    border-color: var(--tertiary);
}

@media (width < 992px) {
    .circle-frame--lg {
        width: 30rem;
        height: 30rem;
    }
    .circle-frame--xl {
        width: 35rem;
        height: 35rem;
    }
}

@media (width < 576px) {
    .circle-frame--lg,
    .circle-frame--xl {
        width: 25rem;
        height: 25rem;
        border-width: 0.8rem;
    }
}

 
.image-rounded img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image Stack - Due immagini sovrapposte */
.image-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sm);
}

.image-stack__main {
    grid-column: span 2;
}

.image-stack__small {
    grid-column: span 1;
}

/* Variante: immagine piccola a destra */
.image-stack--right .image-stack__small {
    grid-column: 2;
}

@media (width < 576px) {
    .image-stack {
        grid-template-columns: 1fr;
    }
    .image-stack__main,
    .image-stack__small {
        grid-column: span 1;
    }
}

@media (width < 992px) {
    .intro-section.primary-bg .grid.two-column {
        grid-template-columns: 1fr;
    }
    
    .intro-section.primary-bg .grid-column:last-child {
        order: -1;
        margin-bottom: var(--md);
    }
}


.page-hero {
    padding: var(--xxl) 0;
}

.page-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: center;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgb(var(--primary-rgb) / 0.6);
  z-index: 1;
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

img.img-tech{
    width: 100%;
    height: 30rem;
    object-fit: cover;
    object-position: center;
}


.page-hero__title {
    font-size: var(--h1);
    font-weight: 850;
    line-height: 1.1;
}

.page-hero__title .font-light {
    font-weight: 300;
}

@media (width < 768px) {
    .page-hero__title {
        font-size: var(--h2);
    }
}


.font-light {
    font-weight: 300;
}

.font-regular {
    font-weight: 400;
}

.font-bold {
    font-weight: 700;
}

.font-heavy {
    font-weight: 850;
}


.two-column--sticky {
    align-items: start;
}

.sticky-images {
    position: sticky;
    top: var(--md);
    display: flex;
    flex-direction: column;
    gap: var(--sm);
}

@media (width < 992px) {
    .sticky-images {
        position: static;
        flex-direction: row;
    }
    
    .sticky-images figure {
        flex: 1;
    }
}

@media (width < 576px) {
    .sticky-images {
        flex-direction: column;
    }
}

.article-long p {
    font-size: var(--h5);
    line-height: 1.7;
    margin-bottom: var(--sm);
}

.article-long p:last-child {
    margin-bottom: 0;
}

.article-long h4 {
    margin-top: var(--lg);
    margin-bottom: var(--xs);
}


.image-rounded {
    border-radius: var(--xs);
    overflow: hidden;
}

.image-rounded img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.link-arrow {
    color: var(--tertiary);
    font-size: var(--fs-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.link-arrow::after {
    content: "→";
    transition: transform 0.2s ease;
}

.link-arrow:hover::after {
    transform: translateX(5px);
}

.page-header nav a.active {
    color: var(--tertiary);
}