/* ======================================== */
/* ========== ESTILOS GENERALES ========== */
/* ======================================== */

body {
  margin: 0;
  padding-top: 70px;  /* espacio inicial para header fijo */
  padding-bottom: 60px; /* espacio para footer fijo */
  font-family: 'Segoe UI', sans-serif;
  background-color: #ffffff !important; /* blanco global */
  color: #222;
}

/* Contenedor principal del contenido */
.page-content {
  padding-top: 20px;   /* ajustado debajo del header */
  padding-bottom: 100px;
}

/* Títulos dentro del contenido */
.page-content h1,
.page-content h3 {
  margin-top: 0.5rem;  /* separa del borde superior */
  margin-bottom: 1rem; /* espacio con el siguiente contenido */
}

/* Contenedor con margen reducido */
.container.mt-4 {
  margin-top: 1.5rem;
}

/* ======================================== */
/* ========== HEADER FIJO ================ */
/* ======================================== */

.blaconnect-header {
  background: linear-gradient(90deg, #FFD100 33%, #0033A0 66%, #EF3340);
  color: white;
  padding: 10px 0;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.blaconnect-header .blaconnect-container {
  width: 90%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blaconnect-header-logo {
  height: 62px;
  width: auto;
  border-radius: 50%;
  vertical-align: middle;
}

.blaconnect-nav a {
  color: white;
  text-decoration: none;
  margin: 0 10px;
  font-weight: bold;
}

.blaconnect-nav a:hover {
  text-decoration: underline;
}

/* ======================================== */
/* ======= Submenú Herramientas =========== */
/* ======================================== */
.blaconnect-submenu {
  position: relative;
  display: inline-block;
}

.blaconnect-submenu-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
}

.blaconnect-submenu-btn:hover {
  color: #ffd35b;
}

.blaconnect-submenu-content {
  display: none;
  position: absolute;
  background: #222;
  min-width: 220px;
  z-index: 999;
  border: 1px solid #444;
  border-radius: 6px;
}

.blaconnect-submenu-content a {
  display: block;
  padding: 10px 14px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
}

.blaconnect-submenu-content a:hover {
  background: #333;
}

/* Mostrar menú al pasar */
.blaconnect-submenu:hover .blaconnect-submenu-content {
  display: block;
}
/* ======================================== */
/* ========== MENÚ MÓVIL ================== */
/* ======================================== */

.blaconnect-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  cursor: pointer;
}

.blaconnect-menu-toggle span {
  display: block;
  height: 4px;
  width: 100%;
  background: white;
  border-radius: 2px;
  transition: 0.3s;
}

.blaconnect-menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.blaconnect-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.blaconnect-menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

@media (max-width: 768px) {
  .blaconnect-menu-toggle {
    display: flex;
  }

  .blaconnect-nav {
    display: none;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(90deg, #FFD100 33%, #0033A0 66%, #EF3340);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  }

  .blaconnect-nav.active {
    display: flex;
  }

  .blaconnect-nav a {
    margin: 10px 0;
    font-size: 18px;
  }
}



/* ======================================== */
/* ========== LOGIN ======================== */
/* ======================================== */

.blaconnect-login {
  display: flex;
  flex-direction: column;
  justify-content: center; /* centra vertical */
  align-items: center;     /* centra horizontal */
  min-height: calc(100vh - 70px - 60px); /* viewport menos header y footer */
  padding: 20px;
  text-align: center;
  background: #ffffff;
}

.blaconnect-login h2 {
  font-size: 2rem;
  color: #0033A0;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.blaconnect-login form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 350px; /* ancho máximo */
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(12,50,100,0.08);
}

.blaconnect-login input {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  outline: none;
  transition: 0.3s;
}

.blaconnect-login input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 5px rgba(13,110,253,0.4);
}

.blaconnect-login .blaconnect-boton {
  background: #0d6efd;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.blaconnect-login .blaconnect-boton:hover {
  background: #084298;
}

.blaconnect-login p {
  color: red;
  font-weight: 500;
  margin: 0 0 10px;
}


/* ======================================== */
/* ========== CARDS / TARJETAS =========== */
/* ======================================== */

.card {
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(12,50,100,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(12,50,100,0.15);
}

.card .btn {
  border-radius: 6px;
  font-weight: 600;
}

/* Ajuste de margen superior para cards dentro del contenido */
.card.shadow-lg {
  margin-top: 1rem;
}

/* ======================================== */
/* ========== FOOTER ====================== */
/* ======================================== */

.blaconnect-footer {
  background: #222;
  color: #ddd;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-top: 1px solid #444;

  height: 25px;          /* Grosor del footer */
  line-height: 25px;     /* Igual que height para centrar perfectamente */

  text-align: center;
  font-size: 10px;       /* Proporcional a la altura */
}

.blaconnect-footer-banner {
  position: fixed;
  right: clamp(16px, 5vw, 72px);
  bottom: calc(25px + 22px);
  z-index: 101;
  width: min(310px, calc(100vw - 32px));
  pointer-events: none;
}

.blaconnect-footer-banner[hidden] {
  display: none;
}

.blaconnect-footer-banner-inner {
  width: 100%;
}

.blaconnect-footer-banner-card {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  padding: 14px 16px 14px 14px;
  border: 1px solid rgba(0, 51, 160, 0.15);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

.blaconnect-footer-banner-avatar {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #f4c430;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.blaconnect-footer-banner-avatar img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.blaconnect-footer-banner-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  color: #222;
  padding-right: 24px;
  font-size: 13px;
  line-height: 1.35;
}

.blaconnect-footer-banner-copy strong {
  color: #0033A0;
  font-size: 15px;
  line-height: 1.2;
}

.blaconnect-footer-banner-copy span {
  color: #4b5563;
}

.blaconnect-footer-banner-link {
  justify-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f4c430;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.blaconnect-footer-banner-link:hover,
.blaconnect-footer-banner-link:focus {
  background: #e0b81f;
  color: #111;
}

.blaconnect-footer-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 51, 160, 0.16);
  border-radius: 50%;
  background: #fff;
  color: #343a40;
  font-size: 18px;
  line-height: 1;
}

.blaconnect-footer-banner-close:hover,
.blaconnect-footer-banner-close:focus {
  border-color: #0033A0;
  color: #0033A0;
  outline: none;
}

@media (max-width: 768px) {
  .blaconnect-footer {
    display: none;
  }

  .blaconnect-footer-banner {
    right: 12px;
    bottom: 12px;
    width: min(300px, calc(100vw - 24px));
  }

  .blaconnect-footer-banner-card {
    grid-template-columns: 62px 1fr;
    padding: 12px;
  }

  .blaconnect-footer-banner-avatar {
    width: 62px;
    height: 62px;
  }

  .blaconnect-footer-banner-avatar img {
    width: 52px;
    height: 52px;
  }

  .blaconnect-footer-banner-copy {
    padding-right: 22px;
    font-size: 12px;
  }

  .blaconnect-footer-banner-copy strong {
    font-size: 14px;
  }

  .blaconnect-footer-banner-link {
    padding: 6px 10px;
  }
}


/* ======================================== */
/* ========== LOGO + NOMBRE LATERAL ======= */
/* ======================================== */

.blaconnect-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blaconnect-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.blaconnect-logo {
  height: 60px;
  width: auto;
  border-radius: 50%;
}

.blaconnect-nombre {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* ======================================== */
/* ========== ESTILO PERFIL ================= */
/* ======================================== */

.perfil-portada {
  height: 8px;
  background-color: #0d6efd;
  border-radius: .75rem .75rem 0 0;
  position: relative;
}

.perfil-avatar {
  width: 120px;         /* tamaño visual en la página */
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: auto; /* evita pixelación en PC */
}


.perfil-header {
  margin-top: 20px;
}

.perfil-nombre {
  font-size: 1.6rem;
  font-weight: 700;
  color: #212529;
}

.perfil-datos li {
  padding: .75rem 1rem;
}

/* Mostrar correctamente input file en perfil */
.card-body input[type="file"] {
  display: inline-block;
  width: 100%;
  padding: 6px 12px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #212529;
}


/* ======================================== */
/* ===== PERFIL DE USUARIO - DISEÑO ======= */
/* ======================================== */
  .blaconnect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  .blaconnect-card {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
  }
  .blaconnect-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  }
  .blaconnect-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
  }
  .blaconnect-card-body {
    padding: 1rem 1.25rem;
  }
  .blaconnect-card h5 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }
  .blaconnect-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
  }
  .blaconnect-card small {
    font-size: 0.8rem;
    color: #888;
  }
  @media (max-width: 576px) {
    .blaconnect-card img {
      height: 140px;
    }
  }

/* ======================================== */
/* ===== PERFIL DE USUARIO - DISEÑO ======= */
/* ======================================== */


/* === CONTENEDOR GENERAL === */
.perfil-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* === PANEL PERFIL (IZQUIERDA) === */
.perfil-info {
  flex: 0 0 320px;
  max-width: 320px;
  position: sticky;
  top: 90px;
  align-self: flex-start;
}

/* === PERFIL DETALLE === */
.perfil-detalle {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  text-align: center;
  padding: 20px;
}

.perfil-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}

.perfil-avatar-sm {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
}

/* === RESUMEN (solo móvil) === */
.perfil-resumen {
  display: none;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  padding: 15px;
  text-align: center;
}

.toggle-icon {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
  margin-top: 3px;
}
.toggle-icon.rotar {
  transform: rotate(180deg);
}

/* === DETALLE EXPANDIBLE MÓVIL === */
.perfil-detalle {
  overflow: hidden;
  transition: all 0.4s ease;
}
.perfil-detalle.activo {
  max-height: 1000px;
  opacity: 1;
}

/* === PUBLICACIONES (DERECHA) === */
.perfil-publicaciones {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  max-height: calc(100vh - 160px);
}

/* === TARJETAS PUBLICACIÓN === */
.perfil-publicaciones .card {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 15px;
}

/* ======================================== */
/* ========== VISTA ESCRITORIO ============ */
/* ======================================== */
@media (min-width: 992px) {
  .perfil-wrapper {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    height: calc(100vh - 160px);
  }

  .perfil-info {
    display: block;
  }

  .perfil-publicaciones {
    overflow-y: auto;
    max-height: calc(100vh - 160px);
  }

  .perfil-resumen {
    display: none;
  }

  .perfil-detalle {
    max-height: none;
    opacity: 1;
  }
}

/* ======================================== */
/* ============ VISTA MÓVIL =============== */
/* ======================================== */
@media (max-width: 991px) {
  .perfil-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }

  .perfil-info {
    width: 100%;
    max-width: 100%;
    position: relative;
    top: 0;
    margin-bottom: 0;
  }

  .perfil-resumen {
    display: flex;
    margin-bottom: 0;
  }

  .perfil-detalle {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
  }

  .perfil-detalle.activo {
    max-height: 1000px;
    opacity: 1;
    padding: 15px;
    margin-top: 5px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    background: #fff;
  }

  .perfil-publicaciones {
    max-height: none;
    overflow: visible;
    margin-top: 5px;
  }
}

/* ======================================== */
/* PERFIL DE USUARIO - CORRECCIÓN FINAL */
/* ======================================== */

/* Mantiene el layout horizontal en PC */
.perfil-wrapper {
  display: flex;
  gap: 20px;
}

/* ======== SOLO EN MÓVILES ======== */
@media (max-width: 768px) {
  .perfil-wrapper {
    display: block;
    gap: 0;
  }

  .perfil-info {
    margin-bottom: 10px;
  }

  .perfil-detalle {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
  }

  .perfil-publicaciones {
    margin-top: 0 !important;
  }

  /* Ocultar detalle inicialmente solo en móviles */
  #perfilDetalle {
    display: none;
    transition: all 0.3s ease;
  }

  #perfilDetalle.activo {
    display: block;
  }
}

/* ======== ESCRITORIO ======== */
@media (min-width: 769px) {
  #perfilDetalle {
    display: block !important;
    opacity: 1;
  }
}

/* Icono rotatorio del toggle */
.toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-icon.rotar {
  transform: rotate(180deg);
}

/* ======================================== */
/* ==== CORRECCIÓN GLOBAL DE FONDO BLANCO ==== */
/* ======================================== */

html, body {
  background-color: #ffffff !important;
  background: #ffffff !important;
}

main, section, article, aside, .container, .page-content, .perfil-wrapper {
  background-color: #ffffff !important;
  background: #ffffff !important;
}

/* ======================================== */
/* ========== EDITOR DE NOTICIAS ========== */
/* ======================================== */

.rahc-editor {
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.rahc-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.rahc-editor-toolbar button,
.rahc-editor-block {
  min-height: 36px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  color: #212529;
  font-size: 14px;
}

.rahc-editor-toolbar button {
  min-width: 36px;
  padding: 0 10px;
  font-weight: 600;
}

.rahc-editor-toolbar button:hover,
.rahc-editor-toolbar button:focus,
.rahc-editor-block:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
  outline: none;
}

.rahc-editor-block {
  width: 150px;
  padding: 0 8px;
}

.rahc-editor-surface,
.rahc-editor-source {
  width: 100%;
  min-height: 420px;
  padding: 18px;
  border: 0;
  outline: none;
  background: #fff;
  color: #212529;
  line-height: 1.65;
}

.rahc-editor-surface {
  overflow-y: auto;
}

.rahc-editor-surface:focus {
  box-shadow: inset 0 0 0 2px rgba(13, 110, 253, 0.18);
}

.rahc-editor-surface:empty::before {
  content: attr(data-placeholder);
  color: #6c757d;
  pointer-events: none;
}

.rahc-editor-surface h2,
.rahc-editor-surface h3,
.rahc-editor-surface h4 {
  color: #0033A0;
  margin-top: 1.25rem;
}

.rahc-editor-surface blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #0d6efd;
  background: #f8f9fa;
}

.rahc-editor-surface pre {
  padding: 0.75rem;
  border-radius: 6px;
  background: #f1f3f5;
  white-space: pre-wrap;
}

.rahc-editor .rahc-editor-source {
  display: none;
  border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.rahc-editor.is-source-mode .rahc-editor-surface {
  display: none;
}

.rahc-editor.is-source-mode .rahc-editor-source {
  display: block;
}

.rahc-editor-help {
  padding: 8px 12px;
  border-top: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 13px;
}

.rahc-editor-error {
  padding: 8px 12px;
  border-top: 1px solid #f5c2c7;
  color: #842029;
  background: #f8d7da;
  font-size: 14px;
}

@media (max-width: 768px) {
  .rahc-editor-toolbar {
    gap: 5px;
  }

  .rahc-editor-block {
    flex: 1 1 100%;
    width: 100%;
  }

  .rahc-editor-toolbar button {
    min-width: 34px;
    padding: 0 8px;
  }

  .rahc-editor-surface,
  .rahc-editor-source {
    min-height: 340px;
    padding: 14px;
  }
}

/* ======================================== */
/* ========== GALERIA DE NOTICIAS ========= */
/* ======================================== */

.rahc-gallery-preview,
.rahc-gallery-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rahc-gallery-preview-item,
.rahc-gallery-manager-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.rahc-gallery-preview-item img,
.rahc-gallery-manager-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f1f3f5;
}

.rahc-gallery-preview-item span,
.rahc-gallery-radio,
.rahc-gallery-delete {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 14px;
}

.rahc-gallery-delete {
  border-top: 1px solid #f1f3f5;
  color: #842029;
}

.rahc-gallery-manager-item.is-removing {
  opacity: 0.55;
}

.noticia-gallery {
  width: 100%;
}

.noticia-gallery-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
}

.noticia-gallery-main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.noticia-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 56px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 36px;
  line-height: 1;
}

.noticia-gallery-arrow:hover,
.noticia-gallery-arrow:focus {
  background: rgba(0, 51, 160, 0.88);
  outline: none;
}

.noticia-gallery-arrow.is-prev {
  left: 12px;
}

.noticia-gallery-arrow.is-next {
  right: 12px;
}

.noticia-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.noticia-gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.noticia-gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.noticia-gallery-thumb.is-active {
  border-color: #0d6efd;
}

.noticia-gallery-thumb:hover,
.noticia-gallery-thumb:focus {
  border-color: #0033A0;
  outline: none;
}

@media (max-width: 768px) {
  .noticia-gallery-main {
    aspect-ratio: 4 / 3;
  }

  .noticia-gallery-arrow {
    width: 36px;
    height: 48px;
    font-size: 30px;
  }

  .noticia-gallery-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
