/* Páginas de proyecto · capa común (se carga después de los estilos de cada página).
   - Botón «volver» con forma propia, alineado a la izquierda.
   - «Para quién / La empresa» y «El reto»: lista editorial numerada en lugar de
     tarjetas con icono en caja (el patrón genérico de plantilla).
   - Móvil: la captura no se monta sobre el texto. */

/* ─── Volver a proyectos ─── */
#pf-hero .pf-back {
  display: flex; width: fit-content; align-items: center; gap: 0.7rem;
  margin: 0 auto 2.75rem 0;
  padding: 0.35rem 1.1rem 0.35rem 0.35rem;
  border-radius: 999px;
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.01em; color: #fff;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
}
#pf-hero .pf-back-ic {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(84,206,130,0.14); color: var(--green-l);
  transition: transform 0.2s ease-out, background-color 0.2s ease-out, color 0.2s ease-out;
}
#pf-hero .pf-back-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#pf-hero .pf-back:hover { border-color: rgba(84,206,130,0.45); background: rgba(84,206,130,0.06); color: #fff; }
#pf-hero .pf-back:hover .pf-back-ic { background: var(--green-l); color: #0b2a18; transform: translateX(-3px); }
#pf-hero .pf-back:focus-visible { outline: 2px solid var(--green-l); outline-offset: 3px; }

/* ─── Para quién / La empresa: lista numerada ─── */
.gx-services, .gx-services.gx-single {
  display: block; counter-reset: gx;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.gx-svc {
  counter-increment: gx;
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); column-gap: 1.1rem; row-gap: 0.3rem;
  padding: 1.35rem 0; border: 0; border-bottom: 1px solid rgba(255,255,255,0.12);
  border-radius: 0; background: none;
}
.gx-svc::before {
  content: counter(gx, decimal-leading-zero);
  grid-row: 1 / span 2; align-self: start;
  font-size: 1.9rem; font-weight: 900; line-height: 1; letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px rgba(84,206,130,0.75);
  transition: color 0.25s ease-out;
}
.gx-svc:hover::before { color: var(--green-l); }
.gx-svc .lp-ic { display: none; }
.gx-svc b { margin: 0; font-size: 1.05rem; font-weight: 800; color: #fff; line-height: 1.3; }
.gx-svc span:not(.lp-ic) { font-size: 0.92rem; line-height: 1.6; color: rgba(255,255,255,0.68); }
.gx-side { gap: 1.75rem; }
.gx-logo { background: none; border: 0; padding: 0; justify-content: flex-start; }
.gx-logo img { width: min(200px, 60%); }

/* ─── El reto: título fijo a la izquierda, problemas numerados a la derecha ─── */
#problema.lp-sec, #problema .lp-reto-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
}
#problema .lp-head { text-align: left; margin: 0; max-width: none; position: sticky; top: 130px; }
#problema .lp-head .section-desc { margin: 0; }
#problema .lp-problems {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.25rem;
  counter-reset: pb;
}
#problema .lp-problem {
  counter-increment: pb; position: relative;
  padding: 1.5rem 0 1.6rem; border: 0; border-top: 1px solid rgba(255,255,255,0.14);
  border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
#problema .lp-problem:hover { transform: none; }
#problema .lp-problem::before {
  content: counter(pb, decimal-leading-zero);
  display: block; margin-bottom: 0.65rem;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.2em; color: var(--green-l);
}
#problema .lp-problem::after {
  content: ""; position: absolute; top: -1px; left: 0; height: 2px; width: 28px;
  background: var(--green-l); transition: width 0.35s ease-out;
}
#problema .lp-problem:hover::after { width: 88px; }
#problema .lp-problem .lp-ic { display: none; }
#problema .lp-problem h3 { font-size: 1.12rem; margin-bottom: 0.45rem; }
/* Con las fotos del cliente de fondo, la lista va sobre un panel para leerse bien. */
.lp-reto #problema-list, .lp-reto .lp-problems {
  background: rgba(15,17,69,0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 22px; padding: 0.5rem 1.75rem 0.75rem;
}

@media (max-width: 960px) {
  #problema.lp-sec, #problema .lp-reto-inner { grid-template-columns: 1fr; }
  #problema .lp-head { position: static; }
}
@media (max-width: 620px) {
  #problema .lp-problems { grid-template-columns: 1fr; }
  .lp-reto .lp-problems { padding: 0.25rem 1.1rem 0.5rem; }
  .gx-svc { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .gx-svc::before { font-size: 1.5rem; }
}

/* ─── Móvil: captura y texto no se solapan ─── */
@media (max-width: 860px) {
  .pf-block { gap: 1.75rem; }
  .pf-text { position: relative; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-svc::before, #problema .lp-problem::after, #pf-hero .pf-back, #pf-hero .pf-back-ic { transition: none; }
}

/* ─── Ajustes tras auditoría ─── */
/* «overflow: hidden» convertía la sección en contenedor de scroll y anulaba el título fijo. */
#problema.lp-reto { overflow: clip; }
#pf-hero .pf-back { font-size: 0.95rem; }
#pf-hero .pf-back:active { transform: scale(0.98); }
/* La primera fila ya va pegada al borde del panel: sin doble línea. */
.lp-reto #problema .lp-problem:nth-child(-n+2), #problema.lp-reto .lp-problem:nth-child(-n+2) { border-top-color: transparent; }
/* Los números no son enlaces: el resalte solo donde hay ratón. */
@media (hover: none) {
  .gx-svc:hover::before { color: transparent; }
  #problema .lp-problem:hover::after { width: 28px; }
}
.pf-block-label { font-size: 0.75rem; letter-spacing: 0.16em; }
@media (max-width: 620px) {
  .lp-reto .lp-reto-inner { padding-inline: 0; }
  .lp-reto .lp-problems { padding-inline: 1rem; border-radius: 0; border-inline: 0; }
  .lp-reto #problema .lp-head, #problema.lp-reto .lp-head { padding-inline: 6%; }
  #problema.lp-reto .lp-problem:nth-child(2) { border-top-color: rgba(255,255,255,0.14); }
  .gx-svc::before { -webkit-text-stroke: 1.25px rgba(84,206,130,0.9); }
}

/* ─── Capturas ampliables ─── */
.pf-zoomable { cursor: zoom-in; position: relative; }
.pf-zoomable::after {
  content: ""; position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(15,17,69,0.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2354ce82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 20px no-repeat;
  border: 1px solid rgba(84,206,130,0.4); opacity: 0.85; transition: opacity 0.2s ease-out, transform 0.2s ease-out; pointer-events: none;
}
.pf-zoomable:hover::after { opacity: 1; transform: scale(1.08); }
.pf-zoomable:focus-visible { outline: 2px solid var(--green-l); outline-offset: 4px; }

.pf-lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(6,9,36,0.94); color: #fff; overflow: hidden;
}
.pf-lb::backdrop { background: rgba(6,9,36,0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pf-lb[open] { display: flex; align-items: center; justify-content: center; animation: pf-lb-in 0.25s ease-out; }
@keyframes pf-lb-in { from { opacity: 0; } }
.pf-lb-fig { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem; padding: 64px 72px 24px; }
.pf-lb-fig img { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.pf-lb-fig figcaption { font-size: 0.92rem; color: rgba(255,255,255,0.75); text-align: center; max-width: 720px; }
.pf-lb-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); transition: background-color 0.2s, border-color 0.2s;
}
.pf-lb-btn:hover { background: rgba(84,206,130,0.2); border-color: rgba(84,206,130,0.6); }
.pf-lb-btn:focus-visible { outline: 2px solid var(--green-l); outline-offset: 3px; }
.pf-lb-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pf-lb-close { top: 14px; right: 14px; }
.pf-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.pf-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .pf-lb-fig { padding: 64px 10px 84px; }
  .pf-lb-fig img { max-height: calc(100dvh - 190px); border-radius: 8px; }
  .pf-lb-prev, .pf-lb-next { top: auto; bottom: 18px; transform: none; }
  .pf-lb-prev { left: calc(50% - 60px); } .pf-lb-next { right: calc(50% - 60px); }
  .pf-zoomable::after { width: 32px; height: 32px; background-size: 17px; right: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .pf-lb[open] { animation: none; } }
