/* ==========================================================================
   Home — In evidenza
   Markup pulito per View home_in_evidenza / block_1
   ========================================================================== */

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

html body.path-frontpage .caritas-featured-card {
  position: relative !important;
  display: flex !important;
  min-height: clamp(300px, 25vw, 360px) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background: #390200 !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .15) !important;
  color: #ffffff !important;
  isolation: isolate;
  transform: translateZ(0);
}

html body.path-frontpage .caritas-featured-card:first-child {
  grid-column: span 2 !important;
  min-height: clamp(340px, 29vw, 410px) !important;
}

html body.path-frontpage .caritas-featured-card__media,
html body.path-frontpage .caritas-featured-card__media a,
html body.path-frontpage .caritas-featured-card__media picture,
html body.path-frontpage .caritas-featured-card__media img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

html body.path-frontpage .caritas-featured-card__media img {
  object-fit: cover !important;
  filter: saturate(.96) contrast(1.03) !important;
  transform: scale(1.015);
  transition: transform .42s ease, filter .42s ease;
}

html body.path-frontpage .caritas-featured-card__shade {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, rgba(15, 23, 42, .02) 0%, rgba(15, 23, 42, .20) 42%, rgba(15, 23, 42, .86) 100%) !important;
  pointer-events: none !important;
}

html body.path-frontpage .caritas-featured-card__content {
  position: relative !important;
  z-index: 3 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  width: 100% !important;
  min-height: 100% !important;
  padding: clamp(1.1rem, 2vw, 1.55rem) !important;
}

html body.path-frontpage .caritas-featured-card__meta {
  position: absolute !important;
  top: clamp(.9rem, 1.5vw, 1.15rem) !important;
  left: clamp(.9rem, 1.5vw, 1.15rem) !important;
  right: clamp(.9rem, 1.5vw, 1.15rem) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: .45rem !important;
}

html body.path-frontpage .caritas-featured-card__type,
html body.path-frontpage .caritas-featured-card__date {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px !important;
  padding: .38rem .72rem !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  font-size: .78rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  background: rgba(123, 5, 0, .84) !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .22) !important;
}

html body.path-frontpage .caritas-featured-card__date {
  background: rgba(15, 23, 42, .62) !important;
}

html body.path-frontpage .caritas-featured-card__title {
  max-width: 94% !important;
  margin: 0 0 .55rem !important;
  color: #ffffff !important;
  font-size: clamp(1.18rem, 1.65vw, 1.55rem) !important;
  font-weight: 950 !important;
  line-height: 1.08 !important;
  letter-spacing: -.03em !important;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .42) !important;
}

html body.path-frontpage .caritas-featured-card:first-child .caritas-featured-card__title {
  max-width: min(760px, 94%) !important;
  font-size: clamp(1.45rem, 2.2vw, 2.15rem) !important;
}

html body.path-frontpage .caritas-featured-card__title a,
html body.path-frontpage .caritas-featured-card__title a:visited {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  color: #ffffff !important;
  text-decoration: none !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

html body.path-frontpage .caritas-featured-card__title a:hover,
html body.path-frontpage .caritas-featured-card__title a:focus {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: .18em !important;
}

html body.path-frontpage .caritas-featured-card__text {
  max-width: min(720px, 92%) !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, .92) !important;
  font-size: clamp(.86rem, .95vw, .98rem) !important;
  font-weight: 600 !important;
  line-height: 1.42 !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, .34) !important;
}

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

  html body.path-frontpage .caritas-featured-card: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-in-evidenza .view-content,
  html body.path-frontpage .caritas-home-slot--featured .view-content,
  html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .view-content {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body.path-frontpage .caritas-featured-card:first-child {
    grid-column: span 2 !important;
  }
}

@media (max-width: 640px) {
  html body.path-frontpage .caritas-home-in-evidenza .view-content,
  html body.path-frontpage .caritas-home-slot--featured .view-content,
  html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .view-content {
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
  }

  html body.path-frontpage .caritas-featured-card,
  html body.path-frontpage .caritas-featured-card:first-child {
    grid-column: auto !important;
    min-height: clamp(270px, 76vw, 330px) !important;
    border-radius: 22px !important;
  }

  html body.path-frontpage .caritas-featured-card__content {
    padding: 1.05rem !important;
  }

  html body.path-frontpage .caritas-featured-card__title,
  html body.path-frontpage .caritas-featured-card:first-child .caritas-featured-card__title {
    max-width: 100% !important;
    font-size: clamp(1.16rem, 5.8vw, 1.52rem) !important;
  }

  html body.path-frontpage .caritas-featured-card__text {
    max-width: 100% !important;
    font-size: .88rem !important;
  }
}

@media (max-width: 380px) {
  html body.path-frontpage .caritas-featured-card__date {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.path-frontpage .caritas-featured-card,
  html body.path-frontpage .caritas-featured-card img {
    transition: none !important;
  }
}

/* Schema istituzionale targhette In evidenza */
html body.path-frontpage .caritas-featured-card__type--comunicati {
  background: #7b0500 !important;
}

html body.path-frontpage .caritas-featured-card__type--notizie {
  background: #00747c !important;
}

html body.path-frontpage .caritas-featured-card__type--documenti {
  background: #d89a1d !important;
}

/* Neutralizza wrapper legacy Views per card In evidenza pulite */
html body.path-frontpage .caritas-home-in-evidenza .views-row,
html body.path-frontpage .caritas-home-slot--featured .views-row,
html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .views-row {
  min-height: 0 !important;
  height: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html body.path-frontpage .caritas-home-in-evidenza .views-row::before,
html body.path-frontpage .caritas-home-in-evidenza .views-row::after,
html body.path-frontpage .caritas-home-slot--featured .views-row::before,
html body.path-frontpage .caritas-home-slot--featured .views-row::after,
html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .views-row::before,
html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .views-row::after {
  content: none !important;
  display: none !important;
}

html body.path-frontpage .caritas-home-in-evidenza .views-row > .caritas-featured-card,
html body.path-frontpage .caritas-home-slot--featured .views-row > .caritas-featured-card,
html body.path-frontpage .caritas-home-slot--news.caritas-home-slot--featured .views-row > .caritas-featured-card {
  height: 100% !important;
}
