﻿body {
  font-family: 'Inter', sans-serif;
  background-color: #f8f9fa;
}

h1, h2, h3, h4, h5 {
  font-family: 'Lexend', sans-serif;
  margin-top: 20px;
}

.h5.underline {
  text-decoration: underline;
}

header {
  width: 100vw; /* Ocupa todo el ancho de la ventana */
  background-image: url('../img/RGAPA_banner.jpg');
  background-size: auto 220px;
  background-repeat: no-repeat;
  background-position: bottom;
  background-color: #0069b4;
  color: white;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  height: 220px;
  display: flex;
  align-items: center;  /* Centra verticalmente */
  justify-content: center; /* Centra horizontalmente */
  padding: 0 1rem; /* Pequeño padding lateral para evitar que el texto toque bordes */
  box-sizing: border-box;
}

header h1 {
  margin: 0;
  font-weight: 700;
}

h2[role="button"] {
  cursor: pointer;
}

footer {
  background-color: #0069b4;
  color: white;
  padding: 1rem 0;
  font-size: 0.9rem;
}

.navbar-brand img {
  height: 40px;
  margin-right: 10px;
}

#map {
  width: 95%;
  height: calc(80vh - 140px);
  border: 1px solid #ccc;
  margin: 0 auto; /* Centra horizontalmente */
}

/* Estilos corregidos para el popup de OpenLayers */
.ol-popup {
  position: absolute;
  background-color: white;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 10px;
  min-width: 250px;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 1;
  z-index: 1000;
}

.ol-popup table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ol-popup th, .ol-popup td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  color: #333;
}

.ol-popup th {
  background-color: #f7f7f7;
  font-weight: 600;
}

.enlaces-cabecera {
  background-color: #003366; /* azul institucional */
  font-size: 0.85rem;
  padding: 4px 0;
  text-align: right; /* Alinea todo a la derecha */
}

.enlaces-cabecera a {
  text-decoration: none;
  color: white;
}

.enlaces-cabecera a:hover {
  text-decoration: underline;
}

.enlaces-cabecera .list-inline-item {
  margin-right: 4px;
}

.enlaces-cabecera .list-inline-item:not(:last-child)::after {
  content: " |";
  color: white;
  padding-left: 1px;
}
/* Contenedor principal de noticias */
#main-noticias {
  margin-top: 2rem;
}

/* Acordeón de noticias */
.accordion-button {
  background-color: #0069b4; /* azul institucional */
  color: white;
  font-weight: 600;
}

.accordion-button:not(.collapsed) {
  background-color: #ffe55d; /* amarillo cuando está abierto */
  color: white;
}

.accordion-button::after {
  filter: invert(1); /* hace que la flecha sea blanca */
}

/* Estilos de noticias */
.accordion-body .card {
  border: 1px solid #0069b4;
  border-radius: 0.5rem;
  background-color: #f8f9fa; /* mismo que el body */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.accordion-body .card-header {
  background-color: #e9f2fb; /* tono muy suave del azul institucional */
  color: #003366;
  font-weight: 600;
}

.accordion-body .card-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #333;
}

.accordion-body img {
  display: block;
  margin: 0.5rem auto; 
  max-width: 100%;       
  max-height: 300px;    
  object-fit: cover;     
  border-radius: 0.25rem;
}

/* Spinner de carga */
#cargando {
  text-align: center;
  margin-top: 2rem;
}

#cargando .spinner-border {
  width: 3rem;
  height: 3rem;
  color: #0069b4;
}

#cargando p {
  margin-top: 0.5rem;
  color: #003366;
  font-weight: 500;
}

/* Ajuste para móviles */
@media (max-width: 576px) {
  header {
    height: 160px; /* Más alto para que no quede aplastado */
    background-size: cover;/* Cubrir tamaño imagen */
	background-position: center top; /* Centra horizontalmente y mueve el foco arriba */	
  }

  header h1 {
    font-size: 1.25rem; /* Ajusta tamaño texto para móviles */
  }

  .enlaces-cabecera {
    font-size: 0.8rem;
    text-align: center; /* En móvil centramos para mejor lectura */
  }
 .ol-popup {
    min-width: auto; /* quita el min-width fijo */
    width: 80vw; /* 80% del ancho de la ventana móvil */
    max-width: 80vw;
    left: 10vw !important; /* para evitar que se pegue a los bordes */
    right: 10vw !important;
    box-sizing: border-box;
    font-size: 0.75rem;
  }

  .ol-popup table {
    font-size: 0.75rem;
    word-break: break-word; /* para evitar que celdas largas causen scroll */
    overflow-wrap: break-word;
  }

  .ol-popup th, .ol-popup td {
    padding: 4px 6px;
  }	
}