/* ==========================================================================
   Docencia UR — Estilos globales
   ========================================================================== */

.docencia-page {
  --ur-red: #d90921;
  --ur-red-dark: #b40719;
  --ur-navy: #190356;
  --ur-navy-soft: #2a1470;
  --ur-ink: #14043f;
  --ur-gray-bg: #f2f2f2;
  --ur-gray-border: #e2e2ea;
  --ur-white: #ffffff;
  --color-grey-200: #dfdfdf;

  --stat-1: #3e0075;
  --stat-2: #471d69;
  --stat-3: #8b3fa6;
  --stat-4: #5045b3;
  --stat-5: #7d69d1;
  --stat-6: #8B3FA6;
  --stat-7: #38b6e8;

  --area-1: #9b3fbd;
  --area-1-light: #c06edd;
  --area-2: #1f9d84;
  --area-2-light: #47bba9;
  --area-3: #4a3fa0;
  --area-3-light: #8378e8;
  --area-4: #e08e15;
  --area-4-light: #f8ae41;
  --area-5: #8c52ff;
  --area-5-light: #b58fff;
  --area-6: #c85a67;
  --area-6-light: #f18b97;
  --area-7: #b56a4a;
  --area-7-light: #d49b7e;
  
  --radius-md:5px;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  font-family: var(--font-main);
  color: var(--ur-ink);
  -webkit-font-smoothing: antialiased;
}

.docencia-page * {
  box-sizing: border-box;
}

.docencia-page img {
  max-width: 89%;
  display: block;
}

.docencia-page .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== HERO ====================
   Mismo patrón que .hero en investigacion_styles.css: altura definida por el
   padding del contenido (sin min-height ni flex forzando el alto), buscador
   como caja blanca con input y botón independientes (no una sola cápsula). */

.docencia-hero {
  position: relative;
  background-color: var(--ur-navy);
  background-size: cover;
  background-position: center;
  padding: 56px 24px 64px;
  overflow: hidden;
}

.docencia-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.05) 0, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.06) 0, transparent 45%),
    linear-gradient(100deg, rgba(20, 4, 63, 0.85) 0%, rgba(25, 3, 86, 0.45) 45%, rgba(25, 3, 86, 0.1) 78%);
  pointer-events: none;
}

.docencia-hero__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}

.docencia-hero__title {
  color: var(--ur-white);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.15;
  margin: 0 0 40px;
  max-width: 820px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.docencia-hero__title span {
  display: block;
  font-weight: 100;
  color: var(--ur-white);
}

.docencia-hero__search {
  display: flex;
  gap: 12px;
  max-width: 880px;
  margin: 0 auto;
  background: var(--ur-white);
  padding: 6px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(23, 12, 58, 0.08);
}

.docencia-hero__search input[type="search"] {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: var(--font-main);
  border-radius: 10px;
  color: var(--ur-ink);
  min-width: 0;
}

.docencia-hero__search input[type="search"]::placeholder {
  color: #9a99a8;
}

.docencia-hero__search button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: var(--ur-red);
  color: var(--ur-white);
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-main);
  padding: 0 24px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.docencia-hero__search button:hover {
  background: var(--ur-red-dark);
}

.docencia-hero__search-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

/* ==================== STATS ====================
   Sección independiente debajo del hero (sin margen negativo), igual que
   .stats en investigacion_styles.css: no se superpone con el banner. */

.docencia-stats {
  padding-top: 40px;
}

.docencia-stats__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 18px;
}

.docencia-stat {
  display: flex;
  align-items: stretch;
  background: var(--ur-white);
  border: 1.5px solid var(--ur-navy);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20, 4, 63, 0.08);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.docencia-stat:hover {
  box-shadow: 0 8px 22px rgba(20, 4, 63, 0.16);
  transform: translateY(-1px);
}

.docencia-stat__icon {
  flex: 0 0 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stat-1);
}

.docencia-stat__icon img {
  width: 40px;
  height: 40px;
}

.docencia-stat--1 .docencia-stat__icon { background: var(--stat-1); }
.docencia-stat--2 .docencia-stat__icon { background: var(--stat-2); }
.docencia-stat--3 .docencia-stat__icon { background: var(--stat-3); }
.docencia-stat--4 .docencia-stat__icon { background: var(--stat-4); }
.docencia-stat--5 .docencia-stat__icon { background: var(--stat-5); }
.docencia-stat--6 .docencia-stat__icon { background: var(--stat-6); }
.docencia-stat--7 .docencia-stat__icon { background: var(--stat-7); }

.docencia-stat__value {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ur-navy);
}

.docencia-stats__labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 18px;
  margin-top: 12px;
}

.docencia-stats__labels span {
  display: block;
  text-align: center;
  font-weight: 600;
  color: var(--ur-navy);
  font-size: 1.05rem;
}

/* ==================== SERVICE BOXES ==================== */

.docencia-services {
  margin-top: 40px;
}

.docencia-services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.docencia-service {
  background: var(--ur-navy);
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  box-shadow: 0 6px 18px rgba(20, 4, 63, 0.15);
}

.docencia-service__title {
  color: var(--ur-white);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 18px;
  text-align: center;
}

.docencia-service__form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ur-white);
  border-radius: 999px;
  padding: 6px;
}

.docencia-service__go {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  background: var(--ur-red);
  color: var(--ur-white);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.docencia-service__go:hover {
  background: var(--ur-red-dark);
}

.docencia-service__autocomplete {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.docencia-service__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--ur-ink);
  padding: 0 6px;
}

.docencia-service__input::placeholder {
  color: #9a99a8;
}

/* ==================== CLUSTERS ==================== */

.docencia-clusters {
  margin: 56px 0 64px;
}

.docencia-clusters__panel {
  background: var(--ur-gray-bg);
  border: 1px solid var(--ur-gray-border);
  border-radius: 18px;
  padding: 36px 32px 32px;
}

.docencia-clusters__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ur-navy);
}

.docencia-clusters__title::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--ur-navy);
  flex: 0 0 auto;
}

.docencia-clusters__title strong {
  color: var(--ur-red);
  font-weight: 800;
}

.docencia-clusters__subtitle {
  margin: 0 0 6px;
  color: #55516f;
  font-size: 0.98rem;
}

.docencia-clusters__hint {
  margin: 0 0 20px;
  color: #85819c;
  font-size: 0.85rem;
  font-style: italic;
}

.docencia-clusters__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.docencia-clusters__breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ur-navy);
  min-height: 24px;
}

.docencia-clusters__breadcrumb .crumb {
  cursor: pointer;
  color: var(--ur-navy);
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.docencia-clusters__breadcrumb .crumb:hover {
  opacity: 1;
  text-decoration: underline;
}

.docencia-clusters__breadcrumb .crumb.is-current {
  opacity: 1;
  cursor: default;
}

.docencia-clusters__breadcrumb .crumb.is-current:hover {
  text-decoration: none;
}

.docencia-clusters__breadcrumb .sep {
  opacity: 0.4;
}

.docencia-clusters__back {
  border: 1.5px solid var(--ur-navy);
  background: var(--ur-white);
  color: var(--ur-navy);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
  visibility: hidden;
  opacity: 0;
}

.docencia-clusters__back.is-visible {
  visibility: visible;
  opacity: 1;
}

.docencia-clusters__back:hover {
  background: var(--ur-navy);
  color: var(--ur-white);
}

.docencia-clusters__stage {
  position: relative;
  width: 100%;
}

.docencia-clusters__svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}

.docencia-clusters__svg:active {
  cursor: grabbing;
}

.docencia-clusters__svg circle,
.docencia-clusters__svg .cluster-node rect {
  cursor: pointer;
}

.docencia-clusters__svg .cluster-node {
  cursor: pointer;
  transition: filter 0.15s ease;
}

.docencia-clusters__svg .cluster-node:hover rect,
.docencia-clusters__svg .cluster-node:hover circle,
.docencia-clusters__svg .cluster-node:focus rect,
.docencia-clusters__svg .cluster-node:focus circle {
  filter: brightness(1.05);
}

.docencia-clusters__svg .cluster-node:focus {
  outline: none;
}

.docencia-clusters__svg .cluster-node:focus-visible rect,
.docencia-clusters__svg .cluster-node:focus-visible circle {
  stroke: var(--ur-navy);
  stroke-width: 2.5;
}

.docencia-clusters__svg text {
  font-family: var(--font-main);
  fill: #fff;
  pointer-events: none;
  paint-order: stroke;
}

.docencia-clusters__tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ur-navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 240px;
  box-shadow: 0 8px 22px rgba(20, 4, 63, 0.35);
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.15s ease;
  z-index: 5;
}

.docencia-clusters__tooltip.is-visible {
  opacity: 1;
}

.docencia-clusters__tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.88rem;
}

.docencia-clusters__tooltip span {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  border-radius: 999px;
}

.docencia-clusters__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--ur-gray-border);
}

.docencia-clusters__legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ur-ink);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.docencia-clusters__legend-item.is-dim {
  opacity: 0.35;
}

.docencia-clusters__legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ==========================================================================
   ADENDA a styles_docencia.css — agregar al final del bloque
   "==================== CLUSTERS ====================" (después de la
   regla .docencia-clusters__legend-dot, línea ~ final del archivo actual).
   No reemplaza nada de lo existente, solo agrega.
   ========================================================================== */

/* -----------------------------------------------------------------------
   1) Contorno de emergencia para etiquetas que, ni en blanco ni en navy
      oscuro, alcanzan 4.5:1 de contraste contra su color de fondo
      (hoy solo el violeta #8c52ff / "Matemáticas y ciencias naturales").
      El JS agrega la clase "has-outline" vía textColorFor(); el
      paint-order:stroke que activa esto YA existe en la regla base
      ".docencia-clusters__svg text" — aquí solo se define el trazo.
   ----------------------------------------------------------------------- */
.docencia-clusters__svg text.has-outline {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 3px;
}

/* -----------------------------------------------------------------------
   2) Foco visible por teclado en burbujas, breadcrumb y leyenda.
      Antes no había ningún estilo de :focus — con tabindex agregado en
      el JS, sin esto el foco es invisible y Tab se vuelve inutilizable.
   ----------------------------------------------------------------------- */
.docencia-clusters__svg circle:focus-visible {
  outline: 3px solid var(--ur-red);
  outline-offset: 2px;
}

.docencia-clusters__breadcrumb .crumb:focus-visible,
.docencia-clusters__legend-item:focus-visible {
  outline: 2px solid var(--ur-red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -----------------------------------------------------------------------
   3) Controles de zoom visibles (+/-/restablecer). Requiere los 3 botones
      agregados en docencia.ftl dentro de .docencia-clusters__stage.
      Sustituyen/complementan el hint actual "use la rueda del mouse...",
      que hoy es la ÚNICA forma de hacer zoom.
   ----------------------------------------------------------------------- */
.docencia-clusters__zoom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 4;
}

.docencia-clusters__zoom-controls button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--ur-gray-border);
  background: var(--ur-white);
  color: var(--ur-navy);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 4, 63, 0.12);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.docencia-clusters__zoom-controls button:hover {
  background: var(--ur-gray-bg);
}

.docencia-clusters__zoom-controls button:active {
  transform: scale(0.94);
}

.docencia-clusters__zoom-controls button:focus-visible {
  outline: 2px solid var(--ur-red);
  outline-offset: 2px;
}

.docencia-clusters__zoom-controls .zoom-reset {
  font-size: 0.65rem;
}

/* En móvil, si el usuario ya puede hacer pellizco (pinch-zoom nativo del
   navegador vía d3.zoom + touch-action:none), los botones pasan a un
   segundo plano visual pero se mantienen para navegación por teclado
   y para quienes no puedan hacer el gesto de pellizco. */
@media (max-width: 480px) {
  .docencia-clusters__zoom-controls button {
    width: 30px;
    height: 30px;
  }
}
/* Panel "Encuentre" */

.finder {
  background: var(--color-grey-400);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: var(--color-white);
}

.finder__title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 20px;
}

.finder__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finder__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-white);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.finder__link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.finder__link svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-red-600);
  fill: none;
  flex-shrink: 0;
}

/* Formulario buscador dentro del finder (Tutor para tesis) */
.finder__form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-grey-200);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
}

.finder__form:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.finder__autocomplete {
  flex: 1;
  position: relative;
}

.finder__search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 8px 0;
  font-family: var(--font-base);
}

.finder__search-input::placeholder {
  color: var(--color-text);
  font-weight: 300;
  opacity: 1;
}

.finder__search-btn {
  width: 33px;
  height: 33px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #d50032;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
/*   background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 0 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0; */
}

.finder__search-btn svg {
  width: 18px;
  height: 18px;
  /* stroke: var(--color-red-600); */
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.8;
}

/* Posicionar el dropdown de autocomplete VIVO */
.finder__autocomplete .js-autocomplete-hints {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
}

