/* PMDR Academy — visor de aprendizaje (hero-diagram) */
@import url("academy-brand.css");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* —— Header —— */
.app-header {
  background: var(--pmdr-white);
  color: var(--pmdr-navy-700);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.app-header--home {
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--pmdr-navy-700);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--pmdr-navy-900);
}

.brand-tagline,
.brand-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-progress {
  flex: 1;
  max-width: 280px;
  min-width: 140px;
}

.slide-counter-header {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 0.35rem;
  text-align: right;
}

/* Nav links en header oscuro (filminas, drill, catálogo, simulador) */
.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  flex-shrink: 0;
}

.mode-nav .header-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}

.mode-nav .header-link:hover {
  background: var(--pmdr-blue-50);
  color: var(--pmdr-navy-700);
}

.mode-nav .header-link.is-active {
  background: var(--pmdr-blue-50);
  color: var(--pmdr-navy-700);
  font-weight: 600;
}

.mode-nav .header-link--lab {
  border-color: var(--border);
}

.app-header a.header-link,
.app-header .header-catalog-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.app-header a.header-link:hover,
.app-header .header-catalog-link:hover {
  background: var(--pmdr-blue-50);
  color: var(--pmdr-navy-700);
}

.progress {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--pmdr-blue-600);
  width: 0%;
  transition: width 0.25s ease;
  border-radius: 99px;
}

.slide-counter-header {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-align: right;
  font-family: var(--font-mono);
}

/* —— Layout —— */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  gap: 0;
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - 72px);
}

.nav-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rail-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.75rem 0 0.5rem 0.5rem;
}

.rail-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.deck-list {
  padding: 0 0.25rem;
}

.deck-list h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem 0.5rem;
}

.deck-list a {
  display: block;
  color: var(--nr-blue);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  line-height: 1.35;
}

/* Fijadas: ancla pedagógica visible en cualquier deck, no solo el actual. */
.rail-section--pinned {
  flex: 0 0 auto;
  overflow: visible;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.25rem;
}

.pinned-list {
  list-style: none;
  padding: 0 0.25rem;
  margin: 0;
}

.pinned-list li {
  margin: 0.15rem 0;
}

.pinned-list a {
  display: block;
  color: var(--nr-blue);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid #f3d98a;
  background: #fdf8ec;
  line-height: 1.35;
}

.pinned-list a:hover {
  background: #faedc4;
}

.pinned-list a.active {
  background: #faedc4;
  border-color: #e0b23e;
  font-weight: 600;
}

.deck-list a:hover {
  background: var(--nr-blue-soft);
}

.deck-list a.active {
  background: var(--nr-blue-soft);
  border-color: var(--nr-blue-border);
  font-weight: 600;
}

.slide-index {
  list-style: none;
  padding: 0;
  margin: 0;
}

.slide-index li {
  margin: 0.15rem 0;
}

.slide-index button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.35;
  font-family: inherit;
}

.slide-index button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.slide-index button.active {
  background: var(--nr-blue-soft);
  border-color: var(--nr-blue-border);
  color: var(--nr-navy);
  font-weight: 600;
}

.rail-advanced {
  margin-top: 0.75rem;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.rail-advanced summary {
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  color: var(--text-secondary);
}

.file-label input {
  margin-top: 0.35rem;
  width: 100%;
  font-size: 0.8rem;
}

/* —— Main slide area —— */
.content-stage {
  padding: 1.5rem 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(960px, 92vw);
}

.content-stage--visual-focus {
  max-width: min(1280px, 94vw);
}

/* Modo presentación — proyector / sala ejecutiva */
body.academy-presentation .app-shell {
  grid-template-columns: 1fr;
}

body.academy-presentation .nav-rail,
body.academy-presentation .context-panel {
  display: none;
}

body.academy-presentation .content-stage {
  max-width: min(1400px, 96vw);
  margin: 0 auto;
  padding: 1rem 1.5rem 1rem;
}

body.academy-presentation .slide-card--visual-focus .slide-hero-visual {
  min-height: clamp(480px, 72vh, 820px);
}

body.academy-presentation .slide-hero-visual .slide-figure--diagram .slide-svg--diagram,
body.academy-presentation .slide-hero-visual .slide-figure--hero-media img,
body.academy-presentation .slide-card--visual-focus .slide-hero-visual .mermaid {
  min-height: clamp(440px, 68vh, 760px);
  max-height: 78vh;
}

.btn-presentation {
  margin-left: 0;
  white-space: nowrap;
}

.content-stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.presenter-tools {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

body.academy-presentation .presenter-tools {
  display: flex;
}

.btn-spotlight {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
  opacity: 0.88;
}

.btn-spotlight.is-on {
  background: var(--nr-navy, #0f2d4a);
  border-color: var(--nr-navy, #0f2d4a);
  color: #fff;
  opacity: 1;
}

.btn-spotlight-shape {
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  min-width: 2rem;
  opacity: 0.85;
}

.slide-viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.slide-viewport > #slide-content {
  flex: 1;
}

.academy-spotlight {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(7, 14, 28, 0.72);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.academy-spotlight.is-active {
  opacity: 1;
}

body.academy-presentation .academy-spotlight {
  background: rgba(5, 12, 24, 0.74);
}

.slide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem 3.5rem 2.5rem;
  flex: 1;
  min-height: 520px;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

.slide-card--hero .slide-hero-visual {
  order: -2;
  margin: 0 0 1.25rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Filminas con diagrama/foto: la imagen ocupa 60–80% del espacio útil */
.slide-card--visual-focus {
  padding: 1.5rem 1.75rem 1.25rem;
  min-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0.75rem;
}

.slide-card--visual-focus .slide-hero-visual {
  min-height: clamp(420px, 66vh, 720px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.slide-card--visual-focus .slide-hero-visual .slide-figure--diagram,
.slide-card--visual-focus .slide-hero-visual .slide-figure--hero-media,
.slide-card--visual-focus .slide-hero-visual .slide-images {
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: inherit;
}

.slide-hero-visual .slide-figure--diagram,
.slide-hero-visual .slide-figure--hero-media {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.slide-card--visual-focus .slide-hero-visual .slide-figure--diagram .slide-svg--diagram,
.slide-card--visual-focus .slide-hero-visual .slide-figure--hero-media img,
.slide-card--visual-focus .slide-hero-visual .slide-figure--hero-media .slide-svg--diagram,
.slide-hero-visual .slide-figure--diagram object.slide-svg {
  display: block;
  width: 100%;
  flex: 0 1 auto;
  min-height: clamp(220px, 34vh, 380px);
  max-height: min(42vh, 420px);
  object-fit: contain;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  background: #fff;
}

/* Una sola figura hero: más altura */
.slide-card--visual-focus .slide-hero-visual .slide-figure--diagram:only-child .slide-svg--diagram,
.slide-card--visual-focus .slide-hero-visual .slide-images:only-child .slide-figure--hero-media img {
  min-height: clamp(400px, 62vh, 680px);
  max-height: min(72vh, 720px);
  flex: 1 1 auto;
}

.slide-card--visual-focus .slide-hero-visual .mermaid {
  width: 100%;
  min-width: 0;
  min-height: clamp(400px, 62vh, 680px);
  max-height: min(72vh, 720px);
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slide-card--visual-focus .slide-hero-visual .mermaid svg {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

.slide-card--visual-focus .slide-body {
  flex: 0 0 auto;
}

.slide-card--visual-focus h1 {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
  max-width: none;
}

.slide-card--visual-focus .objetivo {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.slide-card--visual-focus ul.slide-bullets {
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 52rem;
}

.slide-card--visual-focus .pbip-bridge {
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
}

.slide-card--visual-focus .slide-hero-visual .slide-figure--diagram--portrait {
  max-width: min(520px, 90%);
  margin: 0 auto;
}

.slide-card--visual-focus .slide-hero-visual .slide-figure--diagram--portrait .slide-svg--diagram {
  min-height: clamp(480px, 70vh, 820px);
  max-height: 78vh;
}

.slide-card--visual-focus ul.slide-bullets li {
  margin-bottom: 0.3rem;
}

.slide-key-idea {
  margin: 0.65rem 0 0.35rem;
  padding: 0.6rem 0.95rem;
  border-left: 4px solid var(--nr-navy, #0f2d4a);
  background: linear-gradient(90deg, rgba(12, 95, 138, 0.09), transparent 88%);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 52rem;
}

.slide-key-idea-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.slide-key-idea p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.slide-card--visual-focus .slide-key-idea {
  margin-top: 0.45rem;
  padding: 0.5rem 0.85rem;
}

.slide-card--visual-focus .slide-body {
  display: grid;
  gap: 0.25rem;
  align-content: start;
}

body.academy-presentation .slide-card--visual-focus .slide-hero-visual {
  min-height: clamp(500px, 74vh, 840px);
}

body.academy-presentation .slide-card--visual-focus .slide-hero-visual .slide-figure--diagram:only-child .slide-svg--diagram,
body.academy-presentation .slide-card--visual-focus .slide-hero-visual .slide-images:only-child .slide-figure--hero-media img {
  min-height: clamp(440px, 66vh, 760px);
  max-height: 76vh;
}

.slide-hero-visual .slide-figure--diagram figcaption {
  padding: 0.65rem 1rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  flex: 0 0 auto;
}

.slide-card--hero h1 {
  order: -1;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pmdr-navy-900);
  margin: 0 0 0.75rem;
  line-height: 1.15;
  max-width: min(28rem, 100%);
  text-wrap: balance;
}

.slide-card h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--pmdr-navy-900);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.slide-card .objetivo {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin: 0 0 1.75rem;
  padding-bottom: 0;
  border-bottom: none;
  line-height: 1.5;
  max-width: 42rem;
}

.slide-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  overflow: hidden;
  max-width: 100%;
}

.slide-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.slide-id-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pmdr-navy-700);
  opacity: 0.72;
  white-space: nowrap;
  margin-left: auto;
  padding: 0.2rem 0;
  user-select: all;
}

body.academy-presentation .slide-id-badge {
  opacity: 0.55;
  font-size: 0.68rem;
}

.slide-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  background: var(--pmdr-blue-50);
  color: var(--pmdr-blue-600);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-badge--bok {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
  white-space: nowrap;
}

body.academy-presentation .slide-badge--bok {
  display: none;
}

.context-bok {
  order: -1;
}

.context-bok .bok-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.context-bok .bok-ref-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--pmdr-blue-50);
  border: 1px solid var(--border);
  cursor: help;
}

.bok-ref-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--pmdr-navy-700);
  line-height: 1.35;
}

.slide-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 40rem;
}

.slide-card ul.slide-bullets li {
  margin-bottom: 0.65rem;
}

.slide-card ul.slide-bullets li::marker {
  color: var(--nr-blue);
}

.slide-card ol.slide-ordered {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding-left: 1.25rem;
  font-size: 1.02rem;
  line-height: 1.65;
}

.slide-card ol.slide-ordered li {
  margin-bottom: 0.5rem;
}

.slide-subtitulo {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--nr-navy);
  margin: 1.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
}

.slide-subtitulo:first-child {
  margin-top: 0;
}

.contenido-label {
  margin: 0.65rem 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
}

/* Lista documental / normativa: tarjetas apiladas (no columnas) */
.slide-card .slide-body .contenido-label {
  display: block;
  width: 100%;
  max-width: 52rem;
  box-sizing: border-box;
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.slide-card .slide-body .contenido-label:last-child {
  margin-bottom: 0;
}

.message-example {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--pmdr-blue-600);
  background: var(--pmdr-blue-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: 42rem;
}

.message-example-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pmdr-blue-600);
}

.message-example-body {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--pmdr-navy-900);
}

.message-example-body p {
  margin: 0 0 0.45rem;
}

.message-example-body p:last-child {
  margin-bottom: 0;
}

.acronym-glossary {
  margin-top: 0;
  padding: 0;
  border-top: none;
  background: transparent;
  border-radius: 0;
}

.slide-footnotes {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.slide-footnotes .acronym-glossary + .slide-bibliography {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.acronym-glossary-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.acronym-footnote {
  margin: 0.25rem 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.acronym-mark {
  color: var(--nr-blue);
  font-weight: 700;
  margin-right: 0.15rem;
}

.slide-bibliography {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  max-width: 100%;
}

.slide-bibliography-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pmdr-navy-700);
  opacity: 0.85;
  margin: 0 0 0.5rem;
}

.slide-bibliography-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.slide-bibliography-list li {
  margin: 0.35rem 0;
  padding-left: 0;
}

.slide-bibliography-link {
  color: var(--pmdr-teal-700);
  text-decoration: none;
  word-break: break-word;
}

.slide-bibliography-link:hover {
  text-decoration: underline;
}

.slide-bibliography-type {
  opacity: 0.75;
  font-size: 0.72rem;
}

.slide-bibliography-ficha {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  max-width: 100%;
  word-break: break-all;
}

.slide-card ul li {
  margin-bottom: 0.65rem;
}

.slide-card ul li::marker {
  color: var(--nr-blue);
}

.slide-images {
  margin: 1.25rem 0 0.5rem;
}

.slide-images--grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.slide-images--grid .slide-figure--wide {
  grid-column: 1 / -1;
}

.slide-images--pair {
  justify-content: center;
  grid-template-columns: 1fr;
}

.slide-images--pair .slide-figure:not(.slide-figure--wide) img {
  object-fit: contain;
  max-height: 300px;
  background: #fff;
}

.slide-figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-muted);
}

.slide-figure img,
.slide-figure object.slide-svg {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

/* Hero: sin tope de 280px — reglas en .slide-card--visual-focus */
.slide-hero-visual .slide-figure img,
.slide-hero-visual .slide-figure object.slide-svg,
.slide-hero-visual .slide-svg--diagram {
  max-height: none;
}

.slide-figure object.slide-svg,
.slide-hero-visual object.slide-svg {
  pointer-events: none;
}

.slide-figure--wide img[src$=".svg"]:not(.slide-svg--diagram) {
  max-height: none;
  min-height: 380px;
  height: auto;
  aspect-ratio: 1000 / 820;
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
}

.slide-figure img[src$=".svg"]:not(.slide-svg--diagram) {
  max-height: none;
  min-height: 380px;
  aspect-ratio: 1000 / 820;
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
}

.slide-images--grid .slide-figure:has(object.slide-svg),
.slide-images--grid .slide-figure:has(img[src$=".svg"]) {
  grid-column: 1 / -1;
}

.slide-figure figcaption {
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nr-navy);
  border-top: 1px solid var(--border);
}

.image-credit {
  margin: 0;
  padding: 0.35rem 0.75rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.imagen-placeholder .placeholder-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* —— Home institucional —— */
.home-body {
  background: var(--page-bg);
}

.home-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}

.home-hero {
  margin-bottom: 4rem;
}

.home-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pmdr-blue-600);
  margin: 0 0 1rem;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--pmdr-navy-900);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  max-width: 16ch;
}

.home-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 38rem;
  margin: 0 0 2rem;
}

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 4rem;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.home-card:hover {
  border-color: var(--nr-blue-border);
  box-shadow: var(--shadow);
}

.home-card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--pmdr-navy-900);
}

.home-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.home-services h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 1rem;
}

.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
}

.service-list li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-left: 1rem;
  position: relative;
}

.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pmdr-blue-600);
}

.home-footnote {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 36rem;
}

.slide-card .reflexion {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--nr-blue);
  background: var(--nr-blue-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.pbip-bridge {
  margin-top: 1.75rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--nr-blue-border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbfd 0%, #eef6fb 100%);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.pbip-bridge strong {
  display: block;
  color: var(--pmdr-navy-900, var(--nr-navy));
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.pbip-bridge-note {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.mermaid,
.diagram-fallback {
  margin: 0 0 1.5rem;
  background: var(--pmdr-blue-50);
  border: 1px solid var(--nr-blue-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 200px;
}

.slide-hero-visual .mermaid,
.slide-hero-visual .slide-figure--wide {
  margin: 0;
  max-width: 100%;
  overflow: hidden;
}

.slide-hero-visual .mermaid svg {
  max-width: 100% !important;
  height: auto !important;
}

.imagen-placeholder {
  display: none;
}

.slide-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.slide-nav-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--page-bg);
  padding: 0 0 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.slide-nav-bottom {
  padding: 1.25rem 0 0.5rem;
}

.deck-handoff {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--nr-blue-border);
  border-radius: var(--radius);
  background: var(--nr-blue-soft);
  text-align: center;
}

.deck-handoff-label {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deck-handoff-link {
  display: inline-block;
  text-decoration: none;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--nr-blue);
  color: #fff;
  border-color: var(--nr-blue);
}

.btn-primary:hover:not(:disabled) {
  background: #095d85;
}

.btn-secondary {
  background: var(--surface);
  color: var(--nr-navy);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: var(--nr-blue-border);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— Context panel (derecha) —— */
.context-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 1.25rem 1rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  min-width: 0;
  overflow-x: hidden;
}

.context-block {
  min-width: 0;
}

.context-block + .context-block {
  margin-top: 1.25rem;
}

.context-heading,
.notes-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.context-panel .message-example {
  margin: 0;
}

.context-empty {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* —— Instructor notes —— */
.notes-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 1.25rem 1rem;
}

.notes-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.notes-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--nr-blue-soft);
  border: 1px solid var(--nr-blue-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.notes-body p,
.notes-body .notes-paragraph {
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.notes-body .notes-ecs {
  font-size: 0.86rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--nr-blue-border);
}

.notes-body p:last-child,
.notes-body .notes-paragraph:last-child {
  margin-bottom: 0;
}

.doc-path {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.82em;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* Long paths and instructor copy — keep inside cards */
.slide-card,
.slide-body,
.slide-card p,
.slide-card li,
.slide-card .objetivo,
.slide-card .reflexion,
.slide-card .pbip-bridge,
.slide-card .pbip-bridge p,
.context-panel .bok-ref-label {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.muted {
  color: var(--muted);
}

.error-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #b91c1c;
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  z-index: 100;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }
  .context-panel,
  .notes-panel {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--border);
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-progress {
    max-width: none;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .nav-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
  .content-stage {
    padding: 1rem;
  }
  .slide-card {
    padding: 1.25rem 1.35rem;
    min-height: 320px;
  }
}

/* —— Slide transitions (V8) —— */
@keyframes pmdr-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-card {
  animation: pmdr-fade-up 0.38s ease-out;
}

.slide-hero-visual object.slide-svg,
.slide-hero-visual .mermaid,
.slide-hero-visual img {
  animation: pmdr-fade-up 0.5s ease-out 0.08s both;
}

.slide-card ul.slide-bullets li {
  animation: pmdr-fade-up 0.35s ease-out both;
}

.slide-card ul.slide-bullets li:nth-child(1) {
  animation-delay: 0.12s;
}

.slide-card ul.slide-bullets li:nth-child(2) {
  animation-delay: 0.2s;
}

.slide-card ul.slide-bullets li:nth-child(3) {
  animation-delay: 0.28s;
}

@media (prefers-reduced-motion: reduce) {
  .slide-card,
  .slide-hero-visual object.slide-svg,
  .slide-hero-visual .mermaid,
  .slide-hero-visual img,
  .slide-card ul.slide-bullets li {
    animation: none;
  }
}

.academy-session-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.academy-session-identity {
  overflow-wrap: anywhere;
}

.academy-session-sep {
  opacity: 0.5;
  padding: 0 0.15rem;
}

.academy-session-logout {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.academy-login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.academy-login-card {
  width: min(28rem, 92vw);
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.academy-login-lead {
  color: var(--muted);
  margin: 0.75rem 0 1.5rem;
  line-height: 1.5;
}

.academy-login-form {
  display: grid;
  gap: 0.75rem;
}

.academy-login-form label {
  font-size: 0.85rem;
  font-weight: 600;
}

.academy-login-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.academy-login-message {
  font-size: 0.9rem;
  color: var(--pmdr-navy-700);
}

.academy-login-message.is-error {
  color: #b91c1c;
}

.academy-access-denied {
  max-width: 32rem;
  margin: 4rem auto;
  padding: 2rem;
}
