@import url("/assets/global-nav.css?v=11.9");

:root {
  --v9-nav-height: 50px;
  --v9-header-height: 84px;
  --v9-footer-height: 258px;
  --v9-footer-gutter: clamp(24px, 5vw, 76px);
}

html, body { height: 100%; overscroll-behavior: none; }
body { overflow: hidden; }

body.timeline-separated-navigation {
  display: grid;
  grid-template-rows: var(--v9-header-height) var(--v9-nav-height) minmax(0, 1fr);
}

body.timeline-separated-navigation > .experience {
  height: auto;
  min-height: 0;
}

.global-nav-shell--timeline {
  position: relative;
  z-index: 70;
  height: var(--v9-nav-height);
  min-height: var(--v9-nav-height);
  padding-block: 0;
  background: #ded4bf !important;
}

.timeline-institutional-header {
  box-sizing: border-box;
  position: relative;
  z-index: 71;
  display: flex;
  height: var(--v9-header-height);
  min-height: var(--v9-header-height);
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 8px clamp(24px, 5vw, 76px);
  border-bottom: 1px solid rgba(24, 32, 30, 0.14);
  background: #ded4bf !important;
}

.timeline-institutional-header .brand {
  width: clamp(280px, 36vw, 475px);
  height: 100%;
}

.timeline-institutional-header .brand img {
  width: 100%;
  height: 68px;
  object-fit: contain;
  object-position: left center;
}

.experience {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior-y: none;
  padding: 0;
}

body.timeline-separated-navigation .topbar {
  display: none;
}

/* El menú vive fuera de esta cabecera para no interferir con el logo. */
.topbar .portalReturn { display: none; }

.topbar.is-scrolled {
  background: #ded4bf;
}

.portalReturn {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #765f39;
  border: 1px solid rgba(155, 125, 69, 0.28);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 7px;
  transition: color 180ms ease, background 180ms ease;
}
.portalReturn:hover,
.portalReturn:focus-visible {
  color: #f4efe4;
  outline: 0;
  background: #24332f;
}

.stage {
  box-sizing: border-box;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

/* Escritorio: presencia más panorámica, cercana al A4 horizontal. */
.visual {
  box-sizing: border-box;
  aspect-ratio: 297 / 210;
  border: 1px solid rgba(181, 141, 78, 0.5);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.visual .slide { object-fit: cover; }

.timelineFooter {
  box-sizing: border-box;
  position: relative;
  z-index: 25;
  inset: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.academicFooter {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(230px, 0.9fr) minmax(0, 1.15fr);
  width: calc(100% + (2 * var(--v9-footer-gutter)));
  max-width: none;
  min-width: 0;
  align-items: start;
  gap: 18px;
  margin: 7px calc(-1 * var(--v9-footer-gutter)) -11px;
  padding: 9px var(--v9-footer-gutter) 10px;
  border-top: 1px solid rgba(158, 65, 56, 0.48);
  background: #151817;
  color: #aeb5b1;
}

.academicFooter p { margin: 0; }
.academicFooter > div,
.academicFooter p {
  min-width: 0;
  max-width: 100%;
}
.academicLabel {
  color: #d8c9aa;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 11px;
  line-height: 1.3;
}
.academicDetail {
  margin-top: 3px !important;
  color: #a0aaa6;
  font: italic 10px/1.35 Georgia, "Times New Roman", serif;
}
.academicBlock { text-align: center; }
.academicSignature { text-align: right; }
.academicCopyright {
  grid-column: 1 / -1;
  margin-top: 3px !important;
  padding-top: 3px;
  text-align: center;
  color: #858f8b;
  letter-spacing: 0.08em;
  font-size: 8.5px;
}

/* Escritorio: flechas lineales, discretas y un 40 % menores. */
@media (min-width: 851px) {
  .timelineFooter {
    height: auto;
    min-height: 0;
  }
  .stage { padding-bottom: 42px; }
  .content { align-items: center; }
  .visualFigure {
    justify-self: center;
    width: min(100%, calc((100svh - var(--v9-nav-height) - var(--v9-header-height) - var(--v9-footer-height) - 132px) * 1.4143));
    padding-bottom: 26px;
  }
  .imageCaption {
    min-height: 14px;
    margin: 5px 2px 0;
    color: #575a53;
    font-size: 9px;
    line-height: 1.35;
  }
  .holdControls {
    z-index: 35;
    display: block !important;
    pointer-events: none;
  }
  .holdControl {
    display: grid !important;
    width: 54px;
    height: 92px;
    place-items: center;
    visibility: visible !important;
    pointer-events: auto;
  }
  .holdControlPrevious { left: 12px; }
  .holdControlNext { right: 12px; }
  .holdControl span {
    display: grid !important;
    place-items: center;
    width: 34px;
    height: 34px;
    opacity: 0.78 !important;
    visibility: visible !important;
    color: #9b7d45;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: 27px/1 Georgia, "Times New Roman", serif;
    transform: scale(1);
  }
  .holdControl::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 18px;
    height: 1px;
    background: rgba(155, 125, 69, 0.48);
  }
  .holdControlPrevious::after { left: 31px; }
  .holdControlNext::after { right: 31px; }
  .holdControl:hover span,
  .holdControl.holding span,
  .holdControl:focus-visible span { opacity: 1 !important; transform: scale(1.08); }
  .holdControl:disabled {
    display: grid !important;
    pointer-events: none;
  }
  .holdControl:disabled span { opacity: 0.3 !important; }
  .holdControl:disabled::after { opacity: 0.35; }
}

/* Móvil y tablet: semicírculos al 10 % con una referencia de reloj. */
@media (max-width: 850px) {
  :root {
    --v9-nav-height: 56px;
    --v9-header-height: 72px;
    --v9-footer-height: 139px;
    --v9-footer-gutter: clamp(24px, 5vw, 76px);
  }
  body.timeline-separated-navigation {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--v9-header-height) minmax(0, 1fr);
  }
  body.timeline-separated-navigation > .timeline-institutional-header,
  body.timeline-separated-navigation > .global-nav-shell--timeline {
    grid-column: 1;
    grid-row: 1;
  }
  body.timeline-separated-navigation > .experience {
    grid-column: 1;
    grid-row: 2;
  }
  .global-nav-shell--timeline {
    z-index: 72;
    align-self: stretch;
    justify-self: end;
    justify-content: flex-end;
    width: auto;
    height: var(--v9-header-height);
    min-height: var(--v9-header-height);
    padding: 0 18px;
    border: 0;
    background: transparent !important;
  }
  .global-nav-shell--timeline .global-nav {
    right: 0;
    left: auto;
    width: 100vw;
    max-width: none;
  }
  .timeline-institutional-header {
    height: var(--v9-header-height);
    min-height: var(--v9-header-height);
    padding: 8px 82px 8px 18px;
    background: #ded4bf !important;
  }
  .timeline-institutional-header .brand {
    width: min(68vw, 340px);
  }
  .timeline-institutional-header .brand img {
    height: 56px;
  }
  .experience {
    display: block;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
  }
  body.global-menu-open .experience { overflow: hidden; }
  body.global-menu-open .holdControls {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  body.timeline-separated-navigation .topbar { display: none; }
  .stage {
    min-height: 0;
    overflow: visible;
    padding-bottom: 38px;
  }
  .timelineFooter {
    position: relative;
    inset: auto;
    min-height: 0;
    max-height: none;
    margin-top: 0;
    padding-top: 10px;
    padding-bottom: 7px;
    overflow: visible;
  }
  .visualFigure {
    /* Reserva el pie de foto y una pausa visual antes del footer en flujo. */
    width: 100%;
    max-width: none;
    padding-bottom: clamp(52px, 8vw, 76px);
  }
  .visual {
    aspect-ratio: 4 / 3;
    border: 0;
    border-block: 1px solid rgba(181, 141, 78, 0.5);
  }
  .imageCaption {
    min-height: 20px;
    margin: 10px 8px 0;
    color: #575a53;
    font-size: 9px;
    line-height: 1.45;
  }
  .holdControls {
    z-index: 35;
    inset-block-start: 48%;
    opacity: 1;
    visibility: visible;
    transition: opacity 280ms ease, visibility 280ms ease;
  }
  .holdControls.is-auto-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .holdControls.is-auto-hidden .holdControl {
    pointer-events: none !important;
  }
  .holdControl {
    width: clamp(38px, 10vw, 68px);
    height: clamp(90px, 23vw, 138px);
    overflow: hidden;
    border: 1px solid rgba(184, 149, 85, 0.24);
    background: rgba(28, 36, 34, 0.1);
    box-shadow: 0 8px 28px rgba(28, 24, 17, 0.04);
  }
  .holdControlPrevious { border-left: 0; border-radius: 0 999px 999px 0; }
  .holdControlNext { border-right: 0; border-radius: 999px 0 0 999px; }
  .holdControl::before {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    opacity: 0.11;
    background: repeating-conic-gradient(from -3deg, #c2a166 0deg 1.4deg, transparent 1.4deg 30deg);
    -webkit-mask: radial-gradient(circle, transparent 49%, #000 50% 55%, transparent 56%);
    mask: radial-gradient(circle, transparent 49%, #000 50% 55%, transparent 56%);
  }
  .holdControl span {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    opacity: 0.72;
    color: #b89555;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 20px;
    transform: scale(1);
  }
  .holdControl.holding, .holdControl:focus-visible { background: rgba(28, 36, 34, 0.16); }
  .holdControl.holding span, .holdControl:focus-visible span { opacity: 0.95; transform: scale(1.06); }
  .academicFooter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 12px;
    width: calc(100% + (2 * var(--v9-footer-gutter)));
    margin: 5px calc(-1 * var(--v9-footer-gutter)) -7px;
    padding: 7px var(--v9-footer-gutter);
  }
  .academicProgram { text-align: left; }
  .academicBlock { display: block; text-align: right; }
  .academicSignature { grid-column: 1 / -1; text-align: center; }
  .academicLabel { font-size: 8px; letter-spacing: 0.07em; }
  .academicDetail { font-size: 7.5px; }
  .academicCopyright { grid-column: 1 / -1; margin-top: 3px !important; font-size: 7px; }
}

@media (max-width: 520px) {
  :root {
    --v9-header-height: 62px;
    --v9-footer-height: 145px;
    --v9-footer-gutter: 10px;
  }
  .timeline-institutional-header {
    padding: 5px 82px 5px 18px;
  }
  .timeline-institutional-header .brand {
    width: min(76vw, 315px);
  }
  .timeline-institutional-header .brand img {
    height: 50px;
  }
  .timelineFooter { padding-inline: 10px; }
  .visualFigure { padding-bottom: 64px; }
  .imageCaption {
    margin: 10px 5px 0;
    font-size: 9.5px;
  }
  .academicFooter {
    width: calc(100% + 20px);
    margin: 5px -10px -7px;
    padding: 7px 10px;
    gap: 4px 10px;
  }
  .academicLabel,
  .academicDetail {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .academicDetail {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar, .holdControl, .holdControl span { transition: none; }
}
