/* ==========================================================================
   CORTOTECA (cortoteca.html) — griglia delle opere
   ========================================================================== */

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--cdl-dark);
  color: var(--cdl-white);
  letter-spacing: -0.03em;
}

@media (min-width: 1024px) {
  body {
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 2rem !important;
  }
  .content-wrapper {
    max-width: 1100px;
  }
}

h1 {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
}

h2 {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
  color: white;
  transition: color 0.3s ease;
}

/* --------------------------------------------------------------------------
   Card di un'opera
   -------------------------------------------------------------------------- */
.movie-card {
  border-left: 10px solid var(--cdl-lavender);
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  display: block;
}

.movie-card:hover {
  border-color: var(--cdl-red) !important;
  border-left-color: var(--cdl-red) !important;
  transform: translateY(-4px);
  background-color: rgba(0, 0, 0, 0.85);
}

.img-still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: all 0.5s ease;
}

.movie-card:hover .img-still {
  opacity: 1;
  transform: scale(1.05);
}

/* Sfumatura che rende leggibile il testo sopra il fotogramma */
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  transition: opacity 0.3s ease;
}

/* Bollino CDL sulle opere prodotte dall'associazione */
.cdl-logo-badge {
  height: 10px;
  width: auto;
  opacity: 1;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .cdl-logo-badge {
    height: 14px;
  }
}

/* --------------------------------------------------------------------------
   Barra di ricerca
   -------------------------------------------------------------------------- */
.search-container {
  background-color: white;
  color: var(--cdl-dark);
  border: 2px solid var(--cdl-dark);
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

/* --------------------------------------------------------------------------
   Interruttore di ordinamento (per nome / per anno)
   -------------------------------------------------------------------------- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: 0.4s;
  border-radius: 24px;
  border: 1px solid white;
}

.slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--cdl-lavender);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--cdl-dark);
}

/* Barra di scorrimento su fondo scuro */
::-webkit-scrollbar-track { background: var(--cdl-dark); }
::-webkit-scrollbar-thumb { background: var(--cdl-lavender); }
