/* Custom styles for Eurometal website */
:root {
  --navy: #1B263B;
}

body {
  font-family: 'Roboto', sans-serif;
}

h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
}

.text-navy {
  color: var(--navy);
}

.bg-navy {
  background-color: var(--navy);
}

/* Mobile Menu */
#mobile-menu.hidden {
  display: none;
}

/* Image Lazy Loading */
img[loading="lazy"] {
  filter: blur(4px);
  transition: filter 0.3s ease;
}

img[loading="lazy"]:not([src]) {
  filter: blur(4px);
}

img[loading="lazy"][src] {
  filter: none;
}

/* Zoom-In Animation for Hero Image */
.zoom-in {
  animation: zoomIn 8s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes zoomIn {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Ensure image stays within bounds */
section.relative.overflow-hidden {
  overflow: hidden;
}

/* Card Hover Effects */
.bg-white.shadow-lg {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bg-white.shadow-lg:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Image Gallery Hover Effect */
.overflow-hidden.rounded-lg {
  transition: transform 0.3s ease;
}

.overflow-hidden.rounded-lg img:hover {
  transform: scale(1.1);
}

/* Navigation Link Hover Effects */
nav a {
  transition: color 0.2s ease-in-out;
  position: relative; /* For positioning the emoji */
}

/* Umbrella and Wind Emoji Animation */
.skiasi-link {
  position: relative;
  display: inline-block;
}

.umbrella-emoji {
  position: absolute;
  top: -58.25px; /* Start position */
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  opacity: 0;
  animation: dropAndStop 3s ease forwards;
  pointer-events: none; /* Ensure emojis don’t block clicks */
}

.wind-emoji {
  position: absolute;
  top: -14px; /* Final position */
  left: -30px; /* Start left of the text */
  font-size: 16px;
  opacity: 0;
  animation: blowFromLeft 3s ease forwards;
  pointer-events: none; /* Ensure emojis don’t block clicks */
}

/* Retrigger animation class */
.retrigger-animation .umbrella-emoji {
  animation: none; /* Reset animation */
  animation: dropAndStop 3s ease forwards; /* Reapply animation */
}

.retrigger-animation .wind-emoji {
  animation: none; /* Reset animation */
  animation: blowFromLeft 3s ease forwards; /* Reapply animation */
}

@keyframes dropAndStop {
  0% {
    opacity: 0;
    top: -58.25px;
  }
  50% {
    opacity: 1;
    top: -14px; /* Final position */
  }
  100% {
    opacity: 1;
    top: -14px;
  }
}

@keyframes blowFromLeft {
  0% {
    opacity: 0;
    left: -30px;
  }
  50% {
    opacity: 1;
    left: -10px;
  }
  100% {
    opacity: 0;
    left: 20px; /* Move right and fade out */
  }
}

/* Responsive Adjustments for Emojis */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .zoom-in {
    animation-duration: 6s; /* Slightly faster on mobile */
  }

  .bg-white.shadow-lg:hover {
    transform: scale(1.03); /* Smaller scale on mobile */
  }

  .umbrella-emoji {
    font-size: 16px;
    top: -53.25px; /* Start position for mobile */
    animation: dropAndStop 3s ease forwards;
  }

  .wind-emoji {
    font-size: 14px;
    top: -14px; /* Final position for mobile */
    left: -25px;
    animation: blowFromLeft 3s ease forwards;
  }

  .retrigger-animation .umbrella-emoji {
    animation: none;
    animation: dropAndStop 3s ease forwards;
  }

  .retrigger-animation .wind-emoji {
    animation: none;
    animation: blowFromLeft 3s ease forwards;
  }

  @keyframes dropAndStop {
    0% {
      opacity: 0;
      top: -53.25px;
    }
    50% {
      opacity: 1;
      top: -14px;
    }
    100% {
      opacity: 1;
      top: -14px;
    }
  }

  @keyframes blowFromLeft {
    0% {
      opacity: 0;
      left: -25px;
    }
    50% {
      opacity: 1;
      left: -8px;
    }
    100% {
      opacity: 0;
      left: 15px;
    }
  }
}

/* Lightbox Styles */
#lightbox {
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

#lightbox.hidden {
  display: none;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#lightbox-close, #lightbox-prev, #lightbox-next, #lightbox-download {
  transition: background-color 0.3s ease, transform 0.3s ease;
  background: linear-gradient(to bottom, rgba(27, 38, 59, 0.9), rgba(27, 38, 59, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#lightbox-close:hover, #lightbox-prev:hover, #lightbox-next:hover, #lightbox-download:hover {
  background: linear-gradient(to bottom, rgba(29, 78, 216, 0.9), rgba(29, 78, 216, 0.7));
  transform: scale(1.05);
}

@media (max-width: 768px) {
  #lightbox-close, #lightbox-prev, #lightbox-next {
    width: 40px;
    height: 40px;
  }

  #lightbox-close svg, #lightbox-prev svg, #lightbox-next svg {
    width: 20px;
    height: 20px;
  }

  #lightbox-download {
    font-size: 14px;
    padding: 8px 12px;
  }

  #lightbox-img {
    max-height: 70vh;
  }
}