/* GANK Pages · base compartida (tokens, tipografía, botones, índice, portada, tarjetas,
   contador, cierre, barra móvil y aparición). Todo va dentro de .gkp; sin !important.
   Carga solo en las páginas gestionadas, antes del CSS de cada plantilla. */

/* ---------- Contenedor del tema ---------- */
#content:has(> .gkp) {
  padding: 0;
  overflow: clip;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.tv-main-div:has(.gkp) {
  overflow: clip;
}

/* ---------- Tokens y base ---------- */
.gkp {
  --gkp-yellow: #ffd400;
  --gkp-yellow-hover: #ffe04d;
  --gkp-black: #141414;
  --gkp-black-hover: #2b2b2b;
  --gkp-page: #f2f2f2;
  --gkp-soft: #f5f5f5;
  --gkp-card: #ffffff;
  --gkp-line: #dedede;
  --gkp-text-2: #4f4f4f;
  --gkp-muted: #595959;
  --gkp-radius: 15px;
  --gkp-gap: 16px;
  --gkp-pad: 56px;
  --gkp-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gkp-sticky-top: 0px;
  position: relative;
  color: var(--gkp-black);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.gkp.gkp *,
.gkp.gkp *::before,
.gkp.gkp *::after {
  box-sizing: border-box;
}
.gkp.gkp :is(h1, h2, h3, p, ul, ol, li, figure, figcaption) {
  margin: 0;
  padding: 0;
  font-family: inherit;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
}
.gkp.gkp :is(ul, ol) {
  list-style: none;
}
.gkp.gkp img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}
.gkp.gkp strong {
  font-weight: 700;
}
.gkp.gkp a {
  text-decoration: none;
}
.gkp .gkp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gkp-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gkp-gap);
}

/* ---------- Tipografía ---------- */
.gkp.gkp .gkp-code {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gkp-muted);
}
.gkp.gkp .gkp-code--light {
  color: rgba(255, 255, 255, 0.72);
}
.gkp .gkp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--gkp-yellow);
  color: var(--gkp-black);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.gkp.gkp .gkp-h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.gkp.gkp .gkp-h2--light {
  color: #ffffff;
}
.gkp.gkp .gkp-lead {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
}
.gkp.gkp .gkp-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gkp-text-2);
}
.gkp.gkp .gkp-text--sm {
  font-size: 14px;
  line-height: 1.72;
}
.gkp.gkp .gkp-text--light {
  color: rgba(255, 255, 255, 0.76);
}
.gkp.gkp .gkp-text--light strong {
  color: #ffffff;
}
.gkp.gkp .gkp-text--ink {
  color: #2e2a12;
  font-size: 16px;
}

/* Resaltado amarillo que se desliza */
.gkp.gkp .gkp-mark {
  padding: 0 0.16em;
  border-radius: 6px;
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(var(--gkp-yellow), var(--gkp-yellow));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 100% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.gkp.gkp-js .gkp-mark {
  background-size: 0% 100%;
}
.gkp.gkp-js .gkp-mark.is-in {
  animation: gkpMark 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.12s both;
}
@keyframes gkpMark {
  from { background-size: 0% 100%; }
  to { background-size: 100% 100%; }
}
/* Sobre fondo oscuro el texto resaltado pasa a negro para mantener contraste */
.gkp.gkp :is(.gkp-h2--light, .gkp-panel--dark) .gkp-mark {
  color: var(--gkp-black);
}
.gkp.gkp-js :is(.gkp-h2--light, .gkp-panel--dark) .gkp-mark:not(.is-in) {
  color: #ffffff;
}
.gkp.gkp-js :is(.gkp-h2--light, .gkp-panel--dark) .gkp-mark.is-in {
  animation-name: gkpMarkInk;
}
@keyframes gkpMarkInk {
  from { background-size: 0% 100%; color: #ffffff; }
  45% { color: #ffffff; }
  to { background-size: 100% 100%; color: var(--gkp-black); }
}

/* ---------- Botones ---------- */
.gkp.gkp .gkp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 14px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--gkp-radius);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s var(--gkp-ease), box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}
.gkp .gkp-btn .gkp-ic {
  flex-shrink: 0;
  transition: transform 0.22s var(--gkp-ease);
}
.gkp.gkp .gkp-btn:focus-visible {
  outline: 3px solid var(--gkp-black);
  outline-offset: 3px;
}
.gkp.gkp .gkp-btn--yellow { background: var(--gkp-yellow); color: var(--gkp-black); }
.gkp.gkp .gkp-btn--black { background: var(--gkp-black); color: #ffffff; }
.gkp.gkp .gkp-btn--line { background: transparent; color: var(--gkp-black); border-color: var(--gkp-black); }
.gkp.gkp .gkp-btn--glass { background: rgba(20, 20, 20, 0.55); color: #ffffff; border-color: rgba(255, 255, 255, 0.7); }
.gkp.gkp .gkp-btn--glass:focus-visible { outline-color: var(--gkp-yellow); }
.gkp.gkp .gkp-btn--sm {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 13px;
}

@media (hover: hover) {
  .gkp.gkp .gkp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(20, 20, 20, 0.16);
  }
  .gkp .gkp-btn:hover .gkp-ic--up { transform: translate(3px, -3px); }
  .gkp .gkp-btn:hover .gkp-ic--right { transform: translateX(4px); }
  .gkp.gkp .gkp-btn--yellow:hover { background: var(--gkp-yellow-hover); color: var(--gkp-black); }
  .gkp.gkp .gkp-btn--black:hover { background: var(--gkp-black-hover); color: #ffffff; }
  .gkp.gkp .gkp-btn--line:hover { background: var(--gkp-black); color: #ffffff; }
  .gkp.gkp .gkp-btn--glass:hover { background: var(--gkp-yellow); color: var(--gkp-black); border-color: var(--gkp-yellow); }
}
.gkp.gkp .gkp-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

.gkp .gkp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- Chips ---------- */
.gkp.gkp .gkp-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gkp.gkp .gkp-chip--white { background: #ffffff; color: var(--gkp-black); }
.gkp.gkp .gkp-chip--yellow { background: var(--gkp-yellow); color: var(--gkp-black); }
.gkp.gkp .gkp-chip--dark { background: var(--gkp-black); color: var(--gkp-yellow); }

/* ---------- Paneles ---------- */
.gkp .gkp-panel {
  position: relative;
  padding: var(--gkp-pad);
  border-radius: var(--gkp-radius);
  background: var(--gkp-card);
  border: 1px solid var(--gkp-line);
  scroll-margin-top: calc(var(--gkp-sticky-top) + 96px);
}
.gkp .gkp-panel--soft { background: var(--gkp-soft); border-color: transparent; }
.gkp .gkp-panel--dark { background: var(--gkp-black); border-color: var(--gkp-black); color: #ffffff; }
.gkp .gkp-panel--yellow { background: var(--gkp-yellow); border-color: var(--gkp-yellow); }
.gkp.gkp img.gkp-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Vista previa ---------- */
.gkp.gkp .gkp-preview-banner {
  margin-bottom: var(--gkp-gap);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--gkp-black);
  color: var(--gkp-yellow);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Índice fijo ---------- */
.gkp .gkp-nav {
  position: sticky;
  top: var(--gkp-sticky-top);
  z-index: 30;
  margin-bottom: 14px;
  padding-top: 8px;
  background: var(--gkp-page);
}
.gkp .gkp-nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--gkp-line);
  border-radius: var(--gkp-radius);
}
.gkp .gkp-nav__list {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  /* El arrastre lateral se queda dentro de la tira: no empuja la página ni activa el gesto de "atrás" */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 32px;
  /* Desvanecido en los bordes solo cuando hay más capítulos hacia ese lado (lo calcula front.js) */
  --gkp-fade-l: 0px;
  --gkp-fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gkp-fade-l), #000 calc(100% - var(--gkp-fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gkp-fade-l), #000 calc(100% - var(--gkp-fade-r)), transparent 100%);
}
.gkp .gkp-nav__list.is-more-start { --gkp-fade-l: 32px; }
.gkp .gkp-nav__list.is-more-end { --gkp-fade-r: 32px; }
.gkp .gkp-nav__list::-webkit-scrollbar { display: none; }
.gkp.gkp .gkp-nav__pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--gkp-black);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.gkp .gkp-nav__num {
  font-size: 11px;
  font-weight: 900;
  opacity: 0.7;
}
.gkp.gkp .gkp-nav__pill.is-active,
.gkp.gkp .gkp-nav__pill[aria-current="true"] {
  background: var(--gkp-black);
  color: #ffffff;
}
@media (hover: hover) {
  .gkp.gkp .gkp-nav__pill:not(.is-active):hover { background: #ededed; }
}
.gkp.gkp .gkp-nav__pill:focus-visible {
  outline: 3px solid var(--gkp-black);
  outline-offset: -3px;
}
.gkp .gkp-nav__cta { flex-shrink: 0; }
.gkp .gkp-nav__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--gkp-yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.15s linear;
}

/* ---------- Portada ---------- */
.gkp .gkp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--gkp-gap);
}
.gkp .gkp-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: var(--gkp-pad);
  background: var(--gkp-soft);
  border: 1px solid var(--gkp-line);
  border-left: 8px solid var(--gkp-yellow);
  border-radius: var(--gkp-radius);
}
.gkp.gkp .gkp-hero__title {
  font-size: clamp(38px, 4.2vw, 60px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.gkp.gkp .gkp-hero__intro {
  max-width: 580px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--gkp-text-2);
}
.gkp .gkp-hero__media {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: var(--gkp-radius);
  background: #2a2a2a;
}
.gkp .gkp-hero__media picture,
.gkp .gkp-hero__media img {
  position: absolute;
  inset: 0;
}
.gkp .gkp-hero__chips {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

/* ---------- Encabezado en dos columnas ---------- */
.gkp .gkp-split-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: var(--gkp-pad);
  align-items: end;
  margin-bottom: 32px;
}
.gkp .gkp-split-head__main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 03 Experiencia ---------- */
.gkp .gkp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gkp-gap);
}
.gkp .gkp-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px;
  background: #ffffff;
  border: 1px solid var(--gkp-line);
  border-radius: var(--gkp-radius);
}
.gkp .gkp-card .gkp-num { align-self: flex-start; }
.gkp.gkp .gkp-card__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.gkp.gkp .gkp-count {
  display: flex;
  align-items: flex-start;
  font-size: clamp(88px, 11vw, 168px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.gkp .gkp-count__roll {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}
.gkp .gkp-count__reel {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, var(--to), 0);
}
.gkp.gkp-js .gkp-count__reel {
  transform: translate3d(0, 0, 0);
  transition: transform var(--dur) cubic-bezier(0.16, 0.82, 0.25, 1) var(--del);
  will-change: transform;
}
.gkp.gkp-js .gkp-count.is-in .gkp-count__reel {
  transform: translate3d(0, var(--to), 0);
}
.gkp .gkp-count__reel span {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}
.gkp .gkp-count__comma {
  display: inline-block;
  line-height: 1;
}

/* ---------- Cierre ---------- */
.gkp .gkp-closing {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 80px;
}
.gkp.gkp .gkp-closing__small {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gkp.gkp .gkp-closing__title {
  max-width: 1060px;
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.gkp .gkp-closing__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gkp-pad);
  align-items: end;
}
.gkp .gkp-closing__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
}
.gkp.gkp .gkp-closing__sign {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #3a3a3a;
}

/* ---------- Barra móvil ---------- */
.gkp .gkp-mobilebar { display: none; }

/* ---------- Aparición al hacer scroll ---------- */
.gkp.gkp-js .gkp-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.7s var(--gkp-ease), transform 0.8s var(--gkp-ease);
}
.gkp.gkp-js .gkp-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Tableta ---------- */
@media (max-width: 1100px) {
  .gkp { --gkp-pad: 40px; }
  .gkp .gkp-hero { grid-template-columns: 1fr; }
  .gkp .gkp-hero__media { min-height: 420px; }
  .gkp .gkp-split-head,
  .gkp .gkp-closing__grid { grid-template-columns: 1fr; gap: 32px; }
  .gkp .gkp-closing__side { align-items: flex-start; }
  .gkp .gkp-cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  #content-wrapper:has(.gkp) {
    padding-right: 0;
    padding-left: 0;
  }
  body:has(.gkp-mobilebar) .wa-float {
    display: none;
  }
  /* La barra móvil ya trae su botón "subir": se oculta el del tema mientras está visible */
  body:has(.gkp-mobilebar.is-visible) .tvbottom-to-top {
    visibility: hidden; /* el tema fuerza display con !important */
    pointer-events: none;
  }
  body:has(.gkp-mobilebar) {
    padding-bottom: 84px;
  }
  .gkp {
    --gkp-pad: 20px;
    --gkp-gap: 12px;
  }
  .gkp .gkp-panel { padding: 24px 20px; }
  .gkp .gkp-nav { margin-bottom: 10px; padding: 8px 0 0; }
  .gkp .gkp-nav__inner { min-height: 0; padding: 6px; border-radius: 12px; }
  .gkp.gkp .gkp-nav__pill { min-height: 42px; padding: 0 12px; }
  .gkp.gkp .gkp-nav__cta { display: none; }
  .gkp .gkp-hero__copy { gap: 18px; padding: 24px 20px; border-left: 1px solid var(--gkp-line); border-top: 6px solid var(--gkp-yellow); }
  .gkp.gkp .gkp-hero__title { font-size: 36px; line-height: 1.05; }
  .gkp.gkp .gkp-hero__intro { font-size: 15px; line-height: 1.65; }
  .gkp .gkp-hero__media { min-height: 0; aspect-ratio: 4 / 3; order: -1; }
  .gkp .gkp-hero { gap: 0; }
  .gkp .gkp-hero__media { border-radius: var(--gkp-radius) var(--gkp-radius) 0 0; }
  .gkp .gkp-hero__copy { border-radius: 0 0 var(--gkp-radius) var(--gkp-radius); border-top-width: 6px; }
  .gkp .gkp-hero__chips { top: auto; bottom: 12px; left: 12px; right: 12px; }
  .gkp .gkp-actions { flex-direction: column; align-items: stretch; }
  .gkp.gkp .gkp-btn { width: 100%; }
  .gkp.gkp .gkp-h2 { font-size: 32px; line-height: 1.06; }
  .gkp.gkp .gkp-lead { font-size: 16px; }
  .gkp .gkp-split-head { gap: 14px; margin-bottom: 20px; }
  .gkp .gkp-cards {
    display: flex;
    gap: 10px;
    padding: 4px 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .gkp .gkp-cards::-webkit-scrollbar { display: none; }
  .gkp .gkp-card { flex: 0 0 82%; padding: 24px; scroll-snap-align: start; }
  .gkp.gkp .gkp-card__title { font-size: 19px; }
  .gkp .gkp-closing { gap: 18px; padding: 32px 20px 28px; }
  .gkp.gkp .gkp-closing__title { font-size: 40px; line-height: 1; }
  .gkp .gkp-closing__side { align-items: stretch; }
  .gkp .gkp-mobilebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid var(--gkp-line);
    transform: translate3d(0, 110%, 0);
    transition: transform 0.3s var(--gkp-ease);
  }
  .gkp .gkp-mobilebar.is-visible { transform: none; }
  .gkp.gkp .gkp-mobilebar__cta { flex-grow: 1; width: auto; }
  .gkp.gkp .gkp-mobilebar__top {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1.5px solid var(--gkp-black);
    border-radius: var(--gkp-radius);
    color: var(--gkp-black);
  }
}

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .gkp.gkp-js .gkp-reveal { opacity: 1; transform: none; transition: none; }
  .gkp.gkp .gkp-mark,
  .gkp.gkp-js .gkp-mark,
  .gkp.gkp-js :is(.gkp-h2--light, .gkp-panel--dark) .gkp-mark.is-in { background-size: 100% 100%; animation: none; }
  .gkp.gkp-js .gkp-count__reel { transform: translate3d(0, var(--to), 0); transition: none; }
  .gkp.gkp .gkp-btn,
  .gkp .gkp-btn .gkp-ic,
  .gkp .gkp-nav__progress,
  .gkp .gkp-mobilebar { transition: none; }
}
