/*
 * Alessio Salati Rally Driver - 2026 Modern Design
 */

/* CSS Variables - Light Theme (Ogier Style) */
:root {
  --primary: #FFCC00;
  --primary-hover: #FFB800;
  --bg-light: #FAFAFA;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --gradient-primary: linear-gradient(135deg, #FFCC00 0%, #FFB800 100%);
}

/* Base Reset & Smooth Scrolling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  font-weight: 400;
  padding-top: 0;
}

/* Racing Pattern Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 50px,
      rgba(0, 0, 0, 0.008) 50px,
      rgba(0, 0, 0, 0.008) 51px
    );
  z-index: 0;
  pointer-events: none;
}

/* Navbar - Split Design with Diagonal Cut */
.navbar {
  backdrop-filter: blur(20px) saturate(180%);
  background: linear-gradient(105deg, #ffffff 0%, #ffffff 45%, #1a1a1a 45.1%, #1a1a1a 100%) !important;
  border-bottom: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(105deg, var(--border-subtle) 0%, var(--border-subtle) 45%, rgba(255,255,255,0.1) 45.1%, rgba(255,255,255,0.1) 100%);
}

.navbar.scrolled {
  background: linear-gradient(105deg, #ffffff 0%, #ffffff 45%, #1a1a1a 45.1%, #1a1a1a 100%) !important;
  box-shadow: var(--shadow-md);
}

.brand {
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.brand span {
  background: black;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand img {
  transition: all 0.3s ease;
}

.brand:hover {
  transform: translateX(5px);
}

.brand:hover img {
  transform: rotate(-5deg) scale(1.05);
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.navbar-nav .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link:hover::before {
  width: 60%;
}

.navbar-nav .nav-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link.active::before {
  width: 60%;
}

/* Social Icons - Clean Style */
.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* Hero Section - Full Screen Impact */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Fix per iPhone - supporto per dvh (dynamic viewport height) */
@supports (height: 100dvh) {
  .hero {
    height: 100dvh;
  }
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8) contrast(1.1);
  animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.hero-background::after {
  content: '';
  position: absolute; 
  top: 0;
  left: 0; 
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.3) 100%);
  mix-blend-mode: normal;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 100px;
}

/* Typography - Clean & Modern */
.hero-eyebrow {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--gradient-primary);
  color: var(--text-primary);
  font-weight: 700; 
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 50px;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800; 
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: #ffffff;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-title .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  margin-bottom: 3rem;
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* Buttons - Clean Design */
.btn-primary-modern {
  padding: 1rem 2.5rem;
  background: var(--text-primary);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.btn-primary-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
  background: #000000;
}

.btn-secondary-modern {
  padding: 1rem 2.5rem;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--border-subtle);
  border-radius: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.8s ease-out 0.7s backwards;
}

.btn-secondary-modern:hover {
  border-color: var(--text-primary);
  background: var(--text-primary);
  transform: translateY(-2px);
  color: white;
  box-shadow: var(--shadow-md);
}

/* Stats Section - Clean Cards */
.stats-section {
  position: relative; 
  z-index: 2;
  margin-top: -100px;
  padding: 0 1rem;
  animation: fadeInUp 1s ease-out 0.8s backwards;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 204, 0, 0.03) 50%, transparent 100%);
  transform: translateY(-50%) skewY(-2deg);
  z-index: -1;
  pointer-events: none;
}

.stats-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Content Sections */
.section {
  padding: 8rem 0;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.section-title::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 4rem;
  max-width: 600px;
}

/* Video Card - Clean Design */
.video-card-modern {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.video-card-modern:hover {
  transform: translateY(-4px);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.video-card-modern .video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.video-card-modern .video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.video-card-modern:hover .video-thumbnail img {
  transform: scale(1.1);
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.video-card-modern:hover .video-play-button {
  transform: translate(-50%, -50%) scale(1.1);
  background: white;
}

.video-play-button::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 18px solid var(--text-primary);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}

.video-info {
  padding: 1.5rem;
}

.video-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.video-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Next Race Card */
.next-race-card {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s ease;
  box-shadow: var(--shadow-sm);
}

.next-race-card:hover {
  border-left-width: 6px;
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.next-race-label {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.next-race-name {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.next-race-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Sponsors Section */
.sponsors-section {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.sponsors-title {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

.sponsor-logo {
  width: 100%;
  max-width: 300px;
  height: auto;
  filter: grayscale(0);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.sponsor-logo:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.03);
}

/* Responsive Partner Logos */
@media (max-width: 768px) {
  .sponsor-logo {
    max-width: 180px;
  }
}

@media (max-width: 480px) {
  .sponsor-logo {
    max-width: 140px;
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.scroll-indicator svg {
  width: 30px;
  height: 30px;
  opacity: 0.6;
}

/* Mobile Menu - Full Screen */
@media (max-width: 991px) {
  /* Navbar bianco su mobile */
  .navbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }
  
  .navbar::after {
    display: none !important;
  }
  
  .navbar.scrolled {
    background: #ffffff !important;
  }

  .navbar-collapse {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    background: #1a1a1a !important;
    z-index: 9999 !important;
    padding: 8rem 2rem 3rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
  }
  
  .navbar-collapse.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
  
  .navbar-collapse.collapsing {
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    height: auto !important;
  }
  
  .navbar-nav {
    flex-direction: column !important;
    align-items: center !important;
    gap: 2rem !important;
    width: 100% !important;
  }
  
  .navbar-nav .nav-link {
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    padding: 0 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    display: block !important;
    color: #ffffff !important;
  }
  
  .navbar-nav .nav-link:hover {
    transform: scale(1.05);
    color: var(--primary) !important;
  }
  
  .navbar-nav .nav-link.active {
    color: var(--primary) !important;
    position: relative;
  }
  
  .navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
  }
  
  .navbar-nav .nav-item {
    width: 100% !important;
    text-align: center !important;
  }
  
  .navbar-toggler {
    position: relative;
    z-index: 10000;
    border: 2px solid #000000 !important;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
  }
  
  .navbar-toggler:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    transition: all 0.3s ease;
  }
  
  /* X bianca quando il menu è aperto */
  .navbar-toggler[aria-expanded="true"] {
    border-color: #ffffff !important;
  }
  
  .navbar-toggler[aria-expanded="true"]:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M6 6l18 18M24 6L6 24'/%3e%3c/svg%3e") !important;
  }
  
  .social-link {
    width: 50px !important;
    height: 50px !important;
  }
  
  .social-link svg {
    width: 24px !important;
    height: 24px !important;
  }
  
  .navbar-nav .nav-item:last-child .d-flex {
    margin-top: 2rem !important;
    justify-content: center !important;
  }
}

/* Responsive Design */
@media (max-width: 991px) {
  .hero {
    height: 70vh;
    min-height: 500px;
  }
  
  .hero-content {
    padding-top: 80px;
  }
  
  .stats-section {
    margin-top: 3rem;
  }
  
  .section {
    padding: 5rem 0;
  }
}

@media (max-width: 768px) {
  .hero {
    height: 60vh;
    min-height: 400px;
  }
  
  /* Fix specifico per iPhone con dynamic viewport */
  @supports (height: 60dvh) {
    .hero {
      height: 60dvh;
    }
  }
  
  .brand {
    font-size: 1.1rem !important;
  }
  
  .brand span {
    font-size: 1.3rem;
  }
  
  .brand img {
    width: 38px !important;
    height: 38px !important;
  }
  
  .navbar-toggler {
    padding: 0.4rem 0.6rem !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .sponsors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* About section - padding ridotto su mobile */
  .glass-effect {
    padding: 1.5rem !important;
  }
  
  /* Footer - layout mobile */
  footer .d-flex.align-items-center {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  footer .brand {
    font-size: 1.2rem !important;
  }
  
  footer img {
    width: 40px !important;
    height: 40px !important;
  }
  
  /* Next Race - tutto centrato su mobile */
  .next-race-wrapper {
    flex-direction: column !important;
    text-align: center !important;
    padding: 2rem 0 !important;
  }
  
  .next-race-label,
  .next-race-button {
    width: 100%;
    justify-content: center !important;
  }
  
  .divider-vertical,
  .divider-vertical-small {
    display: none !important;
  }
  
  /* Partners - loghi più piccoli */
  #partners img {
    max-width: 200px !important;
  }
}

/* Footer - Clean */
footer {
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-primary);
}

/* Utility Classes */
.container-modern {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.glass-effect {
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.gradient-border {
  position: relative;
  border-radius: 16px;
  padding: 2px;
  background: var(--gradient-primary);
}

.gradient-border-inner {
  background: var(--bg-white);
  border-radius: 14px;
  padding: 2rem;
}

/* Rich Text Content Styling */
.news-content h1,
.news-content h2,
.news-content h3 {
  color: var(--text-primary);
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.news-content h1 {
  font-size: 2rem;
}

.news-content h2 {
  font-size: 1.75rem;
}

.news-content h3 {
  font-size: 1.5rem;
}

.news-content p {
  margin-bottom: 1.5rem;
}

.news-content strong,
.news-content b {
  color: var(--text-primary);
  font-weight: 700;
}

.news-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}

.news-content a:hover {
  border-bottom-color: var(--primary);
}

.news-content ul,
.news-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.news-content li {
  margin-bottom: 0.75rem;
}

.news-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.news-content pre {
  background: #f6f6f6;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.news-content code {
  background: #f6f6f6;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--text-primary);
}

/* ===========================
   GALLERY STYLES
   =========================== */

/* Gallery Card */
.gallery-card {
  display: block;
}

/* Carousel Container */
.gallery-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: none;
}

.carousel-slide.active {
  display: block;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Carousel Controls */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.gallery-carousel:hover .carousel-control {
  opacity: 1;
}

.carousel-control:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
  left: 10px;
}

.carousel-control.next {
  right: 10px;
}

/* Carousel Dots */
.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.carousel-dots .dot.active {
  background: white;
  width: 8px;
  height: 8px;
}

.carousel-dots .dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Gallery Info */
.gallery-info {
  padding: 1.5rem;
}

.gallery-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.gallery-location {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
}

.gallery-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.gallery-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.btn-view-gallery {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--text-primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-view-gallery:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Photos Grid (Show Page) */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}

@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
  }
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #f5f5f5;
}

.photo-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover .photo-thumbnail {
  transform: scale(1.05);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

.photo-overlay svg {
  width: 60px;
  height: 60px;
  padding: 16px;
  background: rgba(255, 204, 0, 0.95);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.4);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  color: #1a1a1a;
  stroke: #1a1a1a;
}

.photo-item:hover .photo-overlay svg {
  transform: scale(1.1);
  background: rgba(255, 204, 0, 1);
  box-shadow: 0 6px 30px rgba(255, 204, 0, 0.6);
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.back-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
  transform: translateX(-4px);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
  left: 30px;
}

.lightbox-nav.next {
  right: 30px;
}

@media (max-width: 768px) {
  .lightbox-nav {
    width: 50px;
    height: 50px;
  }
  
  .lightbox-nav.prev {
    left: 15px;
  }
  
  .lightbox-nav.next {
    right: 15px;
  }
  
  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

.lightbox-counter {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ========================================
   PROTEZIONE IMMAGINI
   ======================================== */

/* Disabilita selezione e drag su tutte le immagini */
img {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: auto; /* Mantieni click/hover normali */
  -webkit-touch-callout: none; /* Disabilita long-press su iOS */
}

/* Eccezione per le immagini nell'admin (vogliamo drag & drop funzionante) */
.admin-card img,
.photo-item-admin img {
  -webkit-user-drag: auto;
  -moz-user-drag: auto;
}
