/* =========================================================
   MM CCTV — página Nuestros trabajos (/trabajos)
   Usa las variables y piezas de style.css (tarjeta .work, chips .filter); acá va solo lo propio.
   ========================================================= */

.nav__links > a.is-here:not(.btn) { color: #fff; }

.wpage { min-height: 60vh; padding-top: clamp(2.5rem, 5vw, 4rem); }
.wpage .shead { margin-bottom: 2rem; }
.wpage__title { font-size: clamp(2rem, 5vw, 3.1rem); }
.wpage__meta { text-align: center; color: var(--muted); font-size: .86rem; margin: -1rem 0 1.2rem; min-height: 1.2em; }

/* grilla: una columna en el celular, dos o tres en la compu */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.3rem; }
.wgrid .works__loading, .wgrid .works__empty { grid-column: 1 / -1; }

.wpage__cta {
  margin: 3rem auto 0; max-width: 760px; text-align: center; padding: 1.6rem 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .02);
}
.wpage__cta p { color: var(--muted); margin: 0 0 1rem; }
.wpage__cta .btn { white-space: normal; min-height: 48px; }

/* ---------------- vista de una obra ---------------- */
.wview { position: fixed; inset: 0; z-index: 105; background: rgba(0, 0, 0, .82); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.wview[hidden] { display: none; }
.wview__panel {
  position: relative; width: min(1180px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; outline: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}
.wview__x {
  position: absolute; top: .6rem; right: .6rem; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(11, 11, 13, .75); border: 1px solid var(--line-2); color: #fff; font-size: 1.9rem; line-height: 1; cursor: pointer;
}
.wview__x:hover { background: var(--red); border-color: var(--red); }

.wview__media { min-width: 0; background: #0b0b0e; display: flex; flex-direction: column; }
.wview__stage { position: relative; }
.wview__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  height: min(72vh, 620px);
}
.wview__track::-webkit-scrollbar { display: none; }
.wview__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; }
.wview__slide img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.wview__slide .work__ph { height: 100%; }
.wview__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(11, 11, 13, .72); border: 1px solid var(--line-2); transition: background .18s, opacity .18s;
}
.wview__nav svg { width: 26px; height: 26px; fill: currentColor; }
.wview__nav:hover { background: var(--red); border-color: var(--red); }
.wview__nav:disabled { opacity: 0; pointer-events: none; }
.wview__nav[hidden] { display: none; }
.wview__prev { left: .7rem; }
.wview__next { right: .7rem; }
.wview__pos {
  position: absolute; left: .7rem; bottom: .7rem; background: rgba(0, 0, 0, .72); border: 1px solid var(--line-2);
  border-radius: 999px; padding: .2rem .7rem; font-size: .78rem;
}
.wview__pos:empty { display: none; }
.wview__cap { margin: 0; padding: .6rem 1rem 0; font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.wview__cap:empty { display: none; }
.wview__thumbs { display: flex; gap: .45rem; padding: .7rem 1rem 1rem; overflow-x: auto; scrollbar-width: thin; }
.wview__thumbs:empty { display: none; }
.wview__thumb {
  flex: 0 0 auto; width: 64px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; background: #15151b; opacity: .65; transition: opacity .18s, border-color .18s;
}
.wview__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wview__thumb:hover { opacity: 1; }
.wview__thumb[aria-current="true"] { border-color: var(--red); opacity: 1; }

.wview__info { padding: 1.6rem 1.5rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.wview__tag { position: static; align-self: flex-start; }
.wview__tag:empty { display: none; }
.wview__title { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; margin: 0; padding-right: 2.6rem; overflow-wrap: anywhere; }
.wview__meta { margin: 0; }
.wview__meta:empty { display: none; }
.wview__desc { color: #cfcfd6; font-size: .95rem; overflow-wrap: anywhere; }
.wview__desc p { margin: 0 0 .7rem; }
.wview__desc:empty { display: none; }
.wview__wa { margin-top: .6rem; min-height: 52px; white-space: normal; text-align: center; }
.wview__share { min-height: 48px; white-space: normal; overflow-wrap: anywhere; }
.wview__back { align-self: center; background: none; border: 0; color: var(--muted); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; min-height: 44px; }
.wview__back:hover { color: #fff; }

@media (max-width: 900px) {
  /* en el celular, a pantalla completa: la foto arriba y los datos abajo */
  .wview { padding: 0; }
  .wview__panel { grid-template-columns: 1fr; width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .wview__track { height: min(78vw, 62vh); }
  .wview__nav { width: 40px; height: 40px; }
  .wview__info { padding: 1.1rem 1.1rem 1.6rem; }
}
@media (hover: none) {
  /* con el dedo se desliza; las flechas quedan chicas para no tapar la foto */
  .wview__nav { opacity: .85; }
}
