html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ── Footer ── */
.ingesis-footer {
  background-color: steelblue;
  color: white;
  text-align: center;
  padding: 5px;
}

.ingesis-footer-link {
  color: white;
  text-decoration: underline;
}

/* ── Navbar search widget ── */
.navbar-search-wrapper {
  position: relative;
}

#navSearchForm {
  display: flex;
  align-items: center;
}

#navSearchInput {
  width: 0;
  padding: 0;
  border: none;
  border-radius: 20px 0 0 20px;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 0.875rem;
  transition: width 0.3s ease, padding 0.3s ease;
  outline: none;
}

#navSearchInput::placeholder { color: rgba(255,255,255,0.55); }

#navSearchInput.expanded {
  width: 220px;
  padding: 0.3rem 0.75rem;
}

@media (max-width: 991px) {
  #navSearchInput.expanded { width: 100%; }
  #navSearchInput { width: 100%; padding: 0.3rem 0.75rem; border-radius: 20px 0 0 20px; }
}

#navSearchToggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  border-radius: 0 20px 20px 0;
  padding: 0.28rem 0.65rem;
  transition: background 0.2s;
  cursor: pointer;
  font-size: 0.9rem;
}

#navSearchToggle:hover { background: rgba(255,255,255,0.15); }

#navSearchSuggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1060;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

@media (max-width: 991px) {
  #navSearchSuggestions { width: 100%; right: auto; left: 0; }
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #222;
  transition: background 0.13s;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover,
.suggestion-item.active { background: #f0f6ff; }

.suggestion-icon {
  color: #005197;
  font-size: 1.1rem;
  min-width: 1.3rem;
  text-align: center;
}

.suggestion-text { flex: 1; min-width: 0; }

.suggestion-title {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-desc {
  font-size: 0.72rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}

.suggestion-footer {
  padding: 0.45rem 1rem;
  font-size: 0.76rem;
  color: #888;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
}

.suggestion-footer:hover { background: #f0f6ff; color: #005197; }

/* dark mode for search */
[data-bs-theme="dark"] #navSearchInput {
  background: rgba(255,255,255,0.1);
  color: white;
}

[data-bs-theme="dark"] #navSearchSuggestions {
  background: #1e1e1e;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] .suggestion-item {
  color: #e0e0e0;
  border-bottom-color: #333;
}

[data-bs-theme="dark"] .suggestion-item:hover,
[data-bs-theme="dark"] .suggestion-item.active { background: #2a3a50; }

[data-bs-theme="dark"] .suggestion-icon { color: #6ea8fe; }
[data-bs-theme="dark"] .suggestion-desc { color: #aaa; }
[data-bs-theme="dark"] .suggestion-footer { background: #181818; color: #aaa; }
[data-bs-theme="dark"] .suggestion-footer:hover { color: #6ea8fe; background: #1e2a3a; }

/* ── Modo oscuro ── */
[data-bs-theme="dark"] body {
  background-color: #121212;
  color: #e0e0e0;
}

[data-bs-theme="dark"] .ingesis-footer {
  background-color: #1a3a4a;
}

[data-bs-theme="dark"] .navbar.bg-dark {
  background-color: #0d0d0d !important;
}

/* Contenedores y tarjetas con fondo blanco hardcodeado */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .tree .card,
[data-bs-theme="dark"] .card-body,
[data-bs-theme="dark"] .content-box,
[data-bs-theme="dark"] .news-item-card,
[data-bs-theme="dark"] .accordion-item,
[data-bs-theme="dark"] .accordion-body {
  background-color: #1e1e1e !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

/* Highlight boxes y alert-info */
[data-bs-theme="dark"] .highlight-box {
  background-color: #252525 !important;
  border-color: #555 !important;
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #1a2a35 !important;
  border-color: #2a4a5a !important;
  color: #c8e6f5 !important;
}

/* Textos que quedan ilegibles */
[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] h1.text-dark,
[data-bs-theme="dark"] h2.text-dark,
[data-bs-theme="dark"] h3.text-dark,
[data-bs-theme="dark"] h4.text-dark,
[data-bs-theme="dark"] h5.text-dark {
  color: #e0e0e0 !important;
}

[data-bs-theme="dark"] .section-title {
  color: #90caf9 !important;
  border-bottom-color: #444 !important;
}

[data-bs-theme="dark"] .commitment-text {
  color: #aaa !important;
}

[data-bs-theme="dark"] .font-arial-black,
[data-bs-theme="dark"] h2.font-arial-black,
[data-bs-theme="dark"] h3.font-arial {
  color: #d0d0d0 !important;
}

/* Títulos generales en páginas con estilos inline */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] li,
[data-bs-theme="dark"] td,
[data-bs-theme="dark"] th {
  color: inherit;
}

/* Listas y texto en contenido de novedades */
[data-bs-theme="dark"] .font-arial,
[data-bs-theme="dark"] .list-circle,
[data-bs-theme="dark"] .list-single-paragraph {
  color: #e0e0e0 !important;
}

/* Links */
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand) {
  color: #6ea8fe;
}

[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):hover {
  color: #9ec5fe;
}

/* Inputs y formularios */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2a2a2a !important;
  border-color: #555 !important;
  color: #e0e0e0 !important;
}

/* Stats list separadores */
[data-bs-theme="dark"] .stats-list li {
  border-bottom-color: #444 !important;
  color: #e0e0e0;
}

/* Texto muted */
[data-bs-theme="dark"] .text-muted {
  color: #adb5bd !important;
}

/* Bordes de cards */
[data-bs-theme="dark"] .card.border-primary {
  border-color: #3a7bd5 !important;
}

/* Fondo del body declarado en CSS de páginas individuales */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] html {
  background-color: #121212 !important;
}

