
/* =========================================================
   HOME AGENDA V3 — guardrail sezione “Prossimi eventi”
   --------------------------------------------------------------------------
   Scopo:
   - rendere la lista eventi più solida con titoli lunghi;
   - mantenere card compatte e coerenti su desktop/mobile;
   - evitare spezzature brutte, frecce doppie o righe fuori misura.
   ========================================================= */

html body.path-frontpage .caritas-home-events-strip {
  margin-top: clamp(30px, 4vw, 48px) !important;
  margin-bottom: 0 !important;
}

html body.path-frontpage .caritas-home-events-strip__head {
  min-height: clamp(54px, 4.2vw, 60px) !important;
}

html body.path-frontpage .caritas-home-events-strip__title {
  max-width: 100% !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

html body.path-frontpage .caritas-home-events-strip__link {
  flex: 0 0 auto !important;
  gap: 4px !important;
}

html body.path-frontpage .caritas-home-events-strip__link::after,
html body.path-frontpage .caritas-featured-strip__link::after {
  content: none !important;
  display: none !important;
}

html body.path-frontpage .caritas-home-events-strip__link span,
html body.path-frontpage .caritas-featured-strip__link span {
  display: inline-flex !important;
  margin-left: 4px !important;
}

html body.path-frontpage #caritas-calendar-list.caritas-calendar-list,
html body.path-frontpage .caritas-home-events-strip #caritas-calendar-list {
  gap: 12px !important;
}

html body.path-frontpage .caritas-calendar-card {
  grid-template-columns: 90px minmax(0, 1fr) 6px !important;
  min-height: 90px !important;
  border-radius: 17px !important;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease !important;
}

html body.path-frontpage .caritas-calendar-card__date {
  width: 90px !important;
  min-width: 90px !important;
  min-height: 90px !important;
}

html body.path-frontpage .caritas-calendar-card__content {
  min-width: 0 !important;
  padding: 14px 20px 14px 18px !important;
}

html body.path-frontpage .caritas-calendar-card__title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  max-width: 100% !important;
  font-size: clamp(0.98rem, 1.16vw, 1.1rem) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  hyphens: none !important;
}

html body.path-frontpage .caritas-calendar-card__meta {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

html body.path-frontpage .caritas-calendar-card__decor {
  margin-top: 8px !important;
}

html body.path-frontpage .caritas-calendar-empty {
  margin: 0 !important;
  padding: 22px 24px !important;
  border: 1px solid rgba(123, 5, 0, 0.12) !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(123, 5, 0, 0.045), rgba(255, 255, 255, 0.98)) !important;
  color: #5f0300 !important;
  font-weight: 800 !important;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.055) !important;
}

@media (max-width: 760px) {
  html body.path-frontpage .caritas-home-events-strip {
    margin-top: 28px !important;
    margin-bottom: 0 !important;
  }

  html body.path-frontpage .caritas-home-events-strip__head {
    min-height: 54px !important;
    padding: 12px 12px 12px 18px !important;
    border-radius: 18px !important;
    gap: 10px !important;
  }

  html body.path-frontpage .caritas-home-events-strip__title {
    font-size: clamp(1.02rem, 4.2vw, 1.16rem) !important;
    white-space: nowrap !important;
  }

  html body.path-frontpage .caritas-home-events-strip__link {
    min-height: 34px !important;
    padding: 0 12px !important;
    font-size: 0.74rem !important;
    line-height: 1 !important;
  }

  html body.path-frontpage .caritas-calendar-card {
    grid-template-columns: 72px minmax(0, 1fr) 5px !important;
    min-height: 88px !important;
    border-radius: 16px !important;
  }

  html body.path-frontpage .caritas-calendar-card__date {
    width: 72px !important;
    min-width: 72px !important;
    min-height: 88px !important;
    padding: 8px 5px !important;
  }

  html body.path-frontpage .caritas-calendar-card__content {
    padding: 12px 12px 12px 14px !important;
  }

  html body.path-frontpage .caritas-calendar-date-big,
  html body.path-frontpage .caritas-calendar-card__day {
    font-size: 1.5rem !important;
    line-height: 0.95 !important;
  }

  html body.path-frontpage .caritas-calendar-date-small,
  html body.path-frontpage .caritas-calendar-card__month {
    font-size: 0.64rem !important;
  }

  html body.path-frontpage .caritas-calendar-date-time,
  html body.path-frontpage .caritas-calendar-date-big--time {
    font-size: 0.68rem !important;
  }

  html body.path-frontpage .caritas-calendar-card__title {
    font-size: 0.92rem !important;
    line-height: 1.18 !important;
  }

  html body.path-frontpage .caritas-calendar-card__meta {
    font-size: 0.78rem !important;
  }

  html body.path-frontpage .caritas-calendar-card__decor {
    margin-top: 7px !important;
    gap: 7px !important;
  }
}

@media (max-width: 420px) {
  html body.path-frontpage .caritas-home-events-strip__head {
    flex-wrap: nowrap !important;
  }

  html body.path-frontpage .caritas-calendar-card {
    grid-template-columns: 68px minmax(0, 1fr) 4px !important;
    min-height: 86px !important;
  }

  html body.path-frontpage .caritas-calendar-card__date {
    width: 68px !important;
    min-width: 68px !important;
    min-height: 86px !important;
  }

  html body.path-frontpage .caritas-calendar-card__content {
    padding-right: 10px !important;
  }
}

@media (max-width: 360px) {
  html body.path-frontpage .caritas-home-events-strip__link span {
    display: none !important;
  }

  html body.path-frontpage .caritas-calendar-card__decor {
    display: none !important;
  }
}

/* =========================================================
   HOME AGENDA V3B — spazio mobile tra eventi e numeri
   --------------------------------------------------------------------------
   Riduce solo su smartphone lo stacco dopo “Prossimi eventi”.
   Il problema era dato dalla somma tra:
   - padding-bottom della prima fascia;
   - padding-top della fascia “I numeri della Caritas”.
   ========================================================= */

@media (max-width: 760px) {
  html body.path-frontpage .caritas-public-band--primary-access {
    padding-bottom: 18px !important;
  }

  html body.path-frontpage .caritas-public-band--numbers {
    padding-top: 18px !important;
  }

  html body.path-frontpage .caritas-home-events-strip,
  html body.path-frontpage .caritas-events-panel {
    margin-bottom: 0 !important;
  }

  html body.path-frontpage .caritas-home-events-strip__body,
  html body.path-frontpage .caritas-events-panel__body,
  html body.path-frontpage #caritas-calendar-list.caritas-calendar-list,
  html body.path-frontpage .caritas-home-events-strip #caritas-calendar-list {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* =========================================================
   HOME AGENDA V3C — tassello data più leggibile
   --------------------------------------------------------------------------
   Obiettivo grafico:
   - prima riga: giorno settimana (Sab);
   - seconda riga: giorno + mese (22 Apr);
   - terza riga: orario (10:00);
   - colonna rossa leggermente più larga, soprattutto su desktop.
   ========================================================= */

html body.path-frontpage .caritas-calendar-card {
  grid-template-columns: 118px minmax(0, 1fr) 6px !important;
  min-height: 92px !important;
}

html body.path-frontpage .caritas-calendar-card__date {
  width: 118px !important;
  min-width: 118px !important;
  min-height: 92px !important;
  padding: 10px 8px !important;
  gap: 0 !important;
}

html body.path-frontpage .caritas-calendar-date-weekday {
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  margin: 0 0 3px !important;
  color: #ffffff !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

html body.path-frontpage .caritas-calendar-date-daymonth {
  position: relative !important;
  z-index: 1 !important;
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  white-space: nowrap !important;
}

html body.path-frontpage .caritas-calendar-date-big,
html body.path-frontpage .caritas-calendar-card__day {
  font-size: 1.95rem !important;
  line-height: 0.96 !important;
}

html body.path-frontpage .caritas-calendar-date-small,
html body.path-frontpage .caritas-calendar-card__month {
  font-size: 0.75rem !important;
  line-height: 1 !important;
  letter-spacing: 0.06em !important;
}

html body.path-frontpage .caritas-calendar-date-face--time::before,
html body.path-frontpage .caritas-calendar-date-divider {
  width: 36px !important;
  margin: 6px 0 5px !important;
}

html body.path-frontpage .caritas-calendar-date-time,
html body.path-frontpage .caritas-calendar-date-big--time {
  font-size: 0.82rem !important;
  line-height: 1 !important;
}

@media (max-width: 760px) {
  html body.path-frontpage .caritas-calendar-card {
    grid-template-columns: 88px minmax(0, 1fr) 5px !important;
    min-height: 92px !important;
  }

  html body.path-frontpage .caritas-calendar-card__date {
    width: 88px !important;
    min-width: 88px !important;
    min-height: 92px !important;
    padding: 8px 5px !important;
  }

  html body.path-frontpage .caritas-calendar-date-weekday {
    font-size: 0.63rem !important;
    margin-bottom: 3px !important;
  }

  html body.path-frontpage .caritas-calendar-date-daymonth {
    gap: 4px !important;
  }

  html body.path-frontpage .caritas-calendar-date-big,
  html body.path-frontpage .caritas-calendar-card__day {
    font-size: 1.5rem !important;
    line-height: 0.96 !important;
  }

  html body.path-frontpage .caritas-calendar-date-small,
  html body.path-frontpage .caritas-calendar-card__month {
    font-size: 0.63rem !important;
    line-height: 1 !important;
  }

  html body.path-frontpage .caritas-calendar-date-face--time::before,
  html body.path-frontpage .caritas-calendar-date-divider {
    width: 28px !important;
    margin: 5px 0 5px !important;
  }

  html body.path-frontpage .caritas-calendar-date-time,
  html body.path-frontpage .caritas-calendar-date-big--time {
    font-size: 0.68rem !important;
  }
}

@media (max-width: 420px) {
  html body.path-frontpage .caritas-calendar-card {
    grid-template-columns: 84px minmax(0, 1fr) 4px !important;
    min-height: 92px !important;
  }

  html body.path-frontpage .caritas-calendar-card__date {
    width: 84px !important;
    min-width: 84px !important;
    min-height: 92px !important;
  }
}

html body.path-frontpage .caritas-calendar-date-weekday:empty {
  display: none !important;
  margin: 0 !important;
}
