body.longform-article {
  .longform-fade-target {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.7s ease,
      transform 0.7s ease;
    will-change: opacity, transform;
  }

  .longform-fade-target.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  @media (min-width: 1200px) {
    .container {
      max-width: 1650px;
    }
  }
  p {
    max-width: 950px;
    text-align: justify;
  }
  [class^="longform-related-"] {
    width: 100%;
    text-align: justify;
  }
  .longform-related-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .longform-related-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
  .longform-media-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 14px;
    margin-top: 8px;
    padding: 0 15px;
  }
  .longform-related-title:not(.box-title) {
    font-size: 25px;
    padding-bottom: 15px;
    font-weight: 500;
    text-align: center;
    max-width: 950px;
    width: 100%;
    color: #000;
  }
  .longform-related-title.box-title {
    font-size: 25px;
    font-weight: 700;
    text-align: justify;
  }
  .longform-related-content.box {
    text-align: justify;
    padding: 25px;
    border-radius: 15px;
    max-width: 1080px !important;
  }
  .longform-related-content.box p,
  .longform-related-content.box div {
    text-align: justify;
  }
  .longform-related-video {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
  }
  .longform-related-video iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    max-height: 607px;
  }
  .longform-related-gallery {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
  }
  .longform-related-gallery .carousel-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
  }
  .carousel.slide {
    max-width: 1080px;
    margin: 0 auto;
  }
  .carousel-item img {
    aspect-ratio: 2/1;
    object-fit: cover;
    width: 100%;
    height: auto;
  }
  .carousel-control-prev,
  .carousel-control-next {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    transition: filter 0.3s ease;
    width: 50px;
    height: 50px;
    background-color: rgba(1, 72, 144, 0.8);
    border: 2px solid #014890;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
  }
  .carousel-control-prev {
    left: 20px;
  }
  .carousel-control-next {
    right: 20px;
  }
  .carousel-control-prev:hover,
  .carousel-control-next:hover {
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7));
    background-color: rgba(1, 72, 144, 1);
    border-color: #0056b3;
  }
  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
  }
  .do-article-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .longform-related-content {
    display: flex;
    justify-content: center;
    justify-self: anchor-center;
    flex-wrap: wrap;
    flex-direction: column;
    align-content: center;
    text-align: center;
  }
  .longform-related-content p {
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.longform-article {
    .longform-fade-target {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }
}

.article-hero {
  position: relative;
  width: 100%;
  height: 72vh;
  overflow: hidden;
  display: flex;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.25) 35%,
    rgba(0, 0, 0, 0) 65%
  );
  z-index: 1;
}
.article-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end; /* posizionato in basso */
  justify-content: center;
  padding-bottom: 4vh;
  z-index: 2;
  pointer-events: none;
}

.article-hero-text {
  text-align: center;
  color: #fff;
  max-width: 1080px;
  pointer-events: none;
  padding-bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Sottotitolo */
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 400;
  margin-bottom: 0.4em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Titolo principale */
.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5em;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* HR */
.hero-hr {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin: 0.5em auto;
}

/* Autore */
.hero-author {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 400;
  opacity: 0.8;
}

/* ========================================
   MOBILE & TABLET RESPONSIVE STYLES
   ======================================== */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  body.longform-article {
    .container {
      max-width: 100%;
      padding: 0 20px;
    }

    p {
      max-width: 90%;
      margin: 0 auto 1.2em;
      text-align: justify;
    }

    .longform-related-title:not(.box-title) {
      font-size: 22px;
      padding-bottom: 12px;
      max-width: 90%;
      margin: 0 auto;
    }

    .do-article-content,
    .longform-related-content {
      padding: 0 15px;
      gap: 15px;
    }
  }

  .article-hero {
    height: 50vh;
  }

  .article-hero-text {
    max-width: 90%;
    padding-bottom: 40px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-author {
    font-size: 1rem;
  }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) {
  body.longform-article {
    .container {
      max-width: 100%;
      padding: 0 15px;
    }

    p {
      max-width: 100%;
      font-size: 16px;
      line-height: 1.6;
      margin-bottom: 1.5em;
      text-align: justify;
    }

    .longform-related-title:not(.box-title) {
      font-size: 20px;
      padding-bottom: 10px;
      max-width: 100%;
    }

    .longform-related-title.box-title {
      font-size: 22px;
      text-align: justify;
    }

    .longform-related-content.box {
      text-align: justify;
      padding: 20px;
      border-radius: 15px;
      max-width: 1080px !important;
    }
    .longform-related-content.box p,
    .longform-related-content.box div {
      text-align: justify;
    }

    .longform-related-video {
      width: 100%;
      margin: 0 auto;
    }
    .longform-related-video iframe {
      width: 100%;
      height: auto;
      aspect-ratio: 16/9;
      max-height: 400px;
    }

    .longform-related-gallery {
      width: 100%;
      margin: 0 auto;
    }
    .longform-related-gallery .carousel-item img {
      width: 100%;
      height: auto;
      aspect-ratio: 16/9;
      object-fit: cover;
      max-height: 400px;
    }
    .carousel-item img {
      aspect-ratio: 2/1;
      object-fit: cover;
      max-height: 300px;
    }

    .carousel-control-prev,
    .carousel-control-next {
      filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.6));
      width: 45px;
      height: 45px;
      background-color: rgba(1, 72, 144, 0.8);
      border: 2px solid #014890;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      top: 50%;
      transform: translateY(-50%);
    }
    .carousel-control-prev {
      left: 15px;
    }
    .carousel-control-next {
      right: 15px;
    }
    .carousel-control-prev:hover,
    .carousel-control-next:hover {
      filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.8));
      background-color: rgba(1, 72, 144, 1);
    }

    .longform-related-image {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      margin: 0 auto;
    }

    .longform-related-image img {
      max-width: 100%;
      height: auto;
      display: block;
    }

    .do-article-content,
    .longform-related-content {
      flex-direction: column;
      align-items: center;
      gap: 12px;
      padding: 0 10px;
    }
  }

  .article-hero {
    height: 40vh;
    min-height: 300px;
  }

  .article-hero-overlay {
    padding-bottom: 3vh;
  }

  .article-hero-text {
    max-width: 95%;
    padding-bottom: 30px;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.3em;
  }

  .hero-title {
    font-size: 1.6rem;
    line-height: 1.1;
  }

  .hero-hr {
    margin: 0.3em auto;
  }

  .hero-author {
    font-size: 0.85rem;
  }
}

/* Mobile Small (max 480px) */
@media (max-width: 480px) {
  body.longform-article {
    .container {
      padding: 0 12px;
    }

    p {
      font-size: 15px;
      line-height: 1.65;
      margin-bottom: 1.8em;
      text-align: justify;
    }

    .longform-related-title:not(.box-title) {
      font-size: 18px;
      padding-bottom: 8px;
    }

    .longform-related-title.box-title {
      font-size: 20px;
      text-align: justify;
    }

    .longform-related-content.box {
      text-align: justify;
      padding: 15px;
      border-radius: 12px;
      max-width: 1080px !important;
    }
    .longform-related-content.box p,
    .longform-related-content.box div {
      text-align: justify;
    }

    .longform-related-video {
      width: 100%;
      margin: 0 auto;
    }
    .longform-related-video iframe {
      width: 100%;
      height: auto;
      aspect-ratio: 16/9;
      max-height: 300px;
    }

    .longform-related-gallery .carousel-item img {
      aspect-ratio: 16/9;
      object-fit: cover;
      max-height: 250px;
    }
    .carousel-item img {
      aspect-ratio: 2/1;
      object-fit: cover;
      max-height: 200px;
    }

    .carousel-control-prev,
    .carousel-control-next {
      filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.7));
      width: 40px;
      height: 40px;
      background-color: rgba(1, 72, 144, 0.8);
      border: 2px solid #014890;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      top: 50%;
      transform: translateY(-50%);
    }
    .carousel-control-prev {
      left: 10px;
    }
    .carousel-control-next {
      right: 10px;
    }

    .longform-related-image {
      display: flex;
      justify-content: center;
      width: 100%;
      margin: 0 auto;
    }

    .do-article-content,
    .longform-related-content {
      padding: 0 8px;
      gap: 10px;
    }
  }

  .article-hero {
    height: 35vh;
    min-height: 280px;
  }

  .article-hero-overlay {
    padding-bottom: 2vh;
  }

  .article-hero-text {
    max-width: 100%;
    padding-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    margin-bottom: 0.2em;
  }

  .hero-title {
    font-size: 1.4rem;
    line-height: 1.1;
    margin-bottom: 0.4em;
  }

  .hero-hr {
    margin: 0.25em auto;
  }

  .hero-author {
    font-size: 0.8rem;
  }
}

/* Mobile Extra Small (max 360px) */
@media (max-width: 360px) {
  body.longform-article {
    .container {
      padding: 0 10px;
    }

    p {
      font-size: 14px;
      line-height: 1.7;
      text-align: justify;
    }

    .longform-related-title:not(.box-title) {
      font-size: 16px;
      padding-bottom: 6px;
    }

    .longform-related-title.box-title {
      font-size: 18px;
      text-align: justify;
    }

    .longform-related-content.box {
      text-align: justify;
      padding: 12px;
      border-radius: 10px;
      max-width: 1080px !important;
    }
    .longform-related-content.box p,
    .longform-related-content.box div {
      text-align: justify;
    }

    .longform-related-video {
      width: 100%;
      margin: 0 auto;
    }
    .longform-related-video iframe {
      width: 100%;
      height: auto;
      aspect-ratio: 16/9;
      max-height: 250px;
    }

    .longform-related-gallery .carousel-item img {
      aspect-ratio: 16/9;
      object-fit: cover;
      max-height: 200px;
    }
    .carousel-item img {
      aspect-ratio: 2/1;
      object-fit: cover;
      max-height: 150px;
    }

    .carousel-control-prev,
    .carousel-control-next {
      filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
      width: 35px;
      height: 35px;
      background-color: rgba(1, 72, 144, 0.8);
      border: 2px solid #014890;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      top: 50%;
      transform: translateY(-50%);
    }
    .carousel-control-prev {
      left: 8px;
    }
    .carousel-control-next {
      right: 8px;
    }

    .longform-related-image {
      display: flex;
      justify-content: center;
      width: 100%;
      margin: 0 auto;
    }
  }

  .article-hero {
    height: 32vh;
    min-height: 250px;
  }

  .article-hero-text {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-subtitle {
    font-size: 0.75rem;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-author {
    font-size: 0.75rem;
  }
}
