/* ==========================================================================
   1. VARIABLES GLOBALES Y CONFIGURACIÓN RAÍZ
   ========================================================================== */
:root {
  /*  colores */
  --cafe-oscuro: #2c1810;
  --cafe-medio: #6b4226;
  --cafe-claro: #a0724f;
  --crema: #f5e6d3;
  --dorado: #d4af37;
  --dorado-oscuro: #b38f2a;
  --tierra: #8b4513;
  --verde-cafe: #4a5d23;
  --blanco-puro: #ffffff;
  --gris-suave: #f8f8f8;

  /* Sombras consistentes */
  --sombra-suave: 0 4px 6px rgba(44, 24, 16, 0.1);
  --sombra-media: 0 10px 20px rgba(44, 24, 16, 0.15);
  --sombra-fuerte: 0 15px 30px rgba(44, 24, 16, 0.2);

  /* Transiciones */
  --transicion-rapida: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transicion-media: all 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
}

/* ==========================================================================
   2. RESET MODERNO Y ESTILOS BASE
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--cafe-oscuro);
  background-color: var(--blanco-puro);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   3. ENCABEZADO (HEADER)
   ========================================================================== */
/* .encabezado base styles now live in style.css (navbar rebuild)
   Only keep legacy gradient as fallback for non-style.css pages */
.encabezado-legacy {
  background: linear-gradient(135deg, var(--cafe-oscuro) 0%, var(--cafe-medio) 100%);
  padding: 1rem 0;
  box-shadow: var(--sombra-media);
  position: relative;
  z-index: 100;
}

/* Patrón decorativo en el header */
.encabezado::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='20' cy='20' r='2' fill='rgba(212,175,55,0.1)'/%3E%3Ccircle cx='80' cy='40' r='1.5' fill='rgba(212,175,55,0.1)'/%3E%3Ccircle cx='40' cy='80' r='1' fill='rgba(212,175,55,0.1)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* .logo-container styles now live in style.css */

.logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--verde);
  /* <- Esto era un error, pero no lo modifico */
  transition: var(--transicion-media);
  flex-shrink: 0;
  object-fit: cover;
}

.logo:hover {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.3);
}

.titulo-container {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.titulo {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--crema);
  margin-bottom: 0.3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.eslogan {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--dorado);
  font-style: italic;
  font-weight: 400;
  display: block;
}

/* ==========================================================================
   4. NAVEGACIÓN (NAV) — Styles now live in style.css (navbar rebuild)
   ========================================================================== */

/* --- Estilos Generales del Footer --- */
footer {
  /* Fondo marrón llamativo y formal */
  background-color: rgb(0, 0, 0);

  /* Letras formales y claras */
  color: rgb(245, 245, 245);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  padding: 50px 20px;
  text-align: center;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  /* Para que se adapte en móviles */
  justify-content: space-around;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-redes,
.footer-info {
  flex: 1;
  /* Ocupan espacio similar */
  min-width: 300px;
  /* Ancho mínimo antes de apilarse */
  margin: 20px 10px;
}

/* --- Título de Redes --- */
.footer-titulo {
  font-size: 1.5rem;
  /* 24px */
  font-weight: 600;
  color: rgb(255, 255, 255);
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Iconos (Contenedor) --- */
.iconos-redes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  /* Espacio entre iconos */
}

/* --- Iconos (Individual) --- */
a.icono.redondo {
  display: flex;
  /* Para centrar el icono interno (Font Awesome) */
  justify-content: center;
  align-items: center;

  /* Tamaño profesional */
  width: 50px;
  height: 50px;

  border-radius: 50%;
  text-decoration: none;
  /* Importante para que no se subraye el icono */

  /* Sombra sutil para dar profundidad */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

  /* Transición suave para el brillo */
  transition: all 0.3s ease-in-out;
}

/* --- Estilo del icono (la 'i' de Font Awesome) --- */
.icono.redondo i {
  color: #ffffff;
  /* Icono siempre blanco */
  font-size: 24px;
  /* Tamaño del icono */
  transition: all 0.3s ease-in-out;
}

/* --- Efecto de Brillo (Glow) y Colores de Fondo --- */

a.icono.redondo:hover {
  transform: scale(1.15);
  /* Efecto de zoom */
}

/* Facebook: Fondo Azul */
a[href*="facebook.com"] {
  background-color: rgb(24, 119, 242);
}

a[href*="facebook.com"]:hover {
  /* Brillo Azul */
  box-shadow: 0 0 20px 5px rgb(24, 119, 242);
}

/* Instagram: Fondo Gradiente */
a[href*="instagram.com"] {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

a[href*="instagram.com"]:hover {
  /* Brillo Rosa */
  box-shadow: 0 0 20px 5px rgb(225, 48, 108);
}

/* TikTok: Fondo Negro */
a[href*="tiktok.com"] {
  background-color: rgb(1, 1, 1);
}

a[href*="tiktok.com"]:hover {
  /* Brillo Turquesa */
  box-shadow: 0 0 20px 5px rgb(0, 242, 234);
}

/* Efecto extra para TikTok: el icono se vuelve turquesa */
a[href*="tiktok.com"]:hover i {
  color: rgb(0, 242, 234);
}


/* WhatsApp: Fondo Verde */
a[href*="wa.me"] {
  background-color: rgb(37, 211, 102);
}

a[href*="wa.me"]:hover {
  /* Brillo Verde */
  box-shadow: 0 0 20px 5px rgb(37, 211, 102);
}


/* --- Información y Copyright --- */
.footer-info {
  font-size: 0.95rem;
  /* 15px */
  line-height: 1.7;
  color: rgb(230, 230, 230);
}

.footer-contacto {
  font-style: normal;
  /* Quita la cursiva de <address> */
  margin-bottom: 15px;
}

.footer-contacto span {
  display: block;
  /* La dirección en su propia línea */
  margin-bottom: 10px;
}

.footer-info a {
  color: rgb(255, 235, 205);
  /* Un color crema para enlaces */
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-info a:hover {
  color: rgb(255, 255, 255);
  text-decoration: underline;
}

.footer-copyright {
  font-size: 0.8rem;
  /* 12px */
  color: rgb(180, 180, 180);
  margin-top: 20px;
}

.footer-copyright a {
  color: rgb(200, 200, 200);
  text-decoration: underline;
}


/* ==========================================================================
   6. DISEÑO RESPONSIVO (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1050px) {
  .institucional>div:not(.bloque) {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .novedades h2 {
    font-size: 2.2rem;
  }

  .noticia,
  .noticia.revertida {
    flex-direction: column;
    text-align: center;
    padding: 20px 20px 30px;
  }

  .noticia-imagen {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .noticia-imagen img {
    height: 250px;
  }

  .noticia-contenido {
    padding: 0 10px;
  }

  .noticia-contenido h3 {
    text-align: center;
    border-left: none;
    border-right: none;
    padding-left: 0;
    padding-right: 0;
    margin-top: 15px;
  }

  .institucional h2 {
    font-size: 2em;
  }
}

@media (max-width: 480px) {
  .novedades h2 {
    font-size: 1.8rem;
    padding: 8px 15px;
  }

  .intro {
    font-size: 1rem;
    padding: 10px 15px;
  }

  .noticia h3 {
    font-size: 1.3rem;
  }

  .noticia-imagen img {
    height: 200px;
  }

  .institucional h2 {
    font-size: 1.8em;
  }

  .institucional .bloque {
    padding: 20px;
  }

  .redes-sociales h3 {
    font-size: 1.5rem;
  }

  .iconos-redes {
    gap: 15px;
  }

  .icono {
    padding: 8px;
  }

  .icono img {
    width: 30px;
    height: 30px;
  }
}

/* === LOGO COLGANTE DERECHA--------------- === */
.logo-colgante {
  position: fixed;
  top: 80px;
  right: 40px;
  /* Cambiado a la derecha */
  z-index: 1000;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  animation: balanceo 4s ease-in-out infinite;
  transform-origin: top center;
}

/* cuerda visual */
.logo-colgante::before {
  content: "";
  position: absolute;
  top: -80px;
  width: 2px;
  height: 80px;
  background-color: #4e3a23;
}

/* imagen del logo */
.logo-colgante img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.5s ease;
}

/* movimiento de balanceo */
@keyframes balanceo {
  0% {
    transform: rotate(3deg);
  }

  50% {
    transform: rotate(-3deg);
  }

  100% {
    transform: rotate(3deg);
  }
}

/* efecto al hacer clic (activado desde JS) */
.logo-colgante img.mover {
  animation: girar 2s ease-in-out;
}

@keyframes girar {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(-15deg) scale(1.05);
  }

  100% {
    transform: rotate(0deg) scale(1);
  }
}

.logo-link {
  text-decoration: none;
}

/* REGLA GLOBALE PARA IMAGENES (Solicitud Usuario) */
main img,
article img,
section img,
.contenido img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
  /* Evita que se estiren desproporcionadamente */
  display: block;
  /* Elimina espacios extra abajo */
}

/* --- GLOBAL MOBILE OPTIMIZATION (APP-LIKE FEEL) --- */
* {
  box-sizing: border-box;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
    /* Base size reduced */
  }

  body {
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    font-size: 14px;
  }

  h1 {
    font-size: 22px !important;
    line-height: 1.2;
  }

  h2 {
    font-size: 20px !important;
    line-height: 1.3;
  }

  h3 {
    font-size: 18px !important;
  }

  p {
    font-size: 14px !important;
    line-height: 1.5;
  }

  .seccion,
  section {
    padding: 30px 15px !important;
    /* Reduced padding */
  }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Hide floating elements that block view */
  .logo-colgante {
    display: none !important;
  }

  /* Global stacking for flex containers */
  .presentacion-contenido,
  .contacto-layout,
  .bio-contenido,
  .institucional>div:not(.bloque) {
    flex-direction: column !important;
    gap: 30px !important;
  }
}

@media (max-width: 480px) {
  .titulo-seccion {
    font-size: 1.5rem !important;
    margin-bottom: 20px !important;
  }

  .cards {
    gap: 15px !important;
  }
}