/* Custom styling & refinements for Granarolo Eventi & Notizie */

:root {
  --primary-green: #006837;
  --primary-hover: #00502a;
  --accent-gold: #f59e0b;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

/* Glassmorphism effects */
.glass-nav {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Card hover animation */
.event-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  .event-card:hover {
    transform: translateY(-4px);
  }
  .event-card:hover .event-card-img {
    transform: scale(1.04);
  }
}

.event-card-img {
  transition: transform 0.35s ease;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.4);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.7);
}

/* Modal styles & mobile scrolling */
.modal-content-scroll {
  max-height: calc(88vh - 80px);
  -webkit-overflow-scrolling: touch;
}

.modal-content-scroll img {
  border-radius: 0.75rem;
  margin: 1rem auto;
  max-width: 100%;
}

/* Active filter pill animation */
.filter-pill {
  transition: all 0.15s ease-in-out;
}

.filter-pill.active {
  background-color: #006837;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.25);
}

/* Line clamp helpers */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Pulse animation for 'Oggi' badge */
@keyframes softPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

.badge-pulse {
  animation: softPulse 2.5s infinite ease-in-out;
}

/* Lightbox Image Zoom Viewer */
#image-lightbox {
  touch-action: none;
}

.zoom-image-container {
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease-out;
}

.zoom-image-container.grabbing {
  cursor: grabbing;
}

/* Safe touch target size for mobile */
.touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* Animated Checkmark & Error Icons */
.checkmark-path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheckmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.15s;
}

@keyframes drawCheckmark {
  100% {
    stroke-dashoffset: 0;
  }
}

.error-x-path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawErrorX 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.15s;
}

@keyframes drawErrorX {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scaleInSpring {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.animate-spring-in {
  animation: scaleInSpring 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-shake {
  animation: shakeError 0.45s ease-in-out;
}

/* Saltellamento delicato per l'icona informazioni in basso a destra */
@keyframes bounceSoft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

.animate-bounce-info {
  animation: bounceSoft 2.2s infinite ease-in-out;
}

@keyframes pulseBubble {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.bubble-pulse {
  animation: pulseBubble 2.5s infinite ease-in-out;
}

/* Rimpicciolimento fumetto informazioni all'hover del mouse per non ostacolare la lettura */
.info-speech-bubble {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  transform-origin: right bottom;
}

.info-speech-bubble:hover {
  transform: scale(0.55) translateX(15px);
  opacity: 0.2;
}



