/* File: homepage.css */
*,
*::after,
*::before {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: black;
}

.contenuto {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.item {
  height: 476px;
  display: flex;
}

.contesto {
  color: whitesmoke;
  padding: 10px;
  flex: 1;
}

.contesto h1 + p {
  padding-top: 20px;
}

.item > img {
  height: 476px;
  width: auto;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

aside {
  height: fit-content;
  position: sticky;
  top: 5px;
}

nav {
  background-color: #33333351;
  color: white;
  padding: 10px;
  text-align: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0px;
  margin: 0 10px;
}

nav a:hover {
  background-color: #555;
}

.portalae {
  flex: 1;
  display: grid;
  grid-template-columns: [sito1] 30% [portale] 40% [sito2] 30%;
  align-items: center;
}

.myButton {
  box-shadow: inset 0px 1px 0px 0px #bee2f9;
  background: linear-gradient(to bottom, #63b8ee 5%, #468ccf 100%);
  background-color: #63b8ee;
  border-radius: 6px;
  border: 1px solid #3866a3;
  display: inline-block;
  cursor: pointer;
  color: #000000;
  font-size: 15px;
  font-weight: bold;
  padding: 6px 24px;
  text-decoration: none;
  text-shadow: 0px 1px 0px #7cacde;
}

.myButton:hover {
  background: linear-gradient(to bottom, #468ccf 5%, #63b8ee 100%);
  background-color: #468ccf;
}

.myButton:active {
  position: relative;
  top: 1px;
}

.container2 {
  display: flex;
  flex-direction: column;
}

.sito2 {
  height: 400px;
  padding: 20px;
}

.sito2 iframe {
  border-radius: 3vmin;
}

/* === OTTIMIZZAZIONI GIF PER PERFORMANCE === */

#badass-gif {
  /* Ottimizzazioni per performance */
  image-rendering: auto;
  will-change: auto;
  transform: translateZ(0); /* Force hardware acceleration */
}

/* Fallback per dispositivi lenti */
.low-performance #badass-gif {
  animation-play-state: paused;
  filter: blur(1px); /* Riduce il carico visivo */
}

/* Preload ottimizzato */
.gif-container {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
  padding: 20px;
  border-radius: 8px;
  color: white;
  font-family: Arial, sans-serif;
  z-index: 1;
}

.loaded .loading-placeholder {
  display: none;
}