/* ========================================================
   REGLAS GENERALES
======================================================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Contenedor principal bajo header fijo */
.contenedor-principal {
  width: 100%;
  max-width: 1200px;
  margin: 90px auto 0 auto;
  padding: 0 20px;
  clear: both;
}

/* ========================================================
   SECCIÓN SUPERIOR (Glosarios + Noticias)
======================================================== */
.seccion-superior {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 20px;
  align-items: center;
  width: 100%;
}

@media (min-width: 800px) {
  .seccion-superior {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
  }
}

/* ========================================================
   GRID CORPORATIVO
======================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 2rem;
}

.box {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform .3s, box-shadow .3s;
  border: 1px solid rgba(0,0,0,0.05);
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.box:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.box img {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
}

.box p {
  padding: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #2c3e50;
}

/* GRID RESPONSIVE */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   HEADER CORPORATIVO
======================================================== */
header.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: rgba(10, 35, 70, 0.75);
  backdrop-filter: blur(10px);
  color: #fff;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

nav.nav {
  display: flex;
  gap: 2rem;
}

nav.nav a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: opacity .3s;
}

nav.nav a:hover {
  opacity: 0.7;
}

/* Menú móvil */
button.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

button.hamburger span {
  width: 28px;
  height: 3px;
  background: #fff;
  transition: .3s;
}

@media (max-width: 768px) {
  nav.nav {
    position: fixed;
    top: 0;
    right: -260px;
    height: 100vh;
    width: 260px;
    background: rgba(10, 35, 70, 0.9);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 5rem 2rem;
    gap: 2rem;
    transition: right .4s ease;
  }
  nav.nav.active {
    right: 0;
  }
  button.hamburger {
    display: flex;
  }
  button.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  button.hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  button.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* ========================================================
   NOTICIAS (RESPONSIVE)
======================================================== */
.noticias-index {
  width: 100%;
  max-width: 600px;
}

.news-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.flecha {
  font-size: 40px;
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.flecha:hover {
  background: #45a049;
}

.news-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  height: 300px;
  border: 2px solid black;
  overflow: hidden;
  background: white;
  margin: auto;
}

.newsbox {
  position: relative;
  width: 100%;
  left: 0;
  top: 0;
  background: Lavender;
  padding: 10px;
}

.noticia-item {
  margin-bottom: 20px;
}

/* Noticias móvil */
@media (max-width: 600px) {
  .news-container {
    height: 240px;
  }
  .flecha {
    font-size: 32px;
    padding: 8px 14px;
  }
}

/* ========================================================
   CAJA RSS
======================================================== */
.suscribir-noticias {
  margin: 40px auto;
  padding: 25px;
  max-width: 600px;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.suscribir-noticias h3 {
  margin-bottom: 10px;
  color: #0a2346;
}

.suscribir-noticias p {
  margin-bottom: 20px;
  color: #333;
}

.boton-rss {
  display: inline-block;
  padding: 10px 20px;
  background: #0a2346;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}

.boton-rss:hover {
  background: #153a7a;
}

/* ========================================================
   FOOTER CORPORATIVO — VERSIÓN COMPACTA
======================================================== */

#footer, .footer {
  clear: both;
  display: block;
  width: 100%;
  background: #0a2346;
  color: #dce3ec;
  padding: 2rem 1.5rem 0.5rem;   /* Antes 3rem → ahora 2rem */
  margin-top: 3rem;              /* Antes 4rem → ahora 3rem */
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;                   /* Antes 2rem → ahora 1.2rem */
  max-width: 1200px;
  margin: auto;
}

.footer-col h3,
.footer-col h4 {
  margin-bottom: 0.6rem;         /* Antes 1rem → ahora 0.6rem */
  color: #ffffff;
}

.footer-col p,
.footer-col a {
  font-size: 0.9rem;             /* Antes 0.95rem → ahora 0.9rem */
  line-height: 1.4;              /* Antes 1.6 → ahora 1.4 */
  margin: 0 0 0.3rem 0;          /* Más compacto */
}

.footer-col ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;                   /* Antes 1rem → ahora 0.8rem */
}

.social a {
  color: #dce3ec;
  text-decoration: none;
}

.social a:hover {
  color: #ffffff;
}

.footer-bottom {
  text-align: center;
  margin-top: 1.2rem;            /* Antes 2rem → ahora 1.2rem */
  padding-top: 0.8rem;           /* Antes 1rem → ahora 0.8rem */
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.8rem;             /* Antes 0.85rem → ahora 0.8rem */
  color: #c7d0db;
}

/* ========================================================
   FOOTER RESPONSIVE COMPACTO
======================================================== */

/* Tablet */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Móvil */
@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social {
    justify-content: center;
  }

  #footer, .footer {
    padding: 1.5rem 1rem 0.5rem; /* Más compacto aún en móvil */
    margin-top: 2rem;
  }
}
