/* =========================================================
   PLANA DOCENTE
   TARJETAS OSCURAS + BUSCADOR + PAGINACIÓN
   ========================================================= */

:root {
  --primary: #6e28ad;
  --primary-hover: #5b1f91;
  --primary-soft: #f6f0fb;
  --secondary: #e2e2e0;
  --background: #ffffff;
  --surface: #ffffff;
  --foreground: #333333;
  --muted: #6b6b6b;
  --border: #dddcd9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  margin: 0;
  font-family: "Poppins", Sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/* Cabecera institucional */

.institutional-header {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #5a168e 0%, #6e28ad 55%, #7e36b8 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.institutional-header-inner {
  width: 100%;
  max-width: 1320px;
  min-height: 64px;
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding: 7px 15px;
}

.institutional-brand {
  display: inline-flex;
  align-items: center;
  width: auto;
}

.institutional-logo {
  display: block;
  width: 100%;
  max-width: 460px;
  object-fit: contain;
  object-position: left center;
}


.breadcrumb.v1 ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
    margin-bottom: 45px;
}
.breadcrumb.v1 ol li:hover {
    color: #6E28AD;
    transition: all 0.4s;
}
.breadcrumb.v1 ol li .active {
    color: #6E28AD;
    padding: 15px 0;
    font-weight: bold;
    border-bottom: 1px solid;
    transition: all 0.4s;
}

/* Contenedor principal */

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 15px 90px 15px;
}

/* Título */

.page-header {
  /* max-width: 820px; */
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  color: #000000;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
}

.page-description {
  max-width: 650px;
  color: #000000;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
  margin-bottom: 45px;
}

/* Buscador */

.search-section {
  max-width: 820px;
  margin-bottom: 40px;
}

.search-box {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  background: var(--surface);
  border: 1px solid #333333;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.search-box:focus-within {
  border-color: #6e28ad;
}

.search-box > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #777;
  stroke-width: 1.8;
}

.search-box input {
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
  padding: 8px;
  width: 100%;
}

.search-box input::placeholder {
  color: #333333;
}

.clear-search {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #777;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.clear-search:hover {
  color: #333;
  background: #f0f0ef;
}

.clear-search svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

.search-summary {
  color: #333333;
  font-size: 1rem;
  padding: 10px;
  margin: 0;
}

/* Resultados */

.results-section {
  width: 100%;
  scroll-margin-top: 18px;
}

/* 3 columnas en escritorio */

.cards-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Tarjeta del docente */

.teacher-card {
  width: 100%;
  min-width: 0;
  min-height: 170px;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #333333;
  background: #333333;
  color: #ffffff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.teacher-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.teacher-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(110, 40, 173, 0.28),
    0 8px 22px rgba(0, 0, 0, 0.18);
}

.teacher-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.teacher-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: var(--primary-soft);
}

.teacher-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.teacher-main {
  min-width: 0;
  flex: 1;
}

.teacher-name {
  margin: 0;
  color: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
  padding-right: 36px;
  color: #cfcbcf;
  font-size: 0.73rem;
}

.teacher-meta-item {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.teacher-meta-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: #cfcbcf;
  stroke-width: 1.8;
}

/* Enlaces internos: correo y ORCID */

.teacher-meta-link {
  position: relative;
  z-index: 3;
  min-width: 0;
  color: #cfcbcf;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.teacher-meta-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.teacher-meta-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
  border-radius: 3px;
  color: #ffffff;
}

/* Indicador visual para abrir perfil */

.teacher-arrow {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
  pointer-events: none;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}

.teacher-arrow svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.teacher-card:hover .teacher-arrow {
  transform: translateX(2px);
  background: var(--primary-hover);
}

/* Paginación */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

.pagination-button {
  text-transform: uppercase;
  place-items: center;
  padding: 10px;
  border: 1px solid;
  background: var(--surface);
  color: #333333;
  font-weight: 400;
  cursor: pointer;

  transition: 0.4s ease;
}

.pagination-button:hover:not(:disabled):not(.is-active) {
  background: #e2e2e0;
}

.pagination-button.is-active {
  background: #e2e2e0;
  cursor: default;
}

.pagination-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pagination-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 40, 173, 0.14);
}

.pagination-ellipsis {
  min-width: 30px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 0.82rem;
  user-select: none;
}

.pagination-icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

/* Estados */

.empty-state {
  width: 100%;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.results-section > .empty-state {
  margin-top: 12px;
}

.empty-state h2 {
  margin: 0 0 5px;
  color: #333;
  font-size: 0.95rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 0.78rem;
}

.empty-state code {
  font-size: 0.76rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */

@media (max-width: 1000px) {
  .page {
    width: min(100% - 28px, 1240px);
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Móvil */

@media (max-width: 700px) {
  .institutional-header,
  .institutional-header-inner {
    min-height: 56px;
  }

  .institutional-header-inner {
    padding: 6px 12px;
  }

  .institutional-logo {
    height: 44px;
    max-width: 85vw;
  }

  .page {
    width: calc(100% - 18px);
    padding: 28px 0 42px;
  }

  .page-header {
    margin-bottom: 22px;
  }

  .page-header h1 {
    font-size: 1.8rem;
  }

  .page-description {
    font-size: 0.83rem;
  }

  .search-section {
    margin-bottom: 25px;
  }

  .search-box {
    min-height: 50px;
  }

  .search-box input {
    height: 48px;
    font-size: 0.83rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .teacher-card {
    min-height: 150px;
    padding: 16px;
  }

  .teacher-avatar {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .teacher-name {
    font-size: 0.91rem;
  }

  .teacher-meta {
    font-size: 0.71rem;
  }

  .teacher-arrow {
    right: 14px;
    bottom: 14px;
  }

  .pagination {
    margin-top: 22px;
    gap: 5px;
  }

  .pagination-button {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
  }
}
