/* Inferencia responsive polish — 2026-09-26
   Conservative global layer loaded after page-specific styles. */

html {
  overflow-x: clip;
}

body {
  overflow-x: hidden;
}

.site-main,
main {
  min-width: 0;
}

.site-main h1,
.site-main h2,
.site-main h3,
main h1,
main h2,
main h3 {
  text-wrap: balance;
}

.site-main p,
main p {
  text-wrap: pretty;
}

.site-main img,
main img {
  max-width: 100%;
}

/* Opt-in photographic sections. */
.mobile-safe-bg {
  isolation: isolate;
}

.mobile-safe-bg > .relative {
  position: relative;
  z-index: 20;
}

@media (max-width: 900px) {
  .site-main section[class~="h-screen"],
  main section[class~="h-screen"] {
    height: auto !important;
    min-height: 100svh;
  }

  .mobile-safe-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3,7,18,.72) 0%, rgba(3,7,18,.58) 44%, rgba(3,7,18,.82) 100%);
  }

  .mobile-safe-bg.mobile-safe-bg--light::after {
    background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.80) 52%, rgba(255,255,255,.95) 100%);
  }
}

@media (max-width: 767px) {
  /* Fixed-height desktop sections must grow when mobile copy wraps. */
  .site-main section[class~="h-screen"],
  main section[class~="h-screen"] {
    height: auto !important;
    min-height: 100svh;
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
  }

  .site-main section[class~="min-h-screen"],
  main section[class~="min-h-screen"] {
    min-height: 100svh;
  }

  /* Keep very large display typography inside narrow viewports. */
  .site-main [class~="text-5xl"],
  main [class~="text-5xl"] {
    font-size: clamp(2.15rem, 10.5vw, 3rem) !important;
    line-height: 1.02 !important;
  }

  .site-main [class~="text-6xl"],
  main [class~="text-6xl"] {
    font-size: clamp(2.35rem, 11.5vw, 3.35rem) !important;
    line-height: 1 !important;
  }

  .site-main [class~="text-7xl"],
  main [class~="text-7xl"],
  .site-main [class~="text-8xl"],
  main [class~="text-8xl"],
  .site-main [class~="text-9xl"],
  main [class~="text-9xl"] {
    font-size: clamp(2.55rem, 12vw, 3.75rem) !important;
    line-height: .98 !important;
  }

  .site-main h1,
  .site-main h2,
  .site-main h3,
  main h1,
  main h2,
  main h3 {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  /* Prevent pill/CTA padding from forcing horizontal overflow. */
  .site-main a,
  .site-main button,
  main a,
  main button {
    max-width: 100%;
  }

  .site-main a[class~="px-16"],
  .site-main button[class~="px-16"],
  main a[class~="px-16"],
  main button[class~="px-16"] {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .site-main [class~="gap-16"],
  main [class~="gap-16"] {
    gap: 2.5rem !important;
  }

  .site-main [class~="gap-20"],
  main [class~="gap-20"] {
    gap: 3rem !important;
  }

  .site-main [class~="py-32"],
  main [class~="py-32"] {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
  }

  .site-main [class~="pt-32"],
  main [class~="pt-32"] {
    padding-top: 5rem !important;
  }

  .site-main [class~="pb-32"],
  main [class~="pb-32"] {
    padding-bottom: 5rem !important;
  }

  /* Photo sections receive a deterministic mobile overlay. */
  .mobile-safe-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3,7,18,.86) 0%, rgba(3,7,18,.72) 42%, rgba(3,7,18,.92) 100%);
  }

  .mobile-safe-bg.mobile-safe-bg--light::after {
    background: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.88) 52%, rgba(255,255,255,.97) 100%);
  }

  .mobile-safe-bg > img.absolute,
  .mobile-safe-bg > .absolute > img {
    opacity: .28 !important;
  }

  .mobile-safe-bg.mobile-safe-bg--light > img.absolute,
  .mobile-safe-bg.mobile-safe-bg--light > .absolute > img {
    opacity: .12 !important;
  }

  .mobile-safe-bg > .absolute[class*="gradient"],
  .mobile-safe-bg > .absolute.cinematic-overlay {
    z-index: 9 !important;
  }

  /* Home: image and copy must never occupy the same vertical layer on phones. */
  .ii-home-about {
    min-height: 0 !important;
    padding: 5rem 0;
    overflow: visible !important;
  }

  .ii-home-about__desktop-media {
    display: none !important;
  }

  .ii-home-about__copy {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .ii-home-about__mobile-media {
    display: block;
    margin-top: 2.25rem;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.1);
    box-shadow: 0 24px 60px rgba(15,23,42,.14);
  }

  .ii-home-about__mobile-media img {
    width: 100%;
    height: clamp(15rem, 68vw, 23rem);
    object-fit: cover;
  }

  .ii-home-about__stats {
    margin-top: 2.5rem !important;
    gap: 1.25rem !important;
  }

  .ii-home-about__stats > div {
    min-width: 0;
    padding: 1.1rem;
    border-radius: 1.25rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
  }

  .ii-home-about__stats [class~="text-5xl"] {
    font-size: clamp(2rem, 10vw, 2.75rem) !important;
  }

  /* Footer: avoid oversized dead space and keep institutional copy legible. */
  .ii-internal-footer .ii-footer-legal-copy {
    font-size: .72rem;
    line-height: 1.7;
    color: #6b7280;
    text-align: left;
  }

  .ii-internal-footer img[alt*="Logotipos institucionales"] {
    margin-top: 1.25rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ii-home-about {
    min-height: 0 !important;
    padding: 6rem 0;
    overflow: visible !important;
  }

  .ii-home-about__desktop-media {
    display: none !important;
  }

  .ii-home-about__copy {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .ii-home-about__mobile-media {
    display: block !important;
    margin-top: 2.5rem;
    border-radius: 1.75rem;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.1);
    box-shadow: 0 24px 60px rgba(15,23,42,.14);
  }

  .ii-home-about__mobile-media img {
    width: 100%;
    height: clamp(22rem, 52vw, 32rem);
    object-fit: cover;
  }

  .ii-home-about__stats {
    margin-top: 2.75rem !important;
  }
}

@media (min-width: 1024px) {
  .ii-home-about__mobile-media {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .site-main [class*="tracking-[0.5em]"],
  main [class*="tracking-[0.5em]"] {
    letter-spacing: .26em !important;
  }

  .ii-internal-footer .ii-footer-legal-copy {
    font-size: .69rem;
  }
}
