@import url('palette.css');

:root {
  --border: #dee2e6;
  --bg-light: #f8f9fa;
  --text: #212529;
  --muted: #6c757d;
  --radius: 14px;
}

.calendario {
  display: flex;
  gap: 1.5rem;
}

.pannelloCalendario,
.pannelloEventi {
  background: var(--color-bianco);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Calendario */
.pannelloCalendario {
  width: 65%;
}

.headerCalendario {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.headerCalendario h2 {
  margin: 0;
  font-weight: 600;
}

.headerCalendario button {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--primary-color);
}

/* giorniSettimana */
.giorniSettimana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
}

/* giorni */
.giorni {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day {
  height: 70px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  cursor: pointer;
}

.day:hover {
  background: color-mix(in srgb, var(--primary-color), white 70%);
}

.day.today {
  border: 2px solid var(--primary-color);
}

.day.active {
  background: var(--primary-color);
  color: var(--color-bianco);
}

.day.muted {
  opacity: 0.4;
  cursor: default;
}

/* Eventi */
.pannelloEventi {
  width: 35%;
}

.headerEventi h1 {
  margin: 0;
  font-size: 1.8rem;
}

.headersEventi p {
  color: var(--muted);
}

.listaEventi {
  margin-top: 1rem;
  max-height: 520px;
  overflow-y: auto;
}

.event {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  background: var(--bg-light);
}

.event strong {
  display: block;
}

.event small {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 992px) {
  .calendario {
    flex-direction: column;
  }

  .pannelloCalendario,
  .pannelloEventi {
    width: 100%;
  }
}

@media (max-width: 768px) {

  .calendario {
    gap: 1rem;
    padding: 0 0.5rem;
  }

  /* Calendario */
  .pannelloCalendario {
    padding: 1rem;
  }

  .headerCalendario h2 {
    font-size: 1.2rem;
  }

  .headerCalendario button {
    font-size: 1.3rem;
  }

  /* giorniSettimana */
  .giorniSettimana span {
    font-size: 0.7rem;
  }

  /* Giorni */
  .giorni {
    gap: 0.35rem;
  }

  .day {
    height: 48px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .day.today {
    border-width: 1.5px;
  }

  /* Eventi */
  .pannelloEventi {
    padding: 1rem;
  }

  .headersEventi h1 {
    font-size: 1.3rem;
  }

  .headersEventi p {
    font-size: 0.85rem;
  }

  .listaEventi {
    max-height: 240px;
  }

  .event {
    padding: 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {

  .day {
    height: 42px;
    font-size: 0.75rem;
  }

  .headerCalendario h2 {
    font-size: 1.05rem;
  }

  .headersEventi h1 {
    font-size: 1.15rem;
  }
}