/* Card "You might also be interested in" / "Potrebbe anche interessarti"
   Caricato dopo style.css: i selettori con "main" sovrascrivono le vecchie regole */

/* Titolo sezione */
main .title_risto-why:has(+ .tre_box_cooking) {
  margin-top: 60px;
  padding: 0 16px;
  text-align: center;
}
main .title_risto-why:has(+ .tre_box_cooking) h4 {
  font-family: 'Mulish', sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: #16313d;
}
main .title_risto-why:has(+ .tre_box_cooking) h4::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #b4880f, #f5b810);
}

/* Griglia */
main .tre_box_cooking {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 36px 40px 80px;
  margin: 0 auto !important;
  box-sizing: border-box;
}

/* Card */
main .tre_box_cooking .box-cooking {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  background: #16313d;
  box-shadow: 0 10px 30px -12px rgba(22, 49, 61, 0.35);
  transition: transform 0.45s cubic-bezier(.2, .7, .2, 1), box-shadow 0.45s ease;
}
main .tre_box_cooking .box-cooking:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -16px rgba(22, 49, 61, 0.5);
}

main .tre_box_cooking .box-cooking > a {
  display: block;
  width: 100%;
  height: 100%;
}
main .tre_box_cooking .box-cooking img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.8s cubic-bezier(.2, .7, .2, 1);
}
main .tre_box_cooking .box-cooking:hover img {
  transform: scale(1.08);
}

/* Sfumatura scura sotto il testo */
main .tre_box_cooking .box-cooking::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 26, 33, 0.92) 0%, rgba(10, 26, 33, 0.45) 40%, rgba(10, 26, 33, 0) 65%);
}

/* Testo in basso */
main .tre_box_cooking .box-cooking .footer_cooking {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: auto;
  height: auto;
  line-height: normal;
  padding: 0 24px 26px;
  text-align: left;
  background: none;
  border-radius: 0;
}
main .tre_box_cooking .box-cooking .footer_cooking::before {
  content: "Cooking class";
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: 'Mulish', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
html[lang="it"] main .tre_box_cooking .box-cooking .footer_cooking::before {
  content: "Lezione di cucina";
}

main .tre_box_cooking .box-cooking .footer_cooking a,
main .tre_box_cooking .box-cooking .footer_cooking a:hover {
  /* Altezza fissa (2 righe titolo + freccia): etichette e titoli allineati tra le card */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: calc(2.6em + 48px);
  font-family: 'Mulish', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-decoration: none;
  text-transform: none;
}
/* I titoli italiani sono più lunghi: riserva 3 righe */
html[lang="it"] main .tre_box_cooking .box-cooking .footer_cooking a {
  min-height: calc(3.9em + 48px);
}
/* Rende cliccabile tutta la card */
main .tre_box_cooking .box-cooking .footer_cooking a::before {
  content: "";
  position: absolute;
  inset: -1000px;
}
/* Freccia "scopri" */
main .tre_box_cooking .box-cooking .footer_cooking a::after {
  content: "\2192";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: 14px;
  border-radius: 50%;
  background: #b4880f;
  color: #fff;
  font-size: 1.1rem;
  transition: transform 0.35s ease, background-color 0.35s ease;
}
main .tre_box_cooking .box-cooking:hover .footer_cooking a::after {
  transform: translateX(6px);
  background: #f5b810;
}

main .tre_box_cooking .box-cooking:focus-within {
  outline: 3px solid #f5b810;
  outline-offset: 4px;
}

@media (max-width: 1180px) {
  main .tre_box_cooking {
    gap: 20px;
    padding: 30px 24px 60px;
  }
  main .tre_box_cooking .box-cooking .footer_cooking a,
  main .tre_box_cooking .box-cooking .footer_cooking a:hover {
    font-size: 1.05rem;
  }
}

@media (max-width: 820px) {
  main .tre_box_cooking {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  main .tre_box_cooking {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 16px 48px;
  }
  main .tre_box_cooking .box-cooking {
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  main .tre_box_cooking .box-cooking,
  main .tre_box_cooking .box-cooking img,
  main .tre_box_cooking .box-cooking .footer_cooking a::after {
    transition: none;
  }
}
