/* Noticias page. Layered on the shared public shell (public-pages.css).
   Shape rule: media and panels use --nx-radius (14px); every interactive control is a pill. */

@font-face {
  font-family: "Archivo";
  src: url("/pages/assets/vendor/fonts/archivo-variable-5.3.0/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/pages/assets/vendor/fonts/archivo-variable-5.3.0/archivo-latin-wdth-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

body.noticias-page {
  --nx-bg: #f2f4f2;
  --nx-surface: #fcfdfc;
  --nx-surface-2: #e8ece9;
  --nx-ink: #0f1512;
  --nx-muted: #56625b;
  --nx-line: #d5dcd7;
  --nx-accent: #15803d;
  --nx-accent-ink: #0f6b33;
  --nx-on-accent: #f6fff8;
  --nx-shadow: 0 18px 40px -22px rgb(15 40 25 / .35);
  --nx-radius: 14px;
  --nx-ease: cubic-bezier(.16, 1, .3, 1);
  --nx-display: "Archivo", system-ui, sans-serif;

  color: var(--nx-ink);
  background: var(--nx-bg);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-stretch: 100%;
}

@media (prefers-color-scheme: dark) {
  body.noticias-page {
    --nx-bg: #0b0f0d;
    --nx-surface: #131916;
    --nx-surface-2: #161e1a;
    --nx-ink: #eef2ef;
    --nx-muted: #9ba89f;
    --nx-line: #25302a;
    --nx-accent: #22c55e;
    --nx-accent-ink: #4ade80;
    --nx-on-accent: #04210f;
    --nx-shadow: 0 18px 40px -20px rgb(0 0 0 / .7);
  }
}

.nx {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0; /* flex child of the shell body: keep the video rail from widening the page */
  overflow-x: clip;
}

.nx-wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .nx-wrap { padding-inline: 28px; }
}

.nx a { color: inherit; text-decoration: none; }
.nx a:focus-visible,
.nx button:focus-visible,
.nx [tabindex]:focus-visible {
  outline: 3px solid var(--nx-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Hero ---------- */
.nx-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 0;
  padding: 64px 0 84px;
  color: #f2f6f3;
  background: #0a110d;
}

.nx-hero__media,
.nx-hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nx-hero__media { z-index: -1; }

.nx-hero__media img {
  object-fit: cover;
  object-position: 62% 50%;
}

.nx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgb(8 14 11 / .15) 0%, rgb(8 14 11 / .55) 55%, rgb(8 14 11 / .92) 100%),
    linear-gradient(90deg, rgb(8 14 11 / .75) 0%, rgb(8 14 11 / 0) 70%);
}

/* Brand crest watermark in the hero's open right side (1024px and up, where it cannot touch the headline). */
.nx-hero__logo {
  display: none;
}

@media (min-width: 1024px) {
  .nx-hero__logo {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: max(24px, calc((100vw - 1240px) / 2 + 28px));
    display: block;
    width: clamp(300px, 36vw, 540px);
    height: auto;
    opacity: .4;
    transform: translateY(-58%);
    pointer-events: none;
    filter: saturate(.9) drop-shadow(0 0 40px rgb(34 197 94 / .18));
  }
}

.nx-hero__date {
  margin: 0 0 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #b9e8c9;
}

.nx-hero__title {
  max-width: 13ch;
  margin: 0 0 16px;
  padding-bottom: .06em;
  font-family: var(--nx-display);
  font-size: clamp(2.6rem, 9.5vw, 5rem);
  font-stretch: 72%;
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.01em;
}

.nx-hero__title em {
  font-style: italic;
  font-weight: 800;
  color: #4ade80;
}

.nx-hero__lede {
  max-width: 38ch;
  margin: 0 0 26px;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.5;
  color: #d3ddd6;
}

.nx-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 900px) {
  .nx-hero { min-height: min(68svh, 560px); padding: 72px 0 120px; }
}

/* ---------- Buttons and icons ---------- */
.nx-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .25s var(--nx-ease), background-color .25s var(--nx-ease), border-color .25s var(--nx-ease);
}

.nx-btn:active { transform: scale(.98); }

.nx-btn--primary {
  padding-right: 6px;
  color: var(--nx-on-accent);
  background: var(--nx-accent);
}

.nx-hero .nx-btn--primary { color: #04210f; background: #22c55e; }

.nx-btn--primary:hover .nx-btn__icon { transform: translateX(3px); }

.nx-btn__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgb(0 0 0 / .14);
  transition: transform .25s var(--nx-ease);
}

.nx-btn--ghost {
  color: #f2f6f3;
  border-color: rgb(255 255 255 / .4);
  background: rgb(255 255 255 / .06);
  backdrop-filter: blur(6px);
}

.nx-btn--ghost:hover { background: rgb(255 255 255 / .14); }

.nx-btn--outline {
  color: var(--nx-ink);
  border-color: var(--nx-line);
  background: var(--nx-surface);
}

.nx-btn--outline:hover { border-color: var(--nx-accent); }
.nx-btn[disabled] { opacity: .55; cursor: default; }

.nx-arrow {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
}

.nx-icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  color: var(--nx-ink);
  background: var(--nx-surface);
  cursor: pointer;
  transition: border-color .2s var(--nx-ease), transform .2s var(--nx-ease);
}

.nx-icon-btn:hover { border-color: var(--nx-accent); }
.nx-icon-btn:active { transform: scale(.96); }
.nx-icon-btn[disabled] { opacity: .4; cursor: default; }

.nx-chevron {
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateX(-2px) rotate(45deg);
}

.nx-chevron--left { transform: translateX(2px) rotate(-135deg); }

.nx-close {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.nx-close::before,
.nx-close::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.nx-close::after { transform: rotate(-45deg); }

/* ---------- Shared media and meta ---------- */
.nx-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--nx-radius);
  /* Fallback when a scraped image is missing or fails: a quiet pitch texture. */
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 28px, transparent 28px 56px),
    radial-gradient(120% 90% at 30% 20%, #1f7a45, #0d3b22 70%);
}

.nx-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--nx-ease);
}

.nx-media--lead,
.nx-media--card,
.nx-media--video { aspect-ratio: 16 / 9; }
.nx-media--thumb { aspect-ratio: 4 / 3; }

.nx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0 0 8px;
  font-size: .8rem;
  color: var(--nx-muted);
}

.nx-meta__source {
  font-weight: 700;
  color: var(--nx-accent-ink);
}

.nx-section-title {
  margin: 0 0 14px;
  font-family: var(--nx-display);
  font-size: 1.15rem;
  font-stretch: 85%;
  font-weight: 800;
}

.nx-section-title--lg {
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-stretch: 75%;
  line-height: 1;
}

/* ---------- Front: lead story and briefs ---------- */
.nx-front {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  margin-top: -56px;
}

@media (min-width: 992px) {
  .nx-front {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    align-items: start;
    gap: 36px;
    margin-top: -84px;
  }
}

.nx-lead__link {
  display: block;
  overflow: hidden;
  border-radius: var(--nx-radius);
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow);
}

.nx-lead .nx-media--lead { border-radius: 0; }
.nx-lead__body { padding: 18px 18px 22px; }

.nx-lead__title {
  margin: 0 0 10px;
  font-family: var(--nx-display);
  font-size: clamp(1.55rem, 5.4vw, 2.4rem);
  font-stretch: 78%;
  font-weight: 800;
  line-height: 1.04;
}

.nx-lead__summary {
  max-width: 62ch;
  margin: 0 0 14px;
  line-height: 1.55;
  color: var(--nx-muted);
}

.nx-readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--nx-accent-ink);
}

.nx-readmore::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .25s var(--nx-ease);
}

.nx-lead__link:hover .nx-media img,
.nx-card a:hover .nx-media img,
.nx-video__btn:hover .nx-media img { transform: scale(1.04); }

.nx-lead__link:hover .nx-readmore::after { transform: translateX(3px) rotate(45deg); }

@media (min-width: 768px) {
  .nx-lead__body { padding: 24px 28px 30px; }
}

.nx-briefs {
  padding-top: 4px;
}

@media (min-width: 992px) {
  /* A card matching the lead story, top-aligned with its image; it also keeps the text legible over the hero edge. */
  .nx-briefs {
    padding: 22px 24px 8px;
    border-radius: var(--nx-radius);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow);
  }
}

.nx-briefs__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nx-brief + .nx-brief { border-top: 1px solid var(--nx-line); }

.nx-brief a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
}

.nx-brief h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.nx-brief a:hover h3 { color: var(--nx-accent-ink); }

/* ---------- Videos rail ---------- */
.nx-videos {
  margin-top: 56px;
  padding: 36px 0 40px;
  background: var(--nx-surface-2);
}

.nx-videos__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.nx-videos__head .nx-section-title { margin: 0; }

.nx-rail-controls { display: none; gap: 10px; }

@media (min-width: 768px) {
  .nx-rail-controls:not([hidden]) { display: flex; }
}

.nx-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80vw, 320px);
  gap: 14px;
  margin: 0;
  padding: 4px max(16px, calc((100vw - 1240px) / 2 + 28px)) 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(16px, calc((100vw - 1240px) / 2 + 28px));
  scrollbar-width: none;
  list-style: none;
}

.nx-rail::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .nx-rail { grid-auto-columns: 340px; gap: 18px; }
}

.nx-video { scroll-snap-align: start; }

.nx-video__btn {
  position: relative; /* contains the visually-hidden label so it cannot widen the mobile viewport */
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  color: var(--nx-ink);
  background: none;
  cursor: pointer;
}

.nx-media--video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgb(0 0 0 / .45));
}

.nx-play {
  position: absolute;
  z-index: 1;
  left: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: #22c55e;
  transition: transform .25s var(--nx-ease);
}

.nx-video__btn:hover .nx-play { transform: scale(1.08); }

.nx-play__tri {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #04210f;
}

.nx-video__title {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 650;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Feed ---------- */
.nx-feed-section { margin-top: 48px; }

.nx-feed {
  display: grid;
  gap: 0;
}

.nx-card + .nx-card { border-top: 1px solid var(--nx-line); }

/* Phones: compact rows with a thumbnail; every fourth story opens up full width. */
.nx-card a {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 0;
}

.nx-card .nx-media--card { aspect-ratio: 1 / 1; }

.nx-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

.nx-card a:hover h3 { color: var(--nx-accent-ink); }

.nx-card__summary {
  display: none;
  margin: 8px 0 0;
  color: var(--nx-muted);
  line-height: 1.5;
}

.nx-card__summary:empty { display: none !important; }

.nx-card--wide a {
  grid-template-columns: 1fr;
  gap: 12px;
}

.nx-card--wide .nx-media--card { aspect-ratio: 16 / 9; }

.nx-card--wide h3 {
  font-family: var(--nx-display);
  font-size: 1.35rem;
  font-stretch: 82%;
  font-weight: 800;
  line-height: 1.1;
}

.nx-card--wide .nx-card__summary { display: block; }

/* Feed rhythm repeats every four stories: one feature, then three regular stories.
   Last-row rules below stretch a trailing story so the grid never leaves an empty cell. */
@media (min-width: 768px) {
  .nx-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 28px;
  }

  .nx-card + .nx-card { border-top: 0; }

  .nx-card a {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0;
  }

  .nx-card .nx-media--card { aspect-ratio: 16 / 9; }
  .nx-card h3 { font-size: 1.1rem; }
  .nx-card__summary { display: block; }

  .nx-card--wide,
  .nx-card--span { grid-column: 1 / -1; }

  .nx-card--wide a,
  .nx-card--span a {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }

  .nx-card--wide h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .nx-card:nth-child(4n) { grid-column: 1 / -1; }

  .nx-card:nth-child(4n) a,
  .nx-card:nth-child(4n+2):last-child a {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }

  .nx-card:nth-child(4n+2):last-child { grid-column: 1 / -1; }
}

@media (min-width: 1100px) {
  .nx-feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .nx-card:nth-child(4n+2):last-child { grid-column: 1 / -1; }

  .nx-card:nth-child(4n+2):last-child a {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }

  .nx-card:nth-child(4n+3):last-child { grid-column: span 2; }
}

/* Skeletons shown while more stories load. */
.nx-card--skeleton .nx-media,
.nx-skel-line {
  background: linear-gradient(90deg, var(--nx-surface-2) 0%, var(--nx-line) 50%, var(--nx-surface-2) 100%);
  background-size: 200% 100%;
  animation: nx-shimmer 1.3s linear infinite;
}

.nx-card--skeleton .nx-card__body { display: grid; gap: 8px; }
.nx-skel-line { height: 12px; border-radius: 999px; }
.nx-skel-line--short { width: 40%; }

@keyframes nx-shimmer {
  to { background-position: -200% 0; }
}

.nx-more {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 32px;
}

.nx-more__status {
  margin: 0;
  min-height: 1.4em;
  font-size: .9rem;
  color: var(--nx-muted);
  text-align: center;
}

/* ---------- Closing CTA ---------- */
.nx-cta { margin: 64px auto 72px; }

.nx-cta__panel {
  display: grid;
  gap: 22px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
  background:
    radial-gradient(90% 120% at 100% 0%, rgb(34 197 94 / .14), transparent 60%),
    var(--nx-surface);
}

.nx-cta__copy h2 {
  max-width: 18ch;
  margin: 0 0 10px;
  font-family: var(--nx-display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-stretch: 76%;
  font-weight: 800;
  line-height: 1.02;
}

.nx-cta__copy p {
  max-width: 44ch;
  margin: 0 0 20px;
  line-height: 1.55;
  color: var(--nx-muted);
}

.nx-cta__img {
  justify-self: center;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--nx-radius);
}

@media (min-width: 900px) {
  .nx-cta__panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 40px;
    padding: 44px;
  }
}

/* ---------- Empty state ---------- */
.nx-empty {
  margin: 48px auto;
  text-align: center;
}

.nx-empty h2 {
  font-family: var(--nx-display);
  font-stretch: 78%;
  font-weight: 800;
}

.nx-empty p { color: var(--nx-muted); }

/* ---------- Video player dialog ---------- */
.nx-player {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: var(--nx-radius);
  color: var(--nx-ink);
  background: var(--nx-surface);
  box-shadow: 0 30px 80px rgb(0 0 0 / .5);
}

.nx-player::backdrop {
  background: rgb(5 10 7 / .82);
  backdrop-filter: blur(4px);
}

.nx-player__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
}

.nx-player__title {
  margin: 0;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nx-player__frame {
  aspect-ratio: 16 / 9;
  background: #050806;
}

.nx-player__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .nx-hero__body > * {
    animation: nx-rise .8s var(--nx-ease) both;
  }

  .nx-hero__body > :nth-child(2) { animation-delay: .08s; }
  .nx-hero__body > :nth-child(3) { animation-delay: .16s; }
  .nx-hero__body > :nth-child(4) { animation-delay: .24s; }

  .nx-reveal.is-pending {
    opacity: 0;
    transform: translateY(18px);
  }

  .nx-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity .7s var(--nx-ease), transform .7s var(--nx-ease);
  }

  .nx-player[open] { animation: nx-pop .35s var(--nx-ease); }
}

@keyframes nx-rise {
  from { opacity: 0; transform: translateY(22px); }
}

@keyframes nx-pop {
  from { opacity: 0; transform: scale(.96); }
}

@media (prefers-reduced-motion: reduce) {
  .nx *,
  .nx *::before,
  .nx *::after {
    animation: none !important;
    transition: none !important;
  }
}
