/* LULI EN REDES — Sección Fotografía (categorías, galerías y lightbox)
   Usa las variables y la identidad de styles.css. */

.photo-explorer { max-width: 1100px; margin: 0 auto; }

/* Cuando se entra a una categoría o galería, la portada grande cede lugar al contenido */
.service-view.px-deep .photo-hero { display: none; }
.service-view.px-deep .service-header { margin-bottom: 34px; }

/* ---------- Animación de entrada ---------- */
.px-enter { animation: pxIn .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 75ms); }
@keyframes pxIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Navegación: migas de pan + volver ---------- */
.px-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-bottom: 40px; }
.px-up { padding: 10px 18px; font-size: .8rem; }
.px-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .78rem; font-weight: 700; }
.px-crumb { border: 0; background: none; padding: 4px 0; color: var(--muted); cursor: pointer; transition: color .2s ease; }
button.px-crumb:hover { color: var(--blue); text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.px-crumb.is-current { color: var(--blue); cursor: default; }
.px-sep { color: var(--orange); font-weight: 800; }
.px-crumb:focus-visible, .px-card:focus-visible, .px-photo:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; border-radius: 12px; }

.px-head { margin-bottom: 36px; }
.px-head h2:focus { outline: none; }
.px-count { margin: -10px 0 26px; font-size: .8rem; font-weight: 700; color: var(--muted); }

/* ---------- Tarjetas de categoría / subcategoría ---------- */
.px-cards { display: grid; gap: 22px; }
.px-cards-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.px-cards-sub { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.px-card {
  --tint: #e8edf5;
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-align: left;
  border: 1px solid rgba(38, 53, 121, .08); border-radius: 24px; background: var(--tint);
  cursor: pointer; color: var(--dark); padding: 0;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
  -webkit-tap-highlight-color: transparent;
}
.px-card:nth-child(4n + 2) { --tint: #f8ead2; }
.px-card:nth-child(4n + 3) { --tint: #e9eaf3; }
.px-card:nth-child(4n + 4) { --tint: #f5ead8; }
.px-card:hover, .px-card:focus-visible { transform: translateY(-7px); box-shadow: var(--shadow); }
.px-card:active { transform: translateY(-2px) scale(.99); }

.px-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: rgba(38, 53, 121, .08); position: relative; }
.px-cards-sub .px-card-media { aspect-ratio: 4 / 3; }
.px-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.px-card:hover .px-card-media img, .px-card:focus-visible .px-card-media img { transform: scale(1.05); }
.px-card-media.is-empty { display: grid; place-items: center; background:
  radial-gradient(rgba(38, 53, 121, .1) .8px, transparent .8px) 0 0 / 8px 8px, rgba(255, 255, 255, .35); }
.px-card-ghost { font-size: clamp(3rem, 8vw, 5rem); font-weight: 800; letter-spacing: -.06em; color: var(--orange); opacity: .8; }

.px-card-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 22px 24px 22px; }
.px-card-num { font-size: .7rem; font-weight: 800; letter-spacing: 2px; color: var(--blue); }
.px-card-title { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; }
.px-card-desc { color: var(--muted); font-size: .88rem; line-height: 1.7; }
.px-card-extra { font-size: .72rem; font-weight: 700; line-height: 1.6; color: var(--blue); opacity: .75; }
.px-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.px-card-count { font-size: .75rem; font-weight: 800; color: var(--blue); }
.px-card-go {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--orange); color: var(--blue); font-weight: 800;
  transition: transform .3s ease, background .3s ease, color .3s ease;
}
.px-card:hover .px-card-go, .px-card:focus-visible .px-card-go { transform: translateX(5px); background: var(--blue); color: #fff; }

/* ---------- Galería: conserva la proporción original de cada foto ---------- */
.px-gallery { column-count: 3; column-gap: 16px; }
.px-photo {
  position: relative; display: block; width: 100%; margin: 0 0 16px; padding: 0; border: 0;
  break-inside: avoid; border-radius: 14px; overflow: hidden; background: #eeece6;
  min-height: 160px; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease;
}
.px-photo.is-loaded { min-height: 0; }
.px-photo img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .6s ease; }
.px-photo.is-loaded img { opacity: 1; }
.px-photo:hover, .px-photo:focus-visible { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(32, 43, 104, .2); }
.px-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(32, 43, 104, .35)); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.px-photo:hover::after, .px-photo:focus-visible::after { opacity: 1; }
.px-photo-zoom {
  position: absolute; right: 12px; bottom: 12px; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--orange); color: var(--blue); font-size: 1.3rem; font-weight: 800; line-height: 1;
  opacity: 0; transform: scale(.7); transition: opacity .3s ease, transform .3s ease;
}
.px-photo:hover .px-photo-zoom, .px-photo:focus-visible .px-photo-zoom { opacity: 1; transform: scale(1); }
.px-photo.is-broken { cursor: default; padding: 28px 16px; text-align: center; }
.px-broken { font-size: .75rem; font-weight: 700; color: var(--muted); line-height: 1.5; word-break: break-word; }

/* ---------- Galería vacía ---------- */
.px-empty { max-width: 560px; padding: 44px 30px; border: 2px dashed rgba(38, 53, 121, .22); border-radius: 24px; background: #efede7; }
.px-empty strong { display: block; font-size: 1.4rem; letter-spacing: -.04em; }
.px-empty p { margin: 10px 0 22px; color: var(--muted); line-height: 1.8; }

/* ---------- Lightbox ---------- */
body.px-lb-open { overflow: hidden; }
.px-lb {
  position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto 1fr;
  background: rgba(14, 20, 52, .985); animation: pxLbIn .3s ease both; touch-action: pan-y pinch-zoom;
}
@keyframes pxLbIn { from { opacity: 0; } to { opacity: 1; } }
.px-lb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.px-lb-count { color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .12em; opacity: .85; }
.px-lb-btn {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background .25s ease, color .25s ease, transform .25s ease; -webkit-tap-highlight-color: transparent;
}
.px-lb-btn:hover, .px-lb-btn:focus-visible { background: var(--orange); color: var(--blue); border-color: var(--orange); }
.px-lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.px-lb-close { font-size: 1.1rem; }
.px-lb-prev, .px-lb-next { position: absolute; top: 50%; margin-top: -23px; z-index: 2; }
.px-lb-prev { left: 18px; }
.px-lb-next { right: 18px; }
.px-lb-prev:hover { transform: translateX(-3px); }
.px-lb-next:hover { transform: translateX(3px); }

.px-lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 84px 18px; touch-action: pan-y pinch-zoom; }
.px-lb-figure { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; min-height: 0; }
.px-lb-img {
  display: block; max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px);
  width: auto; height: auto; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); transition: opacity .3s ease, transform .3s ease;
}
.px-lb-img.is-loading { opacity: 0; }
.px-lb-cap { color: rgba(255, 255, 255, .8); font-size: .78rem; font-weight: 600; text-align: center; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .px-gallery { column-count: 2; }
}

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .px-nav { margin-bottom: 30px; gap: 12px 16px; }
  .px-up { padding: 9px 14px; font-size: .76rem; }
  .px-cards-main, .px-cards-sub { grid-template-columns: 1fr; gap: 18px; }
  .px-card-body { padding: 18px 20px 20px; }
  .px-gallery { column-gap: 10px; }
  .px-photo { margin-bottom: 10px; border-radius: 11px; }
  .px-photo-zoom { display: none; }
  .px-lb-top { padding: 10px 12px; }
  .px-lb-stage { padding: 0 8px 12px; }
  .px-lb-btn { width: 42px; height: 42px; }
  .px-lb-prev, .px-lb-next { top: auto; bottom: 14px; margin-top: 0; background: rgba(17, 24, 61, .75); }
  .px-lb-prev { left: 14px; }
  .px-lb-next { right: 14px; }
  .px-lb-img { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
  .px-lb-cap { padding: 0 60px; min-height: 42px; display: flex; align-items: center; }
}

/* Dispositivos táctiles: sin efectos de hover que se queden "pegados" */
@media (hover: none) {
  .px-card:hover { transform: none; box-shadow: none; }
  .px-card:hover .px-card-media img { transform: none; }
  .px-photo:hover { transform: none; box-shadow: none; }
  .px-photo:hover::after { opacity: 0; }
}
