html {
  scroll-behavior: smooth;
}

.posgrado [id] {
  scroll-margin-top: 5rem;
}

/* El header es sticky: deja visibles los datos clave al bajar con el botón */
.posgrado #informacion {
  scroll-margin-top: 8rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Landing: Especialidad en Concepto y Desarrollo Visual */

.posgrado {
  --pg-bg: #0a0b0d;
  --pg-surface: #13151a;
  --pg-line: rgba(255, 255, 255, 0.12);
  --pg-text: #f4f5f7;
  --pg-muted: #a9adb5;
  --pg-accent: #19c2d6;
  --pg-accent-soft: rgba(25, 194, 214, 0.14);
  --pg-accent-line: rgba(25, 194, 214, 0.35);

  width: 100%;
  min-width: 0;
  background: var(--pg-bg);
  color: var(--pg-text);
  overflow-x: hidden;
  font-family: 'Aktiv Grotesk', system-ui, sans-serif;
  line-height: 1.5;
}

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

.posgrado img {
  display: block;
  max-width: 100%;
  height: auto;
}

.posgrado h1,
.posgrado h2,
.posgrado h3 {
  margin: 0;
  color: var(--pg-text);
  font-family: 'Aktiv Grotesk', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.posgrado p,
.posgrado ul,
.posgrado dl,
.posgrado dd {
  margin: 0;
}

.posgrado ul {
  padding: 0;
  list-style: none;
}

.pg-eyebrow {
  margin-bottom: 1rem;
  color: var(--pg-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pg-text {
  max-width: 62ch;
  color: var(--pg-muted);
  font-size: 1.125rem;
}

.pg-section {
  padding: 4.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pg-h2 {
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  margin-bottom: 1.25rem;
}

.pg-h2 span {
  color: var(--pg-accent);
}

.posgrado .pg-h3 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--pg-text);
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--pg-accent);
  color: #05171a;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pg-btn:hover,
.pg-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--pg-accent);
}

.pg-btn--ghost {
  background: transparent;
  color: var(--pg-text);
  border: 1px solid var(--pg-line);
}

/* Hero */

.pg-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 2rem 1rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pg-hero__media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.pg-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pg-hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 11, 13, 0.6), transparent 50%);
}

.pg-title {
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  margin-bottom: 1.25rem;
}

.pg-lead {
  color: var(--pg-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 48ch;
  margin-bottom: 3rem;
}

.pg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

/* ¿Con qué terminas? */

.pg-finish {
  margin-top: 2.5rem;
}

.pg-cards {
  display: grid;
  gap: 1rem;
}

.pg-card {
  position: relative;
  padding: 2rem;
  border-radius: 20px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pg-card:hover {
  border-color: var(--pg-accent);
  transform: translateY(-4px);
}

.pg-card h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.pg-card__index {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--pg-accent);
  font-family: 'ABC Monument GroteskMono', monospace;
  font-size: 0.9rem;
}

/* Datos clave */

.pg-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--pg-line);
  border-bottom: 1px solid var(--pg-line);
}

.pg-stat {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--pg-line);
}

.pg-stat:nth-child(odd) {
  border-right: 1px solid var(--pg-line);
}

.pg-stat:last-child {
  border-bottom: 0;
}

.pg-stat dt {
  color: var(--pg-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.pg-stat dd {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Áreas e ideal para */

.pg-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

.pg-plan {
  grid-template-columns: minmax(0, 1fr);
}

.posgrado .pg-title,
.posgrado .pg-h2,
.posgrado .pg-cta__slogan {
  overflow-wrap: anywhere;
}

.pg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pg-tags li {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--pg-accent-soft);
  border: 1px solid var(--pg-accent-line);
  font-size: 0.95rem;
}

/* Mapa curricular */

.pg-plan {
  display: grid;
  margin-top: 2.5rem;
  gap: 1rem;
  counter-reset: term;
}

.pg-term {
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
}

.pg-term__label {
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--pg-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.pg-term li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.25rem;
  border-top: 1px solid var(--pg-line);
  color: var(--pg-text);
}

.pg-term li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pg-accent);
}

.pg-term--final {
  background: var(--pg-accent);
  border-color: transparent;
  color: #05171a;
}

.pg-term--final .pg-term__label,
.pg-term--final li {
  color: #05171a;
}

.pg-term--final li {
  border-top-color: rgba(5, 23, 26, 0.2);
}

.pg-term--final li::before {
  background: #05171a;
}

/* Materias del mapa curricular */

.pg-subject {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0 0.6rem 1.25rem;
  border: 0;
  border-top: 1px solid var(--pg-line);
  border-radius: 0;
  background: transparent;
  color: var(--pg-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.pg-subject::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pg-accent);
}

.pg-subject__num {
  display: none;
}

.pg-subject:hover,
.pg-subject[aria-selected='true'] {
  color: var(--pg-accent);
  font-weight: 700;
}

.pg-subject:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 2px;
}

.pg-term--final .pg-subject {
  border-top-color: rgba(5, 23, 26, 0.2);
  color: #05171a;
}

.pg-term--final .pg-subject::before {
  background: #05171a;
}

.pg-term--final .pg-subject:hover,
.pg-term--final .pg-subject[aria-selected='true'] {
  color: #05171a;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pg-detail {
  margin-top: 1rem;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-left: 4px solid var(--pg-accent);
  animation: pg-fade 0.3s ease;
}

.pg-detail[hidden] {
  display: none;
}

.pg-detail__meta {
  margin-bottom: 0.75rem;
  color: var(--pg-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.posgrado .pg-detail h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.pg-detail p:last-child {
  max-width: 70ch;
  color: var(--pg-muted);
  font-size: 1.05rem;
}

@keyframes pg-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pg-detail {
    animation: none;
  }
}

/* Objetivo y perfiles */

.pg-text--block {
  margin-bottom: 1rem;
}

.pg-objective {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
  border-left: 4px solid var(--pg-accent);
}

.pg-objective__text {
  max-width: 70ch;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.5;
}

.pg-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
}

.pg-panel {
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  background: var(--pg-surface);
  border: 1px solid var(--pg-line);
}

.posgrado .pg-panel__title {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.pg-panel__title span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--pg-accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
}

.pg-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem 2.5rem;
}

.posgrado .pg-group h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--pg-text);
}

.pg-bullets li,
.pg-defs li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--pg-muted);
  font-size: 0.95rem;
}

.pg-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pg-accent);
}

.pg-defs li {
  padding-left: 0;
  border-top: 1px solid var(--pg-line);
}

.pg-defs li:first-child {
  border-top: 0;
  padding-top: 0;
}

.pg-defs strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--pg-text);
}

/* Tabs del perfil de egreso */

.pg-tabs {
  margin-top: 2.5rem;
}

.pg-tabs__list {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.pg-tabs__list::-webkit-scrollbar {
  display: none;
}

.posgrado .pg-tabs__tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: transparent;
  color: var(--pg-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.posgrado .pg-tabs__tab:hover {
  color: var(--pg-text);
  border-color: var(--pg-accent);
}

.posgrado .pg-tabs__tab[aria-selected='true'] {
  background: var(--pg-accent);
  border-color: var(--pg-accent);
  color: #05171a;
}

.posgrado .pg-tabs__tab:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 2px;
}

.pg-tabs__panel[hidden] {
  display: none;
}

.pg-defs--grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 2.5rem;
}

@media (min-width: 768px) {
  .pg-defs--grid {
    grid-template-columns: 1fr 1fr;
  }

  .pg-defs--grid li:nth-child(2) {
    border-top: 0;
    padding-top: 0;
  }
}

.pg-bullets--cols {
  columns: 1;
}

@media (min-width: 768px) {
  .pg-bullets--cols {
    columns: 2;
    column-gap: 2.5rem;
  }

  .pg-bullets--cols li {
    break-inside: avoid;
  }
}

/* Cierre */

.pg-cta {
  margin: 2rem 1rem 4rem;
  padding: 3rem 1.5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  display: grid;
  gap: 1.5rem;
  justify-items: center;
}

.pg-cta__slogan {
  font-family: 'Aktiv Grotesk', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.25rem, 4vw, 2.25rem);
  color: var(--pg-accent);
  text-transform: uppercase;
}

/* Escritorio */

@media (min-width: 768px) {
  .pg-hero {
    grid-template-columns: 1fr 1fr;
    padding: 4rem 2rem 5rem;
    gap: 4rem;
  }

  .pg-cards {
    grid-template-columns: 1fr 1fr;
  }

  .pg-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .pg-stat:nth-child(odd) {
    border-right: 0;
  }

  .pg-stat {
    border-bottom: 0;
    border-right: 1px solid var(--pg-line);
  }

  .pg-stat:last-child {
    border-right: 0;
  }

  .pg-split {
    grid-template-columns: 1fr 1fr;
  }

  .pg-plan {
    grid-template-columns: repeat(4, 1fr);
  }

  .pg-profile {
    grid-template-columns: 1fr 1fr;
  }

  .pg-panel--wide {
    grid-column: 1 / -1;
  }

  .pg-groups {
    grid-template-columns: 1fr 1fr;
  }

  .pg-profile--three {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .posgrado *,
  .posgrado *::before,
  .posgrado *::after {
    transition: none !important;
  }
}
