:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-muted: #f7f7f7;
  --text: #333333;
  --text-soft: #555555;
  --accent: #ad0000;
  --accent-strong: #ad0000;
  --accent-soft: rgba(173, 0, 0, 0.06);
  --border: rgba(173, 0, 0, 0.14);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  --radius: 20px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a,
button,
input,
textarea,
select {
  font: inherit;
}

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

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.8rem 1rem;
  background: var(--accent);
  box-shadow: none;
}

.top-nav .side-button {
  flex: 1 1 120px;
  min-width: 88px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.top-nav .side-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
  transform: none;
}

.top-nav .side-button.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

.nav-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.un-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.page-wrapper,
.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.content-container,
.hero,
.viewer-card,
.card,
.bloque,
.noticia-card,
.evento-card,
.card-pais,
.stat,
.vacio {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}

.content-container,
.hero,
.viewer-card,
.vacio {
  border-radius: var(--radius);
}

.content-container {
  width: 100%;
  padding: 2rem;
}

.page-header,
.hero {
  position: relative;
  overflow: hidden;
}

.page-header::before,
.hero::before {
  content: none;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(173, 0, 0, 0.1);
}

.main-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem;
}

.eyebrow,
.card-type,
.doc-tag,
.meta-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: #f7f7f7;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--accent-strong);
  line-height: 1.12;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-bottom: 0.7rem;
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  margin-bottom: 0.7rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0;
}

.subtexto,
.section-copy,
.desc,
.intro,
.content-container h3,
.viewer-sub,
.card p,
.noticia-descripcion,
.noticia-snippet,
.evento-body,
.card-linea,
.estado-inscripciones,
.vacio {
  color: var(--text-soft);
}

.section,
.stats,
.cards,
.acciones,
.bloques,
.noticias-listado {
  margin-top: 1.5rem;
}

.noticias-listado,
.cards-paises,
.bloques {
  gap: 1rem;
}

.noticias-listado {
  display: grid;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat {
  border-radius: 20px;
  padding: 1.1rem 1rem;
  text-align: center;
}

.stat strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent-strong);
  font-size: 1.5rem;
}

.section-head,
.hero-top,
.viewer-head,
.noticia-header,
.evento-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cards,
.bloques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card,
.bloque,
.noticia-card,
.evento-card,
.card-pais {
  border-radius: 16px;
  overflow: hidden;
}

.evento-card {
  margin-bottom: 1rem;
}

.card,
.bloque {
  padding: 1.25rem;
}

.card img,
.bloque img,
.hero img,
.evento-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
}

.hero {
  padding: 1.75rem;
}

.hero img {
  max-height: 340px;
  margin-bottom: 1rem;
}

.hero-body,
.bloque-body,
.noticia-content {
  display: grid;
  gap: 0.9rem;
}

.noticia-card,
.evento-card {
  padding: 1.15rem;
}

.noticia-card::before,
.evento-card::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 0.9rem;
}

.noticia-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr);
  gap: 1rem;
  align-items: start;
}

.noticia-media,
.evento-media {
  text-align: center;
}

.evento-body,
.noticia-descripcion,
.contenido {
  white-space: pre-wrap;
}

.fecha,
.news-date,
.contador,
.viewer-title {
  color: var(--accent);
  font-weight: 700;
}

.btn,
.btn-sec,
.instagram-button,
.ver-noticia-button,
.archivo-link,
.inscripcion-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.82rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn,
.instagram-button,
.archivo-link,
.inscripcion-cta.abierto {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.btn-sec,
.ver-noticia-button,
.inscripcion-cta.cerrado {
  background: rgba(159, 15, 24, 0.06);
  color: var(--accent-strong);
  border-color: rgba(159, 15, 24, 0.12);
}

.btn:hover,
.btn-sec:hover,
.instagram-button:hover,
.ver-noticia-button:hover,
.archivo-link:hover,
.inscripcion-cta:hover {
  transform: none;
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.buscador-wrap {
  max-width: 520px;
  margin: 1rem auto 1.5rem;
}

.buscador {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(159, 15, 24, 0.18);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

.buscador:focus {
  outline: none;
  border-color: rgba(159, 15, 24, 0.35);
  box-shadow: 0 0 0 4px rgba(159, 15, 24, 0.08);
}

.tabla-paises {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid rgba(159, 15, 24, 0.12);
}

thead {
  background: rgba(122, 11, 19, 0.94);
}

thead th {
  color: #fff;
  font-weight: 600;
}

th,
td {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(159, 15, 24, 0.08);
  color: var(--text-soft);
}

tbody tr:nth-child(even) {
  background: rgba(159, 15, 24, 0.03);
}

.card-pais {
  padding: 1.15rem;
  text-align: left;
}

.cards-paises {
  display: none;
}

.sin-resultado {
  display: none;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--text-soft);
}

.doc-meta,
.file-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.viewer-card {
  overflow: hidden;
}

.viewer-head {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(159, 15, 24, 0.08);
  background: #fafafa;
}

.visor-wrap,
iframe,
embed {
  width: 100%;
  min-height: 760px;
  border: none;
  background: #fff;
}

.viewer-note {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(159, 15, 24, 0.1);
  color: var(--text-soft);
}

footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--text-soft);
}

.intranet-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.oculto {
  display: none !important;
}

@media (max-width: 780px) {
  .page-wrapper,
  .page-shell,
  footer {
    width: min(100% - 1rem, 1120px);
  }

  .content-container,
  .hero,
  .viewer-head,
  .card,
  .bloque,
  .noticia-card,
  .evento-card,
  .card-pais {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .top-nav {
    gap: 0.45rem;
    padding: 0.7rem;
  }

  .top-nav .side-button {
    flex-basis: calc(50% - 0.45rem);
    min-height: 48px;
    font-size: 0.92rem;
  }

  .noticia-body {
    grid-template-columns: 1fr;
  }

  .acciones {
    flex-direction: column;
  }

  .btn,
  .btn-sec,
  .instagram-button,
  .ver-noticia-button,
  .archivo-link,
  .inscripcion-cta {
    width: 100%;
  }

  table {
    min-width: 560px;
  }

  iframe,
  embed,
  .visor-wrap {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .content-container,
  .hero {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .main-logo {
    width: 88px;
    height: 88px;
  }

  h1 {
    font-size: 1.85rem;
  }

  .cards,
  .bloques,
  .stats {
    grid-template-columns: 1fr;
  }

  .tabla-paises {
    display: none;
  }

  .cards-paises {
    display: grid;
    gap: 1rem;
  }
}
