/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size:62.5%;
}

body {
    font-family: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
    background-color: #fff;
    color: #333;
    line-height: 1.6;
    padding-top: 6rem; /* Spazio per l'header fisso */
    padding-bottom: 40rem; /* Spazio per l'footer fisso */
}

/* Immagini */
img {
    max-width: 100%;
    height: auto;
}

strong {
    font-weight:900;
}

a {
    color: #d01e2f;
    text-decoration: none;
}

/* Container principale */
.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    font-size: 1.6rem;
}
.copyright {
    font-size: 1.2rem;
    color: #eeeeee;
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    margin: 0;
    padding: 0;
}
.logo {
    background-color: #d01e2f;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 1rem;
    display: flex;
    justify-content: start;
    align-items: center;
}
.logo img {
    height: 4rem;
}
.footer {
    background-color: #d01e2f;
    width: 100%;
    padding: 1rem;
    font-size: 2rem;
    color: #fff;
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: end;
    align-items: center;
}
.footer img {
    height: 4rem;
}
/* Tipografia */
h2 {
    font-size: 4.5vh;
    font-weight: 400;
    margin: 2rem 0;
    margin-top: 5rem;
    color: #222;
    color: #d01e2f;
    line-height: 1.2;
}

p {
    padding: 0;
    margin: 0;
    margin-bottom: 1.5rem;
    font-size: 3.5vh;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 2rem 0;
    padding: 0;
    width: 100%;
}

.gallery-item {
    position: relative;
      width: 100%;
      aspect-ratio: 1 / 1; /* Mantiene il contenitore quadrato */
      overflow: hidden;
}

.gallery-item img {
    width: 100%;
  height: 100%;
  object-fit: cover; /* Ritaglia per riempire l’area senza distorsioni */
  display: block;
}

/* Immagine full-width con effetto parallax */
.full-width-image {
    width: 100%;
    height: calc(100vh - 12rem);
    overflow: hidden;
    position: relative;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Background specifici per ogni immagine */
.full-width-image:first-of-type {
    background-image: url('img/davide_gai.jpeg');
}

.full-width-image.copy_image {
    background-image: url('img/green.jpg');
}


/* Animazioni con CSS Scroll-driven Animations */
@keyframes fade-slide-up {
    from { 
        opacity: 0; 
        transform: translateY(10rem);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}
@keyframes bg-zoom-rotate {
  from {
    transform: translateY(40px);
    background-size: 50%;
  }
  to {
    transform: translateY(0);
    background-size: 100%;
  }
}

/* Elementi che si rivelano durante lo scroll */
.reveal {
    opacity: 0;
    animation: fade-slide-up 800ms ease-out both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
    text-wrap: balance;
}
.margine_alto {
    min-height: calc(100vh - 12rem);
    display: flex;
    justify-content: center;
    align-items: center;
}
/* Stagger naturale per gli elementi */
.reveal:nth-child(1) { animation-delay: 0ms; }
.reveal:nth-child(2) { animation-delay: 100ms; }
.reveal:nth-child(3) { animation-delay: 200ms; }
.reveal:nth-child(4) { animation-delay: 300ms; }
.reveal:nth-child(5) { animation-delay: 400ms; }


/* Accessibilità - Disabilita animazioni se l'utente lo preferisce */
@media (prefers-reduced-motion: reduce) {
    .reveal { 
        animation: none; 
        opacity: 1; 
        transform: none; 
    }
}

/* Fallback per browser che non supportano scroll-driven animations */
@supports not (animation-timeline: view()) {
    .reveal {
        opacity: 1;
        animation: none;
    }
}

/* Focus states per accessibilità */
.reveal:focus {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

/* Ottimizzazioni per l'effetto parallax */
.full-width-image {
    transform: translateZ(0); /* Attiva l'accelerazione hardware */
    backface-visibility: hidden;
    will-change: transform, background-size;

  /* Scroll-driven animation */
  animation: bg-zoom-rotate 1000ms ease-out both;
  animation-timeline: view();
  animation-range: entry 0% cover 40%;
}

form { margin-top: -3rem; }

.input {
	position: relative;
	z-index: 1;
	display: inline-block;
    margin-top:5rem;
	max-width: 80%;
	width: calc(100% - 2em);
	vertical-align: top;
}

.input__field {
    font-size: 16px;
	position: relative;
	display: block;
	/*float: right;*/
	padding: 1.6rem;
	width: 60%;
	border: none;
	border-radius: 0;
	background: #f0f0f0;
	color: #333;
	font-weight: 400;
	font-family: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-appearance: none; /* for box shadows to show on iOS */
}

.input__field:focus {
	outline: none;
}

.input__label {
	display: inline-block;
	float: right;
	padding: 0 1em;
	width: 40%;
	color: #333;
	font-weight: bold;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.input__label-content {
	position: relative;
	display: block;
	padding: 1.6em 0;
	width: 100%;
}

/* Individual styles */

/* Yoshiko */
.input__field--yoshiko {
	width: 100%;
	background-color: #d0d1d0;
	border: 2px solid transparent;
	-webkit-transition: background-color 0.25s, border-color 0.25s;
	transition: background-color 0.25s, border-color 0.25s;
}

.input__label--yoshiko {
	width: 100%;
	text-align: left;
	position: absolute;
	bottom: 100%;
	pointer-events: none;
	overflow: hidden;
	padding: 0 1.25em;
	-webkit-transform: translate3d(0, 3em, 0);
	transform: translate3d(0, 3em, 0);
	-webkit-transition: -webkit-transform 0.25s;
	transition: transform 0.25s ;
	-webkit-transition-timing-function: ease-in-out;
	transition-timing-function: ease-in-out;
}

.input__label-content--yoshiko {
	color: #8B8C8B;
	padding: 0.25em 0;
	-webkit-transition: -webkit-transform 0.25s;
	transition: transform 0.25s;
	-webkit-transition-timing-function: ease-in-out;
	transition-timing-function: ease-in-out;
}

.input__label-content--yoshiko::after {
	content: attr(data-content);
	position: absolute;
	font-weight: 800;
	bottom: 70%;
	left: 0;
	height: 100%;
	width: 100%;
	color: #d01e2f;
	padding: 0;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 1.4rem;
}

.input__field--yoshiko:focus + .input__label--yoshiko,
.input--filled .input__label--yoshiko {
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
}

.input__field--yoshiko:focus + .input__label--yoshiko .input__label-content--yoshiko,
.input--filled .input__label-content--yoshiko {
	-webkit-transform: translate3d(0, 100%, 0);
	transform: translate3d(0, 100%, 0);
}

.input__field--yoshiko:focus + .input__field--yoshiko,
.input--filled .input__field--yoshiko {
	background-color: transparent;
	border-color: #d01e2f;
}
.input_textarea {
    height:20rem
}

/* Common button styles */
.button {
	min-width: 150px;
	max-width: 250px;
	display: block;
	border: none;
	background: none;
	color: inherit;
	vertical-align: middle;
	position: relative;
	z-index: 1;
	-webkit-backface-visibility: hidden;
	-moz-osx-font-smoothing: grayscale;
    text-transform: uppercase;
    margin-top: 4rem;
    font-size: 1.8rem;
    letter-spacing: 5px;
    cursor: pointer;
}
.button:focus {
	outline: none;
}
.button > span {
	vertical-align: middle;
}

/* Nina */
.button--nina {
	padding: 0 2em;
	background: #666666;
	color: #fff;
	overflow: hidden;
	-webkit-transition: background-color 0.3s;
	transition: background-color 0.3s;
}
.button--nina.button--inverted {
	background: #fff;
	color: #d01e2f;
}
.button--nina > span {
	display: inline-block;
	padding: 1em 0;
	opacity: 0;
	color: #fff;
	-webkit-transform: translate3d(0, -10px, 0);
	transform: translate3d(0, -10px, 0);
	-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
	transition: transform 0.3s, opacity 0.3s;
	-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
	transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
}
.button--nina::before {
	content: attr(data-text);
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	padding: 1em 0;
	-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
	transition: transform 0.3s, opacity 0.3s;
	-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
	transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
}
.button--nina:hover {
	background-color: #d01e2f;
}
.button--nina:hover::before {
	opacity: 0;
	-webkit-transform: translate3d(0, 100%, 0);
	transform: translate3d(0, 100%, 0);
}
.button--nina:hover > span {
	opacity: 1;
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
}
.button--nina:hover > span:nth-child(1) {
	-webkit-transition-delay: 0.045s;
	transition-delay: 0.045s;
}
.button--nina:hover > span:nth-child(2) {
	-webkit-transition-delay: 0.09s;
	transition-delay: 0.09s;
}
.button--nina:hover > span:nth-child(3) {
	-webkit-transition-delay: 0.135s;
	transition-delay: 0.135s;
}
.button--nina:hover > span:nth-child(4) {
	-webkit-transition-delay: 0.18s;
	transition-delay: 0.18s;
}
.button--nina:hover > span:nth-child(5) {
	-webkit-transition-delay: 0.225s;
	transition-delay: 0.225s;
}
.button--nina:hover > span:nth-child(6) {
	-webkit-transition-delay: 0.27s;
	transition-delay: 0.27s;
}
.button--nina:hover > span:nth-child(7) {
	-webkit-transition-delay: 0.315s;
	transition-delay: 0.315s;
}
.button--nina:hover > span:nth-child(8) {
	-webkit-transition-delay: 0.36s;
	transition-delay: 0.36s;
}
.button--nina:hover > span:nth-child(9) {
	-webkit-transition-delay: 0.405s;
	transition-delay: 0.405s;
}

#form-feedback { margin-top: 6rem; padding: 3rem; font-size: 3.5vh;}
#form-feedback.success { background:#f0f0f0;  }
#form-feedback.error   { background:#ffebee; border:4px solid #d01e2f }
.input__field.has-error { border-color:#e53935; color:#ffffff; outline: none; }
.error-text { display:block; color:#e53935; font-size:1.4rem; margin-top:0.5rem; }



/* Mobile: 2 elementi per riga */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .full-width-image.copy_image {
        height: 50vh;
    }
    .input {
        max-width: 100%;
        width: 100%;
    }
}
