.az-events,
.az-event-single {
  --az-event-green: var(--color-primario, #117070);
  --az-event-accent: var(--color-verde-cuore, #6ebc7f);
  --az-event-soft: var(--color-sfondo-chiaro, #d3ead8);
  color: var(--color-paragrafi, #333334);
  font-family: var(--ff-paragrafi, "Lato", sans-serif);
  padding: clamp(2rem, 5vw, 5rem) 0;
}

body.post-type-archive-evento { overflow-x: hidden; }

.az-events {
  isolation: isolate;
  position: relative;
}

.az-events::before {
  background-color: #edf5f2;
  background-attachment: scroll, fixed;
  background-image:
    linear-gradient(rgba(244, 249, 247, .86), rgba(244, 249, 247, .94)),
    url("../images/eventi-sfondo-v1.webp");
  background-position: center, center;
  background-repeat: no-repeat;
  background-size: auto, cover;
  content: "";
  height: 100%;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 100vw;
  z-index: -1;
}

.az-events__header {
  margin: 0 auto clamp(2rem, 5vw, 4.5rem);
  max-width: 52rem;
  text-align: center;
}

.az-events__header h1,
.az-events__section-head h2,
.az-event-single h1,
.az-event-modal h2 {
  color: var(--color-titoli, #000);
  font-family: var(--ff-titoli, "Optima", serif);
  line-height: 1.08;
  margin: 0;
}

.az-events__header h1 {
  color: #117070;
  font-size: clamp(2rem, 3.5vw, 3rem);
}
.az-events__eyebrow {
  color: var(--az-event-green);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  margin: 0 0 .75rem;
  text-transform: uppercase;
}

.az-events__intro {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
  margin: 1.25rem auto 0;
  max-width: 46rem;
}

.az-events__calendar {
  background: #fff;
  border: 1px solid #dbe7e4;
  border-radius: 1.25rem;
  box-shadow: 0 1.25rem 3.5rem rgba(17, 112, 112, .1);
  min-height: 32rem;
  overflow: hidden;
  padding: clamp(.75rem, 2vw, 1.5rem);
}

.az-events__calendar.fc {
  --fc-border-color: #dfe8e5;
  --fc-button-bg-color: var(--az-event-green);
  --fc-button-border-color: var(--az-event-green);
  --fc-button-hover-bg-color: #0b5c5c;
  --fc-button-hover-border-color: #0b5c5c;
  --fc-button-active-bg-color: #084d4d;
  --fc-button-active-border-color: #084d4d;
  --fc-today-bg-color: rgba(110, 188, 127, .12);
  font-family: var(--ff-paragrafi, "Lato", sans-serif);
}

.az-events__calendar.fc .fc-toolbar { gap: .75rem; }
.az-events__calendar.fc .fc-toolbar-title {
  color: #000;
  font-family: var(--ff-titoli, "Optima", serif);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.az-events__calendar.fc .fc-button {
  align-items: center;
  border-radius: .65rem;
  box-shadow: none;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 2.75rem;
  padding: .6rem 1rem;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.az-events__calendar.fc .fc-button-primary {
  background: #fff;
  border-color: rgba(17, 112, 112, .45);
  color: var(--az-event-green);
}

.az-events__calendar.fc .fc-button-primary:hover,
.az-events__calendar.fc .fc-button-primary:focus-visible {
  background: #e9f5ed;
  border-color: var(--az-event-green);
  color: #0b5c5c;
}

.az-events__calendar.fc .fc-button-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(110, 188, 127, .38);
  outline: 0;
  position: relative;
  z-index: 2;
}

.az-events__calendar.fc .fc-button-primary:not(:disabled).fc-button-active,
.az-events__calendar.fc .fc-button-primary:not(:disabled):active {
  background: var(--az-event-green);
  border-color: var(--az-event-green);
  color: #fff;
}

.az-events__calendar.fc .fc-prev-button,
.az-events__calendar.fc .fc-next-button {
  background: var(--az-event-green);
  border-color: var(--az-event-green);
  color: #fff;
  min-width: 3rem;
}

.az-events__calendar.fc .fc-prev-button:hover,
.az-events__calendar.fc .fc-next-button:hover,
.az-events__calendar.fc .fc-prev-button:focus-visible,
.az-events__calendar.fc .fc-next-button:focus-visible {
  background: #0b5c5c;
  border-color: #0b5c5c;
  color: #fff;
}

.az-events__calendar.fc .fc-today-button {
  background: var(--az-event-soft);
  border-color: transparent;
  color: #0b5c5c;
}

.az-events__calendar.fc .fc-today-button:disabled {
  background: #edf3f1;
  border-color: transparent;
  color: #697673;
  opacity: 1;
}

.az-events__calendar.fc .fc-button-group {
  border-radius: .65rem;
  box-shadow: 0 .25rem .8rem rgba(17, 112, 112, .12);
}

.az-events__calendar .fc-col-header-cell-cushion,
.az-events__calendar .fc-daygrid-day-number {
  color: var(--az-event-green);
  text-decoration: none;
}

.az-events__calendar .fc-daygrid-day-frame { min-height: 8.5rem; }
.az-events__calendar .fc-daygrid-event {
  background: transparent;
  border: 0;
  border-radius: .6rem;
  cursor: pointer;
  margin: 2px 4px;
  overflow: hidden;
  padding: 0;
}

.az-events__calendar .fc-daygrid-event:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--az-event-accent);
  outline: 0;
}

.az-calendar-event {
  aspect-ratio: 4 / 5;
  background: var(--az-event-soft);
  display: block;
  max-height: 7.5rem;
  overflow: hidden;
  width: 100%;
}

.az-calendar-event img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
  width: 100%;
}

.fc-event:hover .az-calendar-event img { transform: scale(1.04); }
.az-calendar-event__placeholder {
  align-items: center;
  color: var(--az-event-green);
  display: flex;
  font-size: .75rem;
  font-weight: 700;
  height: 100%;
  line-height: 1.25;
  padding: .5rem;
  text-align: center;
  white-space: normal;
}

.az-calendar-list-event {
  align-items: center;
  color: #333334;
  display: flex;
  gap: 1rem;
  white-space: normal;
}

.az-calendar-list-event img {
  aspect-ratio: 4 / 5;
  border-radius: .65rem;
  object-fit: cover;
  width: 4.5rem;
}

.az-calendar-list-event__copy { display: grid; gap: .25rem; }
.az-calendar-list-event__copy strong {
  color: #000;
  font-family: var(--ff-titoli, "Optima", serif);
  font-size: 1.1rem;
}

.az-events__upcoming,
.az-events__past { margin-top: clamp(4rem, 8vw, 7rem); }
.az-events__section-head { margin-bottom: 1.75rem; }
.az-events__section-head h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
.az-events__cards {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.az-event-card {
  background: #fff;
  border: 1px solid #dfe8e5;
  border-radius: 1rem;
  box-shadow: 0 .8rem 2rem rgba(17, 112, 112, .08);
  overflow: hidden;
}

.az-event-card__series {
  background: var(--az-event-green);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0;
  padding: .55rem 1rem;
  text-transform: uppercase;
}

.az-event-card__open {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: block;
  padding: 0;
  width: 100%;
}

.az-event-card__open img {
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  width: 100%;
}

.az-event-card__body { padding: 1.25rem; }
.az-event-card__date {
  color: var(--az-event-green);
  font-size: .82rem;
  font-weight: 700;
  margin: 0 0 .55rem;
}

.az-event-card h3 {
  font-family: var(--ff-titoli, "Optima", serif);
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 .6rem;
}

.az-event-card__link {
  background: transparent;
  border: 0;
  color: var(--az-event-green);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  margin-top: .5rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.az-events__empty {
  background: var(--az-event-soft);
  border-radius: .8rem;
  margin: 3rem 0 0;
  padding: 1.25rem;
  text-align: center;
}

.az-event-modal {
  background: #fff;
  border: 0;
  border-radius: 1.25rem;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .28);
  max-height: min(86vh, 48rem);
  max-height: min(86dvh, 48rem);
  max-width: min(60rem, calc(100vw - 2rem));
  overflow: auto;
  padding: 0;
  width: calc(100% - 2rem);
}

.az-event-modal::backdrop {
  backdrop-filter: blur(4px);
  background: rgba(4, 30, 30, .72);
}

.az-event-modal__layout {
  display: grid;
  grid-template-columns: minmax(20rem, 1.15fr) minmax(16rem, .85fr);
  min-height: 30rem;
}

.az-event-modal__media {
  align-self: center;
  aspect-ratio: 4 / 5;
  background: var(--az-event-soft);
  display: grid;
  margin: 0;
  min-height: 0;
  order: 2;
  overflow: hidden;
  place-items: center;
}
.az-event-modal__media img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.az-event-modal__content {
  align-self: center;
  order: 1;
  padding: clamp(1.75rem, 4vw, 3.25rem);
}

.az-event-modal__content h2 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  margin-bottom: 1rem;
}

.az-event-modal__series,
.az-event-single__series {
  color: var(--az-event-green);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 .55rem;
  text-transform: uppercase;
}

.az-event-modal__facts,
.az-event-single__facts {
  display: grid;
  gap: .65rem;
  margin: 1.2rem 0 0;
}

.az-event-modal__facts div,
.az-event-single__facts div { display: grid; gap: .15rem; }
.az-event-modal__facts dt,
.az-event-single__facts dt {
  color: var(--az-event-green);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.az-event-modal__facts dd,
.az-event-single__facts dd { margin: 0; }

.az-event-modal__status {
  color: var(--az-event-green);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.az-event-modal[data-event-status="cancelled"] .az-event-modal__status {
  color: var(--color-errore, #b21e1c);
}

.az-event-modal__date,
.az-event-modal__location { font-weight: 700; margin: .4rem 0; }
.az-event-modal__description {
  font-size: 1.05rem;
  line-height: 1.65;
  margin-top: 1.4rem;
  white-space: pre-line;
}

dialog.az-event-modal a.az-event-modal__button {
  align-items: center;
  background: var(--az-event-green);
  border-radius: .45rem;
  color: #fff !important;
  display: inline-flex;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  justify-content: center;
  line-height: 1.25;
  margin-top: 1.5rem;
  min-height: 3rem;
  padding: .8rem 1.25rem;
  text-align: center;
  text-decoration: none;
  -webkit-text-fill-color: #fff;
}

dialog.az-event-modal a.az-event-modal__button:hover,
dialog.az-event-modal a.az-event-modal__button:focus-visible {
  background: #0b5c5c;
  color: #fff !important;
}
.az-event-modal__close {
  align-items: center;
  appearance: none;
  background: var(--az-event-green, #117070);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .28);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 1.8rem;
  height: 2.75rem;
  justify-content: center;
  line-height: 1;
  opacity: 1;
  padding: 0 0 .15rem;
  position: absolute;
  right: 1rem;
  top: 1rem;
  visibility: visible;
  width: 2.75rem;
  z-index: 2;
}

.az-event-modal__close span {
  color: inherit;
  display: block;
  opacity: 1;
}

.az-event-modal__close:hover,
.az-event-modal__close:focus-visible {
  background: #0b5c5c;
  color: #fff;
  opacity: 1;
}

.az-event-modal__close:focus-visible {
  outline: 3px solid var(--az-event-accent, #6ebc7f);
  outline-offset: 3px;
}

@media (min-width: 48rem) and (max-height: 53rem) {
  .az-event-modal { max-height: calc(100vh - 3rem); max-height: calc(100dvh - 3rem); max-width: min(54rem, calc(100vw - 3rem)); }
  .az-event-modal__layout { min-height: 26rem; }
  .az-event-modal__content { padding: 1.75rem 2.25rem; }
  .az-event-modal__content h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
  .az-event-modal__description { font-size: 1rem; line-height: 1.5; margin-top: 1rem; }
  .az-event-modal__button { margin-top: 1rem; }
}

body.az-event-modal-open { overflow: hidden; }
.az-event-single__back {
  color: var(--az-event-green);
  display: inline-block;
  font-weight: 700;
  margin-bottom: 2rem;
}

.az-event-single__header {
  align-items: center;
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: 1.1fr .9fr;
}

.az-event-single h1 {
  color: #117070;
  font-size: clamp(2rem, 3.5vw, 3rem);
}
.az-event-single__date,
.az-event-single__location { font-weight: 700; }
.az-event-single__summary { font-size: 1.2rem; line-height: 1.65; }
.az-event-single__media { margin: 0; }
.az-event-single__media img {
  aspect-ratio: 4 / 5;
  border-radius: 1rem;
  object-fit: cover;
  width: 100%;
}

.az-event-single__content {
  font-size: 1.08rem;
  line-height: 1.75;
  margin: clamp(3rem, 7vw, 6rem) auto 0;
  max-width: 48rem;
}

@media (max-width: 64rem) {
  .az-events__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 47.99rem) {
  .az-events, .az-event-single { padding-top: 2.25rem; }
  .az-events::before {
    background-attachment: scroll;
    background-position: center, 58% top;
    background-size: auto, auto 100vh;
  }
  .az-events__calendar { border-radius: .8rem; min-height: 24rem; padding: .5rem; }
  .az-events__calendar.fc .fc-toolbar { align-items: stretch; flex-direction: column; }
  .az-events__calendar.fc .fc-toolbar-chunk { display: flex; justify-content: center; }
  .az-events__calendar .fc-list-day-cushion,
  .az-events__calendar .fc-list-table td { padding: .75rem; }
  .az-events__cards { grid-template-columns: 1fr; }
  .az-event-modal { max-height: calc(100vh - 1rem); max-width: calc(100vw - 1rem); }
  .az-event-modal__layout,
  .az-event-single__header { grid-template-columns: 1fr; }
  .az-event-modal__media { max-height: 52vh; order: 1; width: 100%; }
  .az-event-modal__media img { max-height: 52vh; }
  .az-event-modal__content { order: 2; }
  .az-event-modal__content { padding: 2rem 1.25rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .az-calendar-event img { transition: none; }
}
