/* =========================================================
   HOME FEATURED V5 — rifinitura sezione "In evidenza"
   Intervento isolato: non modifica header, agenda, numeri, mappe o immagini.
   Obiettivo: mosaico più disciplinato, testi stabili, overlay leggibile.
   ========================================================= */

html body.path-frontpage .caritas-public-band--featured,
html body.path-frontpage .caritas-home-section--featured {
  padding-top: clamp(42px, 4.2vw, 62px) !important;
  padding-bottom: clamp(46px, 4.8vw, 72px) !important;
}

html body.path-frontpage .caritas-featured-strip {
  margin-bottom: 22px !important;
}

html body.path-frontpage .caritas-home-featured-view .view-content,
html body.path-frontpage .caritas-home-slot--featured .view-content,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .view-content {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(17px, 1.75vw, 24px) !important;
  align-items: stretch !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row,
html body.path-frontpage .caritas-home-slot--featured .views-row,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row {
  min-height: clamp(292px, 25vw, 338px) !important;
  border-radius: 23px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: #390200 !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.15) !important;
  transform: translateZ(0) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row:first-child,
html body.path-frontpage .caritas-home-slot--featured .views-row:first-child,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child {
  grid-column: span 2 !important;
  min-height: clamp(330px, 28vw, 390px) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-field-field-immagine-di-copertina img,
html body.path-frontpage .caritas-home-slot--featured .views-field-field-immagine-di-copertina img,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-field-immagine-di-copertina img {
  filter: saturate(0.95) contrast(1.02) !important;
  transform: scale(1.015) !important;
  transition: transform 420ms ease, filter 420ms ease !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row::before,
html body.path-frontpage .caritas-home-slot--featured .views-row::before,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 38%) !important;
  pointer-events: none !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row::after,
html body.path-frontpage .caritas-home-slot--featured .views-row::after,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.22) 39%, rgba(0, 0, 0, 0.80) 100%),
    linear-gradient(90deg, rgba(123, 5, 0, 0.42) 0%, rgba(123, 5, 0, 0.12) 50%, rgba(0, 0, 0, 0.10) 100%) !important;
}

/* Badge tipologia/data: più leggibile, meno pesante. */
html body.path-frontpage .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia,
html body.path-frontpage .caritas-home-slot--featured .views-row.caritas-featured-meta-ready .views-field-field-tipologia,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia,
html body.path-frontpage .caritas-home-featured-view .views-row.caritas-featured-meta-ready:first-child .views-field-field-tipologia,
html body.path-frontpage .caritas-home-slot--featured .views-row.caritas-featured-meta-ready:first-child .views-field-field-tipologia,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row.caritas-featured-meta-ready:first-child .views-field-field-tipologia {
  top: 17px !important;
  left: clamp(16px, 1.55vw, 24px) !important;
  max-width: calc(100% - 36px) !important;
  min-height: 26px !important;
  padding: 0.42rem 0.74rem !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.20) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after,
html body.path-frontpage .caritas-home-slot--featured .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after {
  opacity: 0.96 !important;
}

/* Testi: massimo due righe, niente parole spezzate, margini coerenti. */
html body.path-frontpage .caritas-home-featured-view .views-field-title,
html body.path-frontpage .caritas-home-slot--featured .views-field-title,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-title {
  margin-top: clamp(178px, 16vw, 220px) !important;
  margin-left: clamp(18px, 1.65vw, 26px) !important;
  margin-right: clamp(18px, 1.65vw, 26px) !important;
  max-width: calc(100% - 36px) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-row:first-child .views-field-title,
html body.path-frontpage .caritas-home-slot--featured .views-row:first-child .views-field-title,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child .views-field-title {
  margin-top: clamp(212px, 17.5vw, 258px) !important;
  max-width: min(760px, calc(100% - 48px)) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-field-title a,
html body.path-frontpage .caritas-home-slot--featured .views-field-title a,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-title a {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.38) !important;
}

html body.path-frontpage .caritas-home-featured-view .views-field-field-testo-breve,
html body.path-frontpage .caritas-home-slot--featured .views-field-field-testo-breve,
html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-field-testo-breve {
  margin-left: clamp(18px, 1.65vw, 26px) !important;
  margin-right: clamp(18px, 1.65vw, 26px) !important;
  margin-bottom: clamp(18px, 1.55vw, 24px) !important;
  max-width: min(700px, calc(100% - 36px)) !important;
  font-size: clamp(0.86rem, 0.95vw, 0.98rem) !important;
  line-height: 1.38 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.34) !important;
}

@media (hover: hover) and (pointer: fine) {
  html body.path-frontpage .caritas-home-featured-view .views-row:hover,
  html body.path-frontpage .caritas-home-slot--featured .views-row:hover,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.22) !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-row:hover img,
  html body.path-frontpage .caritas-home-slot--featured .views-row:hover img,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:hover img {
    transform: scale(1.055) !important;
    filter: saturate(1.02) contrast(1.05) !important;
  }
}

@media (max-width: 980px) {
  html body.path-frontpage .caritas-home-featured-view .view-content,
  html body.path-frontpage .caritas-home-slot--featured .view-content,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .view-content {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-row:first-child,
  html body.path-frontpage .caritas-home-slot--featured .views-row:first-child,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child {
    grid-column: span 2 !important;
  }
}

@media (max-width: 640px) {
  html body.path-frontpage .caritas-public-band--featured,
  html body.path-frontpage .caritas-home-section--featured {
    padding-top: 34px !important;
    padding-bottom: 42px !important;
  }

  html body.path-frontpage .caritas-featured-strip {
    margin-bottom: 18px !important;
  }

  html body.path-frontpage .caritas-home-featured-view .view-content,
  html body.path-frontpage .caritas-home-slot--featured .view-content,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .view-content {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-row,
  html body.path-frontpage .caritas-home-slot--featured .views-row,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row,
  html body.path-frontpage .caritas-home-featured-view .views-row:first-child,
  html body.path-frontpage .caritas-home-slot--featured .views-row:first-child,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child {
    grid-column: auto !important;
    min-height: clamp(270px, 76vw, 324px) !important;
    border-radius: 22px !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia,
  html body.path-frontpage .caritas-home-slot--featured .views-row.caritas-featured-meta-ready .views-field-field-tipologia,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia {
    top: 15px !important;
    left: 16px !important;
    max-width: calc(100% - 32px) !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-field-title,
  html body.path-frontpage .caritas-home-slot--featured .views-field-title,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-title,
  html body.path-frontpage .caritas-home-featured-view .views-row:first-child .views-field-title,
  html body.path-frontpage .caritas-home-slot--featured .views-row:first-child .views-field-title,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child .views-field-title {
    margin-top: clamp(154px, 47vw, 190px) !important;
    margin-left: 18px !important;
    margin-right: 18px !important;
    max-width: calc(100% - 36px) !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-field-title a,
  html body.path-frontpage .caritas-home-slot--featured .views-field-title a,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-title a,
  html body.path-frontpage .caritas-home-featured-view .views-row:first-child .views-field-title a,
  html body.path-frontpage .caritas-home-slot--featured .views-row:first-child .views-field-title a,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row:first-child .views-field-title a {
    font-size: clamp(1.18rem, 6vw, 1.55rem) !important;
    line-height: 1.08 !important;
  }

  html body.path-frontpage .caritas-home-featured-view .views-field-field-testo-breve,
  html body.path-frontpage .caritas-home-slot--featured .views-field-field-testo-breve,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-field-field-testo-breve {
    margin-left: 18px !important;
    margin-right: 18px !important;
    margin-bottom: 18px !important;
    font-size: 0.88rem !important;
    -webkit-line-clamp: 2 !important;
  }
}

@media (max-width: 380px) {
  html body.path-frontpage .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after,
  html body.path-frontpage .caritas-home-slot--featured .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row.caritas-featured-meta-ready .views-field-field-tipologia::after {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.path-frontpage .caritas-home-featured-view .views-row,
  html body.path-frontpage .caritas-home-featured-view .views-row img,
  html body.path-frontpage .caritas-home-slot--featured .views-row,
  html body.path-frontpage .caritas-home-slot--featured .views-row img,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row,
  html body.path-frontpage .caritas-home-slot--news .caritas-home-featured-view .views-row img {
    transition: none !important;
  }
}
