/* Ajustos estructurals contra qualsevol desbordament horitzontal. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main,
section,
header,
footer {
  min-width: 0;
}

img,
video,
iframe {
  max-width: 100%;
}

@media (max-width: 900px) {
  .site-header {
    width: 100%;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
  }

  .section-pad {
    width: 100%;
    max-width: 100%;
    padding-left: calc(24px + env(safe-area-inset-left)) !important;
    padding-right: calc(24px + env(safe-area-inset-right)) !important;
  }

  .hero,
  .featured,
  .stream,
  .categories,
  .about-tease,
  .archive-hero,
  .archive-grid,
  .article-head,
  .article-body,
  .related,
  .about-hero,
  .longread,
  .contact-layout {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero {
    gap: 34px;
    overflow: hidden;
  }

  .hero-copy,
  .hero-collage,
  .feature-media,
  .feature-copy,
  .section-head,
  .editorial-grid,
  .story-card,
  .article-content,
  .about-hero > *,
  .contact-layout > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero h1,
  .archive-hero h1,
  .about-hero h1,
  .contact-layout h1,
  .empty h1 {
    max-width: 100%;
    font-size: clamp(43px, 13vw, 76px);
    line-height: .9;
    overflow-wrap: anywhere;
  }

  .feature-copy h2,
  .section-head h2,
  .about-tease h2,
  .footer h2,
  .manifesto-text {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 18px;
  }

  .hero-collage {
    height: 520px;
    overflow: hidden;
  }

  .hero-img-a {
    right: 4%;
  }

  .hero-img-b {
    left: 0;
  }

  .hero-img-c {
    right: 0;
    bottom: 0;
  }

  .manifesto {
    padding-top: 70px;
    padding-bottom: 85px;
  }

  .featured {
    padding-top: 65px;
    padding-bottom: 70px;
  }

  .stream {
    padding-top: 80px;
    padding-bottom: 90px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 48px;
  }

  .story-card,
  .archive-card {
    width: 100%;
    max-width: 100%;
  }

  .categories {
    overflow: hidden;
    padding-top: 75px;
    padding-bottom: 80px;
  }

  .category-orbits {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .category-orbits a {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 0;
    padding: 18px;
    font-size: clamp(20px, 6vw, 27px);
  }

  .about-tease {
    padding-top: 85px;
    padding-bottom: 85px;
  }

  .about-hero {
    gap: 32px;
    padding-top: 48px;
  }

  .about-hero figure {
    width: 100%;
    height: min(112vw, 480px);
  }

  .longread {
    margin: 0 auto;
    padding-top: 60px;
    padding-bottom: 85px;
  }

  .article-content {
    font-size: 18px;
    line-height: 1.72;
    overflow-wrap: anywhere;
  }

  .article-content h2 {
    font-size: clamp(31px, 9vw, 42px);
  }

  .article-content h3 {
    font-size: clamp(27px, 8vw, 35px);
  }

  .article-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    font-size: 25px;
  }

  .article-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .article-head figure,
  .contact-layout > div > img {
    width: 100%;
  }

  .footer {
    width: 100%;
    max-width: 100%;
    padding-left: calc(24px + env(safe-area-inset-left));
    padding-right: calc(24px + env(safe-area-inset-right));
    gap: 38px;
  }

  /* En mòbil el contingut mai no depèn de l'animació per ser visible. */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 380px) {
  .category-orbits {
    gap: 9px;
  }

  .category-orbits a {
    padding: 12px;
    font-size: 20px;
  }
}
