/* Visor de guías: estilos. Sin dependencias externas. */
.v {
  --v-bg: #26292f;
  --v-bg-2: #1b1d22;
  --v-bar: rgba(20, 22, 26, 0.92);
  --v-text: #f2f3ef;
  --v-muted: #a9b0bb;
  --v-line: rgba(255, 255, 255, 0.12);
  --v-accent: #eba53a;
  --v-paper: #ffffff;
  --v-modal: #ffffff;
  --v-modal-text: #121a29;
  --v-modal-muted: #5a6474;
  --v-modal-line: #dcdfd8;
  --v-font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 40%, var(--v-bg) 0%, var(--v-bg-2) 100%);
  color: var(--v-text);
  font-family: var(--v-font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  .v {
    --v-modal: #1f2329;
    --v-modal-text: #f2f3ef;
    --v-modal-muted: #a9b0bb;
    --v-modal-line: rgba(255, 255, 255, 0.14);
  }
}
.v *,
.v *::before,
.v *::after {
  box-sizing: border-box;
}
.v [hidden] {
  display: none !important;
}
.v button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
.v :focus-visible {
  outline: 2px solid var(--v-accent);
  outline-offset: 2px;
}

/* Botones */
.v-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--v-text);
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}
.v-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.v-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--v-accent);
  color: #1b1d22;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
}

/* Cabecera */
.v-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--v-bar);
  border-bottom: 1px solid var(--v-line);
  z-index: 3;
}
.v-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v-top-actions {
  display: flex;
  gap: 2px;
}
.v--embed .v-back {
  display: none;
}
.v--embed .v-title {
  padding-left: 6px;
}

/* Escenario */
.v-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.v-book {
  position: relative;
  perspective: 2600px;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.45, 0.05, 0.35, 1), opacity 0.3s;
  touch-action: pan-y pinch-zoom;
}
.v.is-ready .v-book {
  opacity: 1;
}
.v--spread .v-book.solo-der {
  transform: translateX(-25%);
}
.v--spread .v-book.solo-izq {
  transform: translateX(25%);
}
.v-slot {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
  background: var(--v-paper);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.v-slot img,
.v-leaf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.v-slot.is-empty {
  visibility: hidden;
}
.v-slot--right {
  left: 0;
  width: 100%;
}
.v-slot--left {
  display: none;
}
.v--spread .v-slot--left {
  display: block;
  left: 0;
  width: 50%;
}
.v--spread .v-slot--right {
  left: 50%;
  width: 50%;
}
/* Sombra del lomo */
.v--spread .v-slot::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9%;
  pointer-events: none;
  z-index: 1;
}
.v--spread .v-slot--left::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.05) 45%, transparent);
}
.v--spread .v-slot--right::after {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.05) 45%, transparent);
}

/* Hoja que gira */
.v-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}
.v-leaf--fwd {
  left: 50%;
  transform-origin: left center;
}
.v-leaf--back {
  left: 0;
  transform-origin: right center;
}
.v-leaf__face {
  position: absolute;
  inset: 0;
  background: var(--v-paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.v-leaf__back {
  transform: rotateY(180deg);
}
.v-leaf__shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.v-leaf--fwd .v-leaf__front .v-leaf__shade,
.v-leaf--back .v-leaf__back .v-leaf__shade {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1) 60%, transparent);
}
.v-leaf--fwd .v-leaf__back .v-leaf__shade,
.v-leaf--back .v-leaf__front .v-leaf__shade {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1) 60%, transparent);
}

/* Flechas laterales */
.v-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32) !important;
  transition: opacity 0.2s, background 0.2s;
}
.v-nav:hover {
  background: rgba(0, 0, 0, 0.55) !important;
}
.v-nav--prev {
  left: 14px;
}
.v-nav--next {
  right: 14px;
}
.v.at-start .v-nav--prev,
.v.at-end .v-nav--next {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 599px) {
  .v-nav {
    display: none;
  }
}

/* Carga */
.v-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.3s;
}
.v-loading span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--v-line);
  border-top-color: var(--v-accent);
  animation: v-spin 0.8s linear infinite;
}
.v.is-ready .v-loading {
  opacity: 0;
}
@keyframes v-spin {
  to {
    transform: rotate(360deg);
  }
}
.v-error {
  max-width: 420px;
  padding: 16px;
  text-align: center;
  color: var(--v-muted);
}

/* Zonas de vídeo y enlace */
.v-hs-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.v-hs {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.v-hs:hover {
  background: rgba(35, 72, 196, 0.12);
  box-shadow: inset 0 0 0 2px rgba(35, 72, 196, 0.55);
}
.v-hs__play {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  max-width: 80%;
  max-height: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: v-pulse 2.2s infinite;
}
.v-hs__play svg {
  margin-left: 3px;
}
@keyframes v-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
.v-hs.is-playing {
  background: #000;
}
.v-hs iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Barra inferior */
.v-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: var(--v-bar);
  border-top: 1px solid var(--v-line);
  z-index: 3;
}
.v-brand {
  color: var(--v-muted);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v-pager {
  display: flex;
  align-items: center;
  gap: 2px;
}
.v.at-start .v-first,
.v.at-start .v-prev,
.v.at-end .v-next,
.v.at-end .v-last {
  opacity: 0.35;
  pointer-events: none;
}
.v-count {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 6px;
  font-variant-numeric: tabular-nums;
  color: var(--v-muted);
}
.v-input {
  width: 64px;
  height: 32px;
  border: 1px solid var(--v-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--v-text);
  font: inherit;
  text-align: center;
}
.v-tools {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}
@media (max-width: 599px) {
  .v-bar {
    grid-template-columns: 1fr auto;
    padding-left: 6px;
    padding-right: 6px;
  }
  .v-brand,
  .v-first,
  .v-last {
    display: none;
  }
  .v-input {
    width: 56px;
  }
}

/* Miniaturas */
.v-thumbs {
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  background: var(--v-bar);
  border-top: 1px solid var(--v-line);
  scrollbar-width: thin;
}
.v-thumbs button {
  flex: none;
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--v-muted);
  font-size: 12px;
}
.v-thumbs img {
  display: block;
  height: 96px;
  width: auto;
  aspect-ratio: var(--v-aspect);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s;
}
.v-thumbs button:hover img {
  outline-color: var(--v-line);
}
.v-thumbs button.is-current {
  color: var(--v-text);
}
.v-thumbs button.is-current img {
  outline-color: var(--v-accent);
}

/* Zoom */
.v-zoom {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--v-bg-2);
}
.v-zoom__scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
}
.v-zoom__scroll:active {
  cursor: grabbing;
}
.v-zoom__pages {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.v-zoom__pages img {
  display: block;
  height: calc(var(--z, 1.6) * (100vh - 48px));
  width: auto;
  max-width: none;
  aspect-ratio: var(--v-aspect);
  background: var(--v-paper);
}
@media (orientation: portrait) {
  .v-zoom__pages img {
    height: auto;
    width: calc(var(--z, 1.6) * (100vw - 48px));
  }
}
.v-zoom__tools {
  position: absolute;
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--v-bar);
}

/* Ventanas */
.v-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(4px);
  user-select: text;
  -webkit-user-select: text;
}
.v-modal__box {
  position: relative;
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 24px;
  border-radius: 16px;
  background: var(--v-modal);
  color: var(--v-modal-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.v-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--v-modal-text);
}
.v-modal__close:hover {
  background: rgba(127, 127, 127, 0.15);
}
.v-modal h2 {
  margin: 0 40px 16px 0;
  font-size: 20px;
}
.v-modal--video .v-modal__box {
  width: min(1100px, 100%);
  padding: 0;
  background: #000;
  color: #fff;
  overflow: visible;
}
.v-modal--video .v-modal__close {
  top: -46px;
  right: 0;
  color: #fff;
}
.v-video {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 140px);
  margin: 0 auto;
}
.v-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}
.v-video__title {
  margin: 0;
  padding: 12px 16px;
  font-weight: 600;
}
.v-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.v-list button,
.v-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--v-modal-line);
  color: var(--v-modal-text);
  text-align: left;
  text-decoration: none;
}
.v-list button:hover,
.v-list a:hover {
  border-color: var(--v-accent);
}
.v-list img {
  width: 44px;
  aspect-ratio: var(--v-aspect);
  object-fit: cover;
  border-radius: 3px;
  background: var(--v-modal-line);
}
.v-list span {
  flex: 1;
  display: grid;
}
.v-list small {
  color: var(--v-modal-muted);
}
.v-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  margin-bottom: 14px;
}
.v-field > span {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--v-modal-muted);
}
.v-field input,
.v-field textarea,
.v-editor textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--v-modal-line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
}
.v-field button,
.v-editor button {
  align-self: start;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--v-modal-line);
  color: var(--v-modal-text);
  font-weight: 600;
}
.v .v-primary {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--v-accent);
  border-color: var(--v-accent);
  color: #1b1d22;
  font-weight: 700;
}

/* Modo edición */
.v--edit .v-slot {
  cursor: crosshair;
}
.v--edit .v-hs {
  background: rgba(235, 165, 58, 0.18);
  box-shadow: inset 0 0 0 2px var(--v-accent);
}
.v-hs__del {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c13f2b;
  color: #fff;
  font: 700 15px/22px var(--v-font);
  text-align: center;
  cursor: pointer;
  z-index: 2;
}
.v-hs__tag {
  position: absolute;
  left: 0;
  bottom: 100%;
  max-width: 100%;
  padding: 2px 6px;
  background: var(--v-accent);
  color: #1b1d22;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.v-draw {
  position: absolute;
  z-index: 3;
  border: 2px dashed var(--v-accent);
  background: rgba(235, 165, 58, 0.2);
  pointer-events: none;
}
.v-editor {
  position: absolute;
  left: 12px;
  bottom: 70px;
  z-index: 8;
  width: min(340px, calc(100% - 24px));
  max-height: 60%;
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: var(--v-modal);
  color: var(--v-modal-text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  user-select: text;
}
.v-editor h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.v-editor p {
  margin: 0 0 8px;
  color: var(--v-modal-muted);
}
.v-editor__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .v-book {
    transition: none;
  }
  .v-hs__play {
    animation: none;
  }
}

/* ---------- Modo scroll vertical (por defecto) ---------- */
.v-scroll {
  display: none;
}
.v--scroll .v-book,
.v--scroll .v-nav {
  display: none;
}
.v--scroll .v-stage {
  display: block;
}
.v--scroll .v-scroll {
  display: block;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.v-col {
  width: var(--v-col, 100%);
  margin: 0 auto;
  padding: 16px 0 40px;
  display: grid;
  gap: 14px;
}
.v-page {
  position: relative;
  aspect-ratio: var(--v-aspect);
  background: var(--v-paper);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.v-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.v--edit .v-page {
  cursor: crosshair;
}
/* En scroll, las flechas de la barra apuntan arriba / abajo */
.v--scroll .v-pager svg {
  transform: rotate(90deg);
}
@media (max-width: 599px) {
  .v-col {
    padding: 0 0 24px;
    gap: 6px;
  }
  .v-page {
    box-shadow: none;
  }
}

/* ---------- Elementos superpuestos: textos, botones y portadas de vídeo ---------- */
.v-page,
.v-slot {
  container-type: inline-size;
}
.v-txt {
  position: absolute;
  font-family: 'Inter', 'Helvetica Neue', Arial, var(--v-font);
  font-weight: 700;
  font-stretch: condensed;
  white-space: pre;
  pointer-events: none;
}
.v-hs--btn {
  display: grid;
  place-items: center;
}
.v-hs--btn:hover {
  background: none;
  box-shadow: none;
}
.v-hs__btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--btn, #ffb701);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}
.v-hs__btn svg {
  width: 62%;
  height: 62%;
  stroke-width: 2.4;
}
.v-hs--btn:hover .v-hs__btn {
  transform: scale(1.08);
}
.v-hs.has-poster {
  background-color: #000;
  background-size: cover;
  background-position: center;
  border-radius: 0;
}
.v-hs.has-poster .v-hs__play {
  width: 18cqw;
  height: 18cqw;
  max-width: 84px;
  max-height: 84px;
}
.v-hs.is-playing {
  background-image: none !important;
}
