/* =====================================================================
   COMPONENTE · CARRUSEL DE PROYECTOS (views/components/global/proyectos-carrusel.php)
   Lo usan el home (bloque 04) y Desarrollo web (bloque 04).
   El tarjetón de cierre de cada ficha (navegador + texto) en scroll
   horizontal con snap. La siguiente asoma por la derecha (sin velo) y debajo va
   un marcador de barras tipo "stories" que se llenan con el scroll
   (JS al final de index.php). Plancha oscura. El marcador usa --hp4-ink: tinta oscura por
   defecto (fondo claro) y blanca con .hp4-carousel--on-dark.
   ===================================================================== */
.gd-page .hp4-carousel { --hp4-ink: 10, 10, 10; }
.gd-page .hp4-carousel--on-dark { --hp4-ink: 255, 255, 255; }
.gd-page .hp4-carousel { position: relative; }
.gd-page .hp4-slide > * { min-width: 0; }
.gd-page .hp4-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
}
.gd-page .hp4-track::-webkit-scrollbar { display: none; }
.gd-page .hp4-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.gd-page .hp4-track:focus-visible { outline: 2px solid #E8501F; outline-offset: 4px; }

.gd-page .hp4-slide {
  flex: 0 0 min(1020px, 86%);
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 32px;
  background: #0D1014;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.gd-page .hp4-frame {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #161A1F;
  text-decoration: none;
}
.gd-page .hp4-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.gd-page .hp4-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.gd-page .hp4-dot.is-r { background: #FF5F57; }
.gd-page .hp4-dot.is-y { background: #FEBC2E; }
.gd-page .hp4-dot.is-g { background: #28C840; }
.gd-page .hp4-url { margin-left: 12px; letter-spacing: 0.02em; }
.gd-page .hp4-frame img { display: block; width: 100%; height: auto; -webkit-user-drag: none; }

.gd-page .hp4-content { display: flex; flex-direction: column; }
.gd-page .hp4-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FF7B3B;
  margin-bottom: 12px;
}
.gd-page .hp4-title {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}
.gd-page .hp4-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 20px;
}
.gd-page .hp4-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.gd-page .hp4-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 5px 10px;
}
.gd-page .hp4-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  transition: background 200ms ease, color 200ms ease;
}
.gd-page .hp4-btn__arrow { transition: transform 200ms ease; }
/* Todo el tarjetón es clicable: el enlace del botón se estira sobre la plancha */
.gd-page .hp4-slide { position: relative; cursor: pointer; }
.gd-page .hp4-btn::after { content: ''; position: absolute; inset: 0; }
.gd-page .hp4-track.is-dragging .hp4-slide { cursor: grabbing; }
.gd-page .hp4-slide:hover .hp4-btn { background: #fff; color: #0A0A0A; }
.gd-page .hp4-slide:hover .hp4-btn__arrow { transform: translateX(4px); }

/* Marcador: contador mono + barras segmentadas + pista "Desliza" */
.gd-page .hp4-rail {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 28px;
}
.gd-page .hp4-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(var(--hp4-ink), 0.45);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gd-page .hp4-count b { font-weight: 500; color: rgb(var(--hp4-ink)); }
.gd-page .hp4-bars {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}
.gd-page .hp4-bar {
  appearance: none;
  background: none;
  border: 0;
  padding: 12px 0;
  cursor: pointer;
}
.gd-page .hp4-bar i {
  position: relative;
  display: block;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(var(--hp4-ink), 0.14);
  transition: height 200ms ease;
}
.gd-page .hp4-bar i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #E8501F, #FF7B3B 60%, #FFB06B);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}
.gd-page .hp4-bar:hover i,
.gd-page .hp4-bar.is-active i { height: 4px; }
.gd-page .hp4-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--hp4-ink), 0.5);
  white-space: nowrap;
  transition: opacity 300ms ease;
}
.gd-page .hp4-hint__arrow { display: inline-block; color: #E8501F; animation: hp4Nudge 1.6s ease-in-out infinite; }
.gd-page .hp4-carousel.is-end .hp4-hint { opacity: 0; }
@keyframes hp4Nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .gd-page .hp4-hint__arrow { animation: none; }
  .gd-page .hp4-track { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .gd-page .hp4-slide { flex-basis: 88%; grid-template-columns: 1fr; gap: 22px; padding: 18px; }
  .gd-page .hp4-title { font-size: 22px; }
  .gd-page .hp4-rail { gap: 16px; }
  .gd-page .hp4-hint { display: none; }
}
