/* DIRECTORIO CGIP */
.dir-page {
  background: #f3f5f2;
  padding-bottom: 90px;
}

/* HERO */
.dir-hero {
  position: relative;
  background:
    linear-gradient(rgba(8, 18, 35, 0.48), rgba(8, 18, 35, 0.48)),
    url("../assets/img/directorio.jpg") center bottom/cover no-repeat;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 0 44px;
}

.dir-hero__content {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
  color: #fff;
}

.dir-hero__title {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dir-hero__title::after {
  content: "";
  display: block;
  width: 110px;
  height: 5px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c98917 0%, #dd971a 50%, #f0b847 100%);
}

.dir-hero__subtitle {
  max-width: 760px;
  margin: 18px auto 0;
  font-size: 1.08rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
}

.dir-breadcrumb {
  position: absolute;
  left: 40px;
  bottom: 28px;
  width: fit-content;
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #6b7280;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.dir-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}

.dir-breadcrumb strong {
  color: #2f6f44;
}

/* INTRO */
.dir-intro {
  width: min(1100px, calc(100% - 40px));
  margin: 44px auto 30px;
}

.dir-intro__card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 34px;
  box-shadow: 0 14px 34px rgba(17, 26, 47, 0.07);
}

.dir-section-title {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.05;
  font-weight: 800;
  color: #111a2f;
  letter-spacing: -0.02em;
}

.dir-section-title::after {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c98917 0%, #dd971a 50%, #f0b847 100%);
}

.dir-section-title--small {
  font-size: 1.5rem;
}

.dir-intro__card p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.8;
  color: #344054;
}

/* TABLA */
.dir-table-wrap {
  width: min(1260px, calc(100% - 40px));
  margin: 0 auto;
}

.dir-table-card {
  background: #ffffff;
  border-radius: 30px;
  box-shadow: 0 18px 38px rgba(17, 26, 47, 0.08);
  overflow: hidden;
  border: 1px solid rgba(17, 26, 47, 0.05);
}

.dir-table-top {
  padding: 30px 30px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(17, 26, 47, 0.06);
}

.dir-table-top__subtitle {
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.7;
  color: #667085;
}

.dir-table-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dir-search {
  min-width: 320px;
}

.dir-search__input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(17, 26, 47, 0.10);
  padding: 0 16px;
  font-size: 0.96rem;
  color: #1f2937;
  background: #f8faf8;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.dir-search__input:focus {
  border-color: rgba(47, 111, 68, 0.35);
  box-shadow: 0 0 0 4px rgba(47, 111, 68, 0.08);
  background: #fff;
}

.dir-table-scroll {
  overflow-x: auto;
  padding: 16px 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 26, 47, 0.22) transparent;
}

.dir-table-scroll::-webkit-scrollbar {
  height: 10px;
}

.dir-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(17, 26, 47, 0.18);
  border-radius: 999px;
}

.dir-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1060px;
}

.dir-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #367742;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  padding: 18px 18px;
  white-space: nowrap;
}

.dir-table thead th:first-child {
  border-top-left-radius: 18px;
}

.dir-table thead th:last-child {
  border-top-right-radius: 18px;
}

.dir-table tbody td {
  padding: 18px 18px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #1f2937;
  vertical-align: top;
  border-bottom: 1px solid rgba(17, 26, 47, 0.06);
  background: #fff;
}

.dir-row:hover td {
  background: #f7faf7;
}

.dir-table tbody a {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dir-table tbody a:hover {
  color: #2f6f44;
}

.dir-table__section td {
  background: #f4f7f4;
  text-align: center;
  padding: 18px;
  border-bottom: 1px solid rgba(17, 26, 47, 0.06);
}

.dir-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dir-badge--general {
  background: rgba(17, 26, 47, 0.08);
  color: #111a2f;
}

.dir-badge--research {
  background: rgba(47, 111, 68, 0.12);
  color: #2f6f44;
}

.dir-badge--graduate {
  background: rgba(212, 164, 55, 0.16);
  color: #8b6a17;
}

.dir-badge--propiedad {
   background: rgba(212, 164, 55, 0.16);
  color: #dd971a;
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .dir-table-wrap {
    width: calc(100% - 24px);
  }

  .dir-table-card {
    border-radius: 18px;
  }

  .dir-table-top {
    padding: 22px 18px 16px;
  }

  .dir-search {
    min-width: 100%;
  }

  .dir-table-scroll {
    padding: 12px 10px 20px;
  }

  .dir-badge {
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}

/* REVELAR */
.dir-reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.dir-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .dir-hero {
    min-height: 270px;
    padding: 24px 0 28px;
  }

  .dir-breadcrumb {
    position: static;
    width: calc(100% - 24px);
    margin: 18px auto 0;
    padding: 14px 18px;
    gap: 12px;
    font-size: 0.95rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .dir-hero__content {
    width: calc(100% - 24px);
  }

  .dir-intro,
  .dir-table-wrap {
    width: calc(100% - 24px);
  }

  .dir-intro__card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .dir-table-card {
    border-radius: 18px;
  }

  .dir-table-top {
    padding: 22px 20px 10px;
  }

  .dir-table-scroll {
    padding: 10px 12px 20px;
  }
}

/* BOTÓN DE VUELTA A LA PARTE SUPERIOR */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 24px;
  background: #00723F;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease, background 0.25s ease;
}

.back-to-top:hover {
  background: #346c3d;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top__icon {
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 400;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  .back-to-top__icon {
    font-size: 1.9rem;
  }
}