/* Producto and Soluciones pages. Builds on styles.css: page hero, module index, module rows, the Asistente duo and the sources band.
   Every product visual is a live replica (.ui-live); its framing comes from data-view, so no crops live here. */

/* ---------- page hero ---------- */

.page-hero {
  padding-top: clamp(56px, 8vw, 128px);
  padding-bottom: clamp(40px, 5vw, 72px);
}

.page-hero .display {
  margin-top: 22px;
  font-size: clamp(2.75rem, 6.4vw, 6rem);
}

.page-hero .display span {
  display: block;
}

/* Lead, then the CTAs underneath: the same stack as the Fuentes and Seguridad heroes */
.page-hero-foot {
  display: grid;
  justify-items: start;
  gap: 34px;
  margin-top: clamp(22px, 2.6vw, 34px);
}

.page-hero-canvas {
  margin-top: clamp(48px, 6vw, 88px);
}

.page-hero-canvas .window {
  max-width: 1120px;
  margin-inline: auto;
}

/* On phones the two halves flow as one sentence instead of breaking on a forced line. */
@media (max-width: 560px) {
  .page-hero .display span {
    display: inline;
  }
}

/* ---------- module index ---------- */

.modnav {
  margin-top: clamp(48px, 6vw, 88px);
}

.modnav ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.modnav a {
  position: relative;
  display: block;
  height: 100%;
  padding: 18px 0 6px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.modnav a::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.modnav a:hover::before,
.modnav a:focus-visible::before {
  transform: scaleX(1);
}

.mn-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.55vw, 1.4rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mn-title svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  opacity: 0.8;
}

.mn-body {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 980px) {
  .modnav ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .modnav a {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-ui);
    transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
  }

  .modnav a::before {
    display: none;
  }

  .modnav a:hover {
    border-color: var(--ink);
    background: var(--white);
  }

  .mn-title {
    font-family: var(--sans);
    font-size: var(--fs-small);
    font-weight: 500;
    letter-spacing: 0;
    gap: 8px;
  }

  .mn-title svg {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 560px) {
  .modnav ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modnav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
  }

  .mn-title {
    font-size: var(--fs-xs);
  }

  .mn-body {
    display: none;
  }
}

/* Three-item index (Soluciones): one column per profile instead of six narrow ones. */
.modnav--3 ol {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .modnav--3 ol {
    grid-template-columns: 1fr;
  }
}

/* ---------- module rows ---------- */

/* Keeps the italic half of a heading on one line so it never strands a word. */
.nowrap {
  white-space: nowrap;
}

/* Some replicas come in pairs: a desktop take and a phone take with a tighter view and a shorter loop.
   The width matches script.js (innerWidth < 640); the hidden one never intersects, so it never loads. */
.ui-live--sm {
  display: none;
}

@media (max-width: 639.98px) {
  .ui-live--lg {
    display: none;
  }

  .ui-live--sm {
    display: block;
  }
}

.module {
  padding-block: clamp(48px, 6vw, 88px);
}

#espacio,
#en-comun {
  padding-bottom: clamp(80px, 10vw, 144px);
}

.feature-copy p + p {
  margin-top: 14px;
}

/* ---------- Asistente: reasoning and citations side by side ---------- */

.duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 4vw, 56px) clamp(20px, 3vw, 40px);
  margin-top: clamp(64px, 8vw, 120px);
}

.duo .canvas {
  padding: clamp(14px, 2.8vw, 40px);
}

.duo-copy {
  margin-top: 26px;
}

.duo-copy p {
  margin-top: 12px;
  color: var(--ink-2);
  max-width: 30em;
  text-wrap: pretty;
}

@media (max-width: 760px) {
  .duo {
    grid-template-columns: 1fr;
  }
}

/* ---------- sources band ---------- */

.src-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-night);
}

.src-grid li {
  padding: 28px 24px 32px 0;
  border-bottom: 1px solid var(--line-night);
}

.src-grid li:not(:nth-child(4n + 1)) {
  padding-left: 24px;
  border-left: 1px solid var(--line-night);
}

.src-grid .tile {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.src-grid .tile svg {
  width: 19px;
  height: 19px;
}

.src-grid b {
  display: block;
  margin-top: 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.src-grid span {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--on-night-muted);
  max-width: 22em;
}

.sources-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: clamp(40px, 5vw, 64px);
}

.sources-foot p {
  font-size: var(--fs-small);
  color: var(--on-night-muted);
}

/* Larger hit area without pushing the underline away from the text */
.sources-foot .link-arrow {
  position: relative;
}

.sources-foot .link-arrow::after {
  content: "";
  position: absolute;
  inset: -10px -8px;
}

@media (max-width: 980px) {
  .src-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .src-grid li,
  .src-grid li:not(:nth-child(4n + 1)) {
    padding: 24px 20px 28px 0;
    border-left: 0;
  }

  .src-grid li:nth-child(even) {
    padding-left: 20px;
    border-left: 1px solid var(--line-night);
  }
}

@media (max-width: 560px) {
  .src-grid {
    grid-template-columns: 1fr;
  }

  .src-grid li,
  .src-grid li:not(:nth-child(4n + 1)),
  .src-grid li:nth-child(even) {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
    border-left: 0;
  }

  .src-grid b {
    margin-top: 4px;
    font-size: 1.3rem;
  }
}

/* ---------- closing right after a dark band ---------- */

.closing--after-night {
  padding-top: 10px;
}

@media (max-width: 640px) {
  .duo .canvas {
    padding: 12px;
  }

  .page-hero-canvas,
  .module .canvas {
    padding-block: 18px;
  }
}
