/* Mapa curricular (modal) y botón que lo abre en /universidad */

/* ---------- Botón dentro de las etiquetas del programa ---------- */
.uni-a .uni-a-map {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem .3rem .7rem;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 55%);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}

.uni-a .uni-a-map:hover,
.uni-a .uni-a-map:focus-visible {
  color: #fff;
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.uni-a .uni-a-map:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color), transparent 60%);
  outline-offset: 2px;
}

.uni-a .uni-a-map .bi-arrow-right-short {
  font-size: 1.2rem;
  line-height: 1;
  margin-left: -.1rem;
  transition: transform .2s;
}

.uni-a .uni-a-map:hover .bi-arrow-right-short {
  transform: translateX(3px);
}

/* ---------- Modal ---------- */
.pe-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(8, 24, 18, .35);
}

.pe-head {
  padding: 1.25rem 1.5rem 0;
  background: #fff;
}

.pe-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pe-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.pe-head h2 {
  margin: .15rem 0 0;
  font-size: clamp(1.45rem, 3.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--heading-color);
}

.pe-close {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--heading-color), transparent 93%);
  background-size: .75rem;
  opacity: 1;
  transition: background-color .2s;
}

.pe-close:hover {
  background-color: color-mix(in srgb, var(--heading-color), transparent 85%);
}

/* Selector de licenciatura (control segmentado) */
.pe-tabs {
  display: flex;
  gap: .25rem;
  width: max-content;
  max-width: 100%;
  margin: 1.1rem 0 0;
  padding: .25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--heading-color), transparent 93%);
}

.pe-tab {
  padding: .5rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.2;
  color: color-mix(in srgb, var(--heading-color), transparent 25%);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s;
}

.pe-tab:hover {
  color: var(--heading-color);
}

.pe-tab.is-active {
  color: #fff;
  background: var(--accent-color);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-color), transparent 60%);
}

.pe-tab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color), transparent 55%);
  outline-offset: 2px;
}

.pe-head::after {
  content: "";
  display: block;
  height: 1.1rem;
}

/* ---------- Cuerpo ---------- */
.pe-body {
  padding: 1.25rem 1.5rem 1.6rem;
  background: #f4f8f7;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 91%);
}

.pe-panel[hidden] {
  display: none;
}

.pe-panel:focus-visible {
  outline: none;
}

.pe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pe-meta li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--heading-color);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 90%);
  border-radius: 999px;
}

.pe-meta i {
  color: var(--accent-color);
}

.pe-year {
  margin-top: 1.5rem;
}

.pe-year-title {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 .8rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--heading-color), transparent 30%);
}

.pe-year-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--heading-color), transparent 86%);
}

.pe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .8rem;
}

/* Tarjeta de cuatrimestre */
.pe-term {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--heading-color), transparent 91%);
  border-radius: 16px;
  transition: border-color .2s, box-shadow .2s;
}

.pe-term[open]:hover {
  border-color: color-mix(in srgb, var(--accent-color), transparent 55%);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--heading-color), transparent 92%);
}

.pe-term summary {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: 1rem 1.1rem .7rem;
  list-style: none;
  cursor: pointer;
}

.pe-term summary::-webkit-details-marker {
  display: none;
}

.pe-term summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color), transparent 55%);
  outline-offset: -3px;
  border-radius: 16px;
}

.pe-term-num {
  font-family: var(--heading-font);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-color);
}

.pe-term-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

.pe-chev {
  margin-left: auto;
  font-size: .9rem;
  color: color-mix(in srgb, var(--heading-color), transparent 40%);
  transition: transform .2s;
}

.pe-term:not([open]) .pe-chev {
  transform: rotate(-90deg);
}

.pe-subjects {
  margin: 0;
  padding: 0 1.1rem .5rem;
  list-style: none;
}

.pe-subjects li {
  position: relative;
  padding: .55rem 0 .55rem 1rem;
  font-size: .9rem;
  line-height: 1.35;
  color: var(--heading-color);
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 93%);
}

.pe-subjects li::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color);
}

/* ---------- Pie ---------- */
.pe-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1.2rem;
  padding: .9rem 1.5rem;
  background: #fff;
  border-top: 1px solid color-mix(in srgb, var(--heading-color), transparent 91%);
}

.pe-lema {
  font-size: .85rem;
  font-style: italic;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}

.pe-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--accent-color);
  border-radius: 50px;
  transition: background-color .2s, transform .2s;
}

.pe-cta[hidden] {
  display: none;
}

.pe-cta:hover {
  color: #fff;
  background: color-mix(in srgb, var(--accent-color), black 15%);
  transform: translateY(-2px);
}

/* ---------- Escritorio / tablet ancha: 3 tarjetas por año, todo abierto ---------- */
@media (min-width: 768px) {
  .pe-head,
  .pe-foot {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .pe-body {
    padding: 1.5rem 2rem 2rem;
  }

  .pe-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* En escritorio las tarjetas no se pliegan */
  .pe-term summary {
    pointer-events: none;
    cursor: default;
  }

  .pe-chev {
    display: none;
  }
}

/* ---------- Móvil: acordeón y pie compacto ---------- */
@media (max-width: 767.98px) {
  .pe-modal .modal-dialog {
    margin: .5rem;
  }

  .pe-modal .modal-content {
    border-radius: 20px;
  }

  .pe-tabs {
    width: 100%;
  }

  .pe-tab {
    flex: 1;
    padding: .5rem .5rem;
    font-size: .8rem;
  }

  .pe-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .pe-lema {
    order: 2;
  }

  .pe-cta {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pe-chev,
  .pe-term,
  .pe-tab,
  .pe-cta,
  .uni-a .uni-a-map,
  .uni-a .uni-a-map .bi-arrow-right-short {
    transition: none;
  }
}
