body, .homepage {
  margin: 0 !important;
  padding: 0 !important;
}

.hero-banner {
  background: url("/fondo.png") center center / cover no-repeat;
  min-height: 100vh; /* ocupar pantalla completa siempre */
  align-items: center;
  padding-top: 60px;  /* espacio por si hay header fijo */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--black-overlay-light);     /* overlay suave */
}

.hero-content {
  position: relative;              /* arriba del overlay */
  z-index: 1;
}

html, body {
    min-height: 100vh; /* Usa min-height en lugar de height fijo */
    display: flex;
    flex-direction: column;
}

/* El contenedor principal debe crecer para ocupar el espacio */
.main {
    flex: 1 0 auto; 
    width: 100%;
    min-height: auto !important; /* Reseteamos para evitar conflictos */
}

.btn-primary{
  background-color: var(--blue) !important;
  border-color: var(--blue) !important;
}

.masthead {
  background: var(--blue) !important;
}

.site-footer {
  background: var(--blue) !important;
  color: var(--white) !important;
}

.site-footer-border{
  border-top: 1px solid var(--white);
}

.account-masthead{
  background: var(--regal-blue) !important;
}

.announcements-container {
  padding: 0px !important;
}
/* ---- LOGOS EN CABECERA ---- */

/* Contenedor para alinear ambos logos horizontalmente */
.masthead .cba-header-logos {
  display: flex;
  align-items: center;
  gap: 16px; /* separación entre logos */
}

/* Logo principal CKAN */
.masthead .logo img {
  max-height: 45px !important;
  height: auto !important;
  width: auto !important;
  display: block;
}

/* Segundo logo (Ministerio) */
.masthead .logo-extra {
  display: flex;
  align-items: center;
}

.masthead .logo-extra img {
  max-height: 45px !important;
  height: auto !important;
  width: auto !important;
  display: block;
}

/* Escudo */
.cba-header-escudo {
  display: flex;
  align-items: center;
}

.cba-header-escudo img {
  max-height: 60px !important;
  height: auto !important;
  width: auto !important;
  display: block;
}

/* Flex para container y navbar */
.masthead .container {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  width: 100%;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .masthead .logo img,
  .masthead .logo-extra img {
    max-height: 40px;
  }
  .cba-header-escudo img {
    max-height: 50px;
  }
}

@media (max-width: 768px) {
  .masthead .cba-header-logos {
    gap: 8px; /* menos espacio entre logos */
  }
  .masthead .logo img,
  .masthead .logo-extra img {
    max-height: 32px; /* achicar en mobile */
  }
  .cba-header-escudo img {
    max-height: 40px;
  }
}

.logo-footer img {
  width: 24px;
}

.text-footer {
  font-size: 0.8rem;
  text-align: right;
  width: 100%;
}

.site-footer .language-selector {
  width: 150px;
  text-align: right;
}

/* Texto "Dirección General de Estadística y Censos" */
.footer-bottom-text {
    font-size: 0.8vw;
    color: var(--white);
    margin: 0;
}

/* Contenedor del enlace/logo */
.footer-logo-link {
    display: inline-block;
}

/* Logo inferior */
.footer-logo-img {
    max-height: 40px;
}

/* PANEL CONTENEDOR */
.featured-panel {
  margin: 0 auto;
  background: var(--white-overlay-medium);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px var(--black-border-light);
  backdrop-filter: blur(6px);
}

.panel-separator {
  border: 0;
  height: 1px;
  background: var(--black-border-light);
  margin: 28px 0;
}

.featured-header {
  margin-bottom: 12px;
}

.featured-title {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--blue);
  color: var(--white);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

/* LINKS */
.dataset-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* CARDS */
.dataset-card {
  height: 100%;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--black-border-medium);
  padding: 16px;
  box-shadow: 0 6px 18px var(--black-border-medium);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dataset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px var(--black-shadow-light);
}

.dataset-title {
  margin: 0 0 8px 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: var(--blue);
  text-align: center;
}

.dataset-desc {
  margin: 0 0 12px 0;
  color: var(--black);
  font-size: 13px;
  line-height: 18px;
}

.dataset-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--blue);
  font-size: 12px;
}

.dataset-meta i {
  margin-right: 6px;
}

/* =========================
   AJUSTE FINO HEADER (como maqueta) - FIX
   2 filas:
   - Fila 1: logos izq + escudo der
   - Fila 2: menú izq (full) + buscador der (fijo)
   ========================= */

.masthead nav.navbar{
  display: grid !important;
  grid-template-columns: 1fr auto;  /* menú ocupa, search ajusta */
  grid-template-rows: auto auto;    /* 2 filas */
  row-gap: 8px;
  width: 100%;
}

/* Fila 1: hgroup ocupa toda la fila */
.masthead nav.navbar hgroup{
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logos izq */
.masthead .cba-header-logos{
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Escudo der (dentro de header_logo) */
.masthead nav.navbar hgroup .cba-header-escudo{
  margin-left: auto;
  display: flex;
  align-items: center;
}
.masthead nav.navbar hgroup .cba-header-escudo img{
  height: 36px !important;
  width: auto !important;
}

/* Fila 2: main-navbar en columna 1 */
.masthead nav.navbar .main-navbar{
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  border-top: 1px solid var(--white-border-light);
  padding-top: 6px;

  /* IMPORTANTE: que no rompa la grilla */
  display: block !important;
}

/* UL del menú: que se comporte bien con pocos items */
.masthead nav.navbar .main-navbar > ul.navbar-nav{
  width: 100% !important;
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 !important;

  /* elegí 1 de estas 2 según maqueta */
  justify-content: flex-start; /* o center */
}

/* Fila 2: buscador en columna 2 (ojo: el form está DENTRO de .main-navbar) */
.masthead nav.navbar .main-navbar form.site-search{
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: center;

  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;

  /* Para sacarlo del flow interno del main-navbar */
  position: relative;
  z-index: 2;
}

/* Input buscador */
.masthead nav.navbar .main-navbar #field-sitewide-search{
  height: 30px !important;
  width: 280px;
  background: var(--white) !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
}

/* Botón */
.masthead nav.navbar .main-navbar form.site-search button{
  height: 30px !important;
  padding: 0 10px;
}


/* ===== Fila 2: menú + buscador en la MISMA línea ===== */
.masthead nav.navbar .main-navbar{
  /* sigue estando en la fila 2 del nav-grid */
  grid-column: 1 / -1;
  grid-row: 2;

  /* ahora el layout interno lo maneja grid */
  display: grid !important;
  grid-template-columns: 1fr auto;  /* ul ocupa, form ajusta */
  align-items: center;              /* MISMA altura */
  column-gap: 16px;

  width: 100%;
  border-top: 1px solid var(--white-border-light);
  padding: 6px 16px 0 16px !important;
}

/* UL a la izquierda */
.masthead nav.navbar .main-navbar > ul.navbar-nav{
  margin: 0 !important;
  width: 100% !important;

  display: flex !important;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;          /* si hay muchos items baja prolijo */
  justify-content: flex-start; /* o center */
}

/* Form a la derecha, alineado */
.masthead nav.navbar .main-navbar form.site-search{
  margin: 0 !important;
  justify-self: end;
  align-self: center;

  display: flex;
  align-items: center;
  gap: 8px;
}

/* Input + botón (por si algo lo pisa) */
.masthead nav.navbar .main-navbar #field-sitewide-search{
  height: 30px !important;
  width: 280px;
  background: var(--white) !important;
  border: 0 !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
}
.masthead nav.navbar .main-navbar form.site-search button{
  height: 30px !important;
  padding: 0 10px;
}
.custom-navbar-wrapper{
  display:flex;
  flex-direction: column;   /* uno arriba del otro */
  gap: 10px;
}

/* cada fila horizontal */
.navbar-row{
  display:flex;
  flex-direction: row;      /* horizontal */
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ===== ESTILOS DE ENLACES DEL MENÚ ===== */

.custom-navbar-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
  font-weight: 500;
  font-size: 14px;
  position: relative;
}

.menu-label {
  display: inline-block;
}

.menu-count-label {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  padding: 3px 8px;
  border-radius: 0 0 4px 4px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  background: inherit;
  color: inherit;
}

.menu-economia:hover .menu-count-label,
.menu-poblacion:hover .menu-count-label,
.menu-sociedad:hover .menu-count-label,
.menu-territorio:hover .menu-count-label {
  display: inline-block;
}

/* ===== ESTILOS DE CATEGORÍAS EN MENÚ ===== */

/* Menú Economía */
.menu-economia:hover {
  background-color: var(--economia) !important;
  color: var(--black) !important;
}

/* Menú Población */
.menu-poblacion:hover {
  background-color: var(--poblacion) !important;
  color: var(--white) !important;
}

/* Menú Sociedad */
.menu-sociedad:hover {
  background-color: var(--sociedad) !important;
  color: var(--black) !important;
}

/* Menú Territorio */
.menu-territorio:hover {
  background-color: var(--territorio) !important;
  color: var(--white) !important;
}

/* ===== BOTÓN INICIO EN MENÚ ===== */

.btn-inicio-link {
  color: var(--white) !important;
  border: 2px solid var(--blue) !important;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  transition: all 200ms ease;
}

.btn-inicio-link:hover {
  background-color: var(--seagull) !important;
  color: var(--white) !important;
  transform: translateY(-2px);
}

.btn-inicio-link i {
  font-size: 16px;
}
/*
Definir los colores principales como variables a reutilizar
*/
:root {
    --regal-blue: #172c3f;
    --finn: #53284f;
    --seagull: #6aade4;
    --tangaroa: #031e2f;
    --westar: #e0d3d8;
    --blue: rgb(0, 69, 130);
    --black: #000000;
    --white: #ffffff;
    --black-overlay-light: rgba(0, 0, 0, 0.25);
    --black-border-light: rgba(0, 0, 0, 0.12);
    --black-border-medium: rgba(0, 0, 0, 0.06);
    --black-shadow-light: rgba(0, 0, 0, 0.10);
    --white-overlay-medium: rgba(255, 255, 255, 0.52);
    --white-border-light: rgba(255, 255, 255, 0.25);
    /* Colores de categorías */
    --economia: #A6D318;
    --poblacion: #F96812;
    --sociedad: #F4BE2A;
    --territorio: #19A1C7;
}
