/* ==========================================================================
   posgrados.css
   Página de Posgrados. Sigue el diseño del cliente (línea Posgrados: vino
   #950E2C y #5F0E2C, paleta confirmada por el cliente) con mejoras: búsqueda, filtro por área,
   contador, estado vacío, franja de respaldo y cifras.
   Las tarjetas y la ficha (.pg-*, .pd-*) también se usan fuera de posgrados (ej. detalle de licenciatura):
   ahí no existe --pg y toman el azul de la paleta (respaldo en cada var()).
   REGLA: el vino vive SOLO dentro de <main class="theme-posgrados">; encabezado,
   pie y botón "volver arriba" conservan los azules ITLA.
   Comportamiento: js/posgrados.js
   ========================================================================== */

/* ---------- Tema Posgrados (variables locales) ---------- */
.theme-posgrados {
  --pg: var(--c-pg);
  --pg-dark: var(--c-pg-dark);
  --pg-soft: color-mix(in srgb, var(--c-pg) 8%, #fff);
  --ink: var(--c-pg);
  --blue: var(--c-pg);
  --grad: linear-gradient(135deg, var(--c-pg-dark), var(--c-pg));
  --linea-titulo: var(--c-pg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-posgrados {
    --pg-soft: rgba(255, 255, 255, .06);
    --ink: #fff;
    --blue: var(--c-pg-claro);
  }
}
:root[data-theme="dark"] .theme-posgrados {
  --pg-soft: rgba(255, 255, 255, .06);
  --ink: #fff;
  --blue: var(--c-pg-claro);
}

/* Franjas con el mismo patrón, en tono vino */
.theme-posgrados .trust {
  background: var(--pg-dark, var(--c-ink));
}
.theme-posgrados .band {
  background: linear-gradient(135deg, var(--c-pg-dark), var(--c-pg));
}
.theme-posgrados .band .btn {
  color: var(--pg-dark, var(--c-ink));
}
.theme-posgrados .stats strong {
  color: var(--pg, var(--c-blue));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-posgrados .stats strong {
    color: var(--c-pg-claro);
  }
}

/* ---------- Filtros por nivel (píldoras del cliente) ---------- */
.pg-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
  margin-top: 2.4rem;
}
.pg-chip {
  padding: .8rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 700 1rem var(--font);
  cursor: pointer;
  box-shadow: 0 1px 6px rgb(var(--c-sombra-rgb) / .06);
  transition: background .25s, color .25s, transform .25s;
}
.pg-chip:hover {
  transform: translateY(-2px);
}
.pg-chip[aria-pressed="true"] {
  background: var(--pg, var(--c-blue));
  border-color: var(--pg, var(--c-blue));
  color: #fff;
}

/* ---------- Plus: búsqueda y área ---------- */
.pg-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
  margin: 1.4rem auto 0;
  max-width: 640px;
}
.pg-search {
  flex: 2 1 260px;
}
.pg-area-sel {
  flex: 1 1 200px;
}
.pg-tools input,
.pg-tools select {
  width: 100%;
  padding: .8rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: 500 1rem var(--font);
}
.pg-tools input:focus-visible,
.pg-tools select:focus-visible,
.pg-chip:focus-visible,
.pg-btn:focus-visible {
  outline: 3px solid var(--pg, var(--c-blue));
  outline-offset: 2px;
}
.pg-count {
  margin-top: 1.4rem;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

/* ---------- Tarjetas de programa ---------- */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.4rem;
}
/* Columnas fijas: con 1 o 2 tarjetas visibles conservan su ancho (no se estiran) */
@media (max-width: 1020px) {
  .pg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 660px) {
  .pg-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pg-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  background: var(--surface);
  border-left: 5px solid var(--pg, var(--c-blue));
  border-radius: 6px 14px 14px 6px;
  box-shadow: 0 2px 14px rgb(var(--c-sombra-rgb) / .08);
  transition: box-shadow .3s, transform .3s;
}
.pg-card[hidden] {
  display: none;
}
.pg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgb(var(--c-pg-dark-rgb) / .2);
}
.pg-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.pg-ico {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  background: var(--pg-soft, color-mix(in srgb, var(--c-blue) 8%, var(--surface)));
  color: var(--blue);
}
.pg-ico .ic {
  width: 1.5rem;
  height: 1.5rem;
}
.pg-tag {
  padding: .3rem .7rem;
  border-radius: 6px;
  background: var(--pg-soft, color-mix(in srgb, var(--c-blue) 8%, var(--surface)));
  color: var(--muted);
  font: 700 .75rem var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pg-card h3 {
  margin-top: 1.4rem;
  font: 700 1.3rem/1.25 var(--font);
  color: var(--text);
  transition: color .25s;
}
.pg-card:hover h3 {
  color: var(--blue);
}
.pg-area {
  margin-top: .5rem;
  color: var(--muted);
  font: 700 .8rem var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pg-desc {
  margin-top: 1rem;
  color: var(--muted);
}

/* Botón al fondo de la tarjeta, aunque falte la descripción (tarjetas parejas) */
.pg-btn {
  margin-top: auto;
  display: block;
  padding: .9rem 1rem;
  border-radius: 999px;
  background: var(--pg, var(--c-blue));
  color: #fff;
  text-align: center;
  font: 700 1rem var(--font);
  text-decoration: none;
  transition: background .25s;
}
/* Espacio entre el último texto y el botón */
.pg-card > :nth-last-child(2) {
  margin-bottom: 1.4rem;
}
.pg-btn:hover {
  background: var(--pg-dark, var(--c-ink));
}

/* ---------- Estado vacío ---------- */
.pg-empty {
  max-width: 52ch;
  margin: 2rem auto 0;
  padding: 1.6rem;
  border: 1px dashed var(--pg, var(--c-blue));
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .pg-card,
  .pg-chip {
    transition: none;
  }
}

/* ==========================================================================
   Detalle de un posgrado (posgrado-*.html): migas, objetivo, RVOE, perfil de
   egreso, tarjeta lateral con datos y otros programas. Prefijo .pd-
   ========================================================================== */

/* Migas de pan */
.pd-crumb {
  padding-block: 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}
.pd-crumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  list-style: none;
}
.pd-crumb li + li::before {
  content: "›";
  margin-right: .4rem;
}
.pd-crumb a {
  color: var(--blue);
}
.pd-crumb [aria-current] {
  color: var(--text);
  font-weight: 700;
}

/* Rejilla: texto + tarjeta lateral (la tarjeta se queda fija al bajar en escritorio) */
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.pd-main h2,
.pd-main h3 {
  text-align: left;
}
/* (con section.b para ganarle a la línea centrada general de sections.css) */
section.b .pd-main h2::after {
  margin-left: 0;
}
.pd-main h3 {
  font: 700 1.6rem/1.2 var(--font);
  color: var(--ink);
  margin-top: 2.6rem;
}
.pd-text {
  margin-top: 1.4rem;
  font-size: 1.1rem;
  line-height: 1.75;
}

/* Validez oficial: mismos datos del cliente, ordenados para leerse mejor */
.pd-rvoe {
  margin-top: 2rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--pg, var(--c-blue));
  border-radius: 10px;
  background: var(--surface);
}
.pd-rvoe h4 {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--blue);
  font: 700 1rem var(--font);
}
.pd-rvoe .ic {
  width: 1.4rem;
  height: 1.4rem;
}
.pd-rvoe dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin-top: .8rem;
  font-size: .95rem;
}
.pd-rvoe dt {
  color: var(--muted);
  font-weight: 700;
}

/* Perfil de egreso */
.pd-list {
  list-style: none;
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}
.pd-list li {
  display: flex;
  gap: .9rem;
  font-size: 1.1rem;
  line-height: 1.55;
}
.pd-list .ic {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
  color: var(--blue);
}

/* Botón de la columna de texto */
.pd-cta {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 2.4rem;
  padding: 1rem 1.8rem;
  border-radius: 999px;
  background: var(--pg, var(--c-blue));
  color: #fff;
  font: 700 1.05rem var(--font);
  text-decoration: none;
  box-shadow: 0 8px 20px rgb(var(--c-pg-dark-rgb) / .3);
  transition: background .25s, transform .25s;
}
.pd-cta:hover {
  background: var(--pg-dark, var(--c-ink));
  transform: translateY(-2px);
}
.pd-cta .ic {
  width: 1.2rem;
  height: 1.2rem;
}

/* Botones del detalle: solicitar información + plan de estudios (visor) */
.pd-acc {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}
.pd-acc .pd-cta { margin-top: 0; }
.pd-cta--linea {
  background: #fff;
  color: var(--pg, var(--c-blue));
  box-shadow: inset 0 0 0 2px var(--pg, var(--c-blue)), 0 8px 20px rgb(var(--c-pg-dark-rgb) / .12);
}
.pd-cta--linea:hover {
  background: var(--pg, var(--c-blue));
  color: #fff;
}
.pd-cta:focus-visible {
  outline: 3px solid var(--pg-dark, var(--c-ink));
  outline-offset: 3px;
}
@media (max-width: 560px) {
  .pd-acc .pd-cta { width: 100%; justify-content: center; }
}

/* Tarjeta lateral "Información del Programa" */
.pd-aside {
  position: sticky;
  top: 6.5rem;
  padding: 2rem;
  border-top: 6px solid var(--pg, var(--c-blue));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgb(var(--c-sombra-rgb) / .12);
}
.pd-aside h2 {
  font-size: 1.35rem;
  text-align: left;
}
section.b .pd-aside h2::after {
  display: none;
}
.pd-facts {
  display: grid;
  gap: 1.3rem;
  margin-top: 1.6rem;
}
.pd-facts div {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.pd-facts .ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--pg-soft, color-mix(in srgb, var(--c-blue) 8%, var(--surface)));
  color: var(--blue);
}
.pd-facts .ic {
  width: 1.4rem;
  height: 1.4rem;
}
.pd-facts dt {
  color: var(--muted);
  font: 700 .8rem var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pd-facts dd {
  font: 700 1.1rem/1.3 var(--font);
  color: var(--text);
}

/* Plus: contacto directo del Campus Central (dato que ya está en el pie) */
.pd-help {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: .95rem;
  color: var(--muted);
}
.pd-help a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}
.pd-help .ic {
  width: 1.2rem;
  height: 1.2rem;
}

@media (max-width: 900px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* En móvil la tarjeta de datos va primero y deja de ser fija */
  .pd-aside {
    position: static;
    order: -1;
  }
}
@media (max-width: 480px) {
  .pd-rvoe dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .pd-rvoe dd {
    margin-bottom: .5rem;
  }
}
