/* LIVREX Technology — portafolio (hito 2B-1). Se carga después de styles.css y reutiliza su paleta y componentes.
 * Cubre: filtros por categoría, etiquetas, tarjeta destacada y diálogo de detalle. */

/* ---- Filtros ---- */
.port__filtros{display:flex;flex-wrap:wrap;gap:.5rem;margin:0 0 .9rem}
.pfiltro{min-height:44px;padding:.45rem 1.15rem;border-radius:999px;border:1px solid var(--line);background:rgba(255,255,255,.03);color:var(--mut);font:inherit;font-size:.92rem;font-weight:600;cursor:pointer;transition:color .2s,border-color .2s,background .3s,transform .25s var(--ease)}
.pfiltro:hover{color:#fff;border-color:rgba(59,130,255,.55);transform:translateY(-1px)}
.pfiltro[aria-pressed="true"]{color:#fff;border-color:transparent;background:linear-gradient(100deg,var(--blue),#5b3fe0 55%,var(--red))}
.port__estado{color:var(--mut);font-size:.85rem;margin:0 0 1.2rem}

/* ---- Tarjetas ---- */
.pitem[hidden]{display:none}
.port > noscript{display:contents}   /* alternativa sin JavaScript: la tarjeta participa de la cuadrícula */
.ptags{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.ptag{font-size:.8rem;letter-spacing:.05em;padding:.2rem .65rem;border-radius:999px;border:1px solid var(--line);color:var(--mut)}
.ptag--dest{color:#fff;border-color:transparent;font-weight:700;background:linear-gradient(100deg,var(--blue),#5b3fe0 55%,var(--red))}
.ptag--disponible{color:#8ff0b3;border-color:rgba(74,222,128,.45);background:rgba(74,222,128,.08)}
.ptag--en_desarrollo{color:#f5c542;border-color:rgba(245,180,0,.5);background:rgba(245,180,0,.07)}
.ptag--no_disponible{color:var(--mut)}
.pitem .pnota,.pdet .pnota{color:var(--txt);font-size:.85rem;border-left:3px solid var(--blue-l);padding-left:.7rem}
.pchips{list-style:none;padding:0;margin:.2rem 0 0;display:flex;flex-wrap:wrap;gap:.4rem}
.pchips li{font-size:.84rem;padding:.15rem .6rem;border-radius:6px;background:rgba(255,255,255,.06);color:var(--txt)}
.pchips .pchips__mas{color:var(--mut)}
.pitem__acc{margin-top:auto;display:flex;flex-wrap:wrap;align-items:center;gap:.9rem;padding-top:.9rem}
.pitem .plink{margin:0;padding:.55rem 0;min-height:44px;display:inline-flex;align-items:center}
.pitem--p .pitem__b{gap:.6rem}
.pitem[data-categoria="audiovisual"] > img{object-fit:contain;object-position:center;background:var(--bg2)}

/* Destacado: ocupa toda la fila (mismos colores y tarjeta de v0.2) */
.pitem--destacado{grid-column:1/-1;display:grid;grid-template-columns:1.1fr .9fr}
.pitem--destacado[hidden]{display:none}
.pitem--destacado img{height:100%;min-height:320px;aspect-ratio:auto;border-bottom:0;border-right:1px solid var(--line)}
.pitem--destacado .pitem__b{padding:2rem;gap:.8rem;justify-content:center}
.pitem--destacado h3{font-size:clamp(1.5rem,2.6vw,2rem)}
.pitem--destacado p{font-size:1rem}

/* Un único proyecto secundario (además del destacado) ocupa toda la fila, sin etiqueta «Destacado»; con 3 o más vuelve a la cuadrícula. */
.port>.pitem:not(.pitem--destacado):nth-child(2):last-child{grid-column:1/-1;display:grid;grid-template-columns:1.1fr .9fr}
.port>.pitem:not(.pitem--destacado):nth-child(2):last-child img{height:100%;min-height:320px;aspect-ratio:auto;border-bottom:0;border-right:1px solid var(--line)}
.port>.pitem:not(.pitem--destacado):nth-child(2):last-child .pitem__b{padding:2rem;gap:.8rem;justify-content:center}
.port>.pitem:not(.pitem--destacado):nth-child(2):last-child h3{font-size:clamp(1.5rem,2.6vw,2rem)}
.port>.pitem:not(.pitem--destacado):nth-child(2):last-child p{font-size:1rem}
.port>.pitem[hidden]{display:none}

/* ---- Detalle ---- */
html.pdet-abierto{overflow:hidden}
.pdet{position:fixed;inset:0;margin:auto;padding:0;width:min(1100px,calc(100% - 2rem));max-height:calc(100vh - 2rem);max-height:calc(100dvh - 2rem);border:1px solid var(--line);border-radius:var(--r);background:var(--bg2);color:var(--txt);box-shadow:0 40px 100px -30px #000}
.pdet:not([open]){display:none}
.pdet::backdrop{background:rgba(0,0,0,.8)}
.pdet__x{position:absolute;top:.8rem;right:.8rem;z-index:2;min-height:44px;min-width:44px}
.pdet__medios{align-self:center}
.pdet__in{display:grid;grid-template-columns:1.15fr .85fr;gap:2rem;padding:3.8rem 2.2rem 2.2rem;max-height:calc(100vh - 2rem);max-height:calc(100dvh - 2rem);overflow:auto;overscroll-behavior:contain}
.pdet__main{width:100%;height:auto;display:block;border-radius:10px;border:1px solid var(--line);background:#fff}
.pdet__medios--video{min-width:0}
.pdet__video{max-height:min(55vh,520px);background:var(--bg2);object-fit:contain}
.pdet__video + .pdet__main{margin-top:.8rem}
/* Variante audiovisual del diálogo: reproductor amplio arriba, título y texto debajo (reutilizable para futuros comerciales) */
.pdet.pdet--video{width:min(940px,calc(100% - 2rem))}
.pdet--video .pdet__in{grid-template-columns:1fr;gap:1.2rem;padding:3.6rem 1.6rem 1.8rem}
.pdet--video .pdet__video{display:block;width:min(100%,calc((100vh - 30rem) * 1.778));width:min(100%,calc((100dvh - 30rem) * 1.778));min-width:min(100%,420px);margin-inline:auto;height:auto;aspect-ratio:16/9;max-height:none;background:#000;border-radius:10px}
.pdet--video .pdet__txt h3{margin-top:.4rem;padding-right:0}
.pdet--video .pdet__txt .btn{margin-top:1rem}
/* Miniatura audiovisual en tarjeta: símbolo de reproducción + duración */
.pthumb{position:relative;display:block}
.pthumb img{display:block;width:100%}
.pthumb__play{position:absolute;left:50%;top:50%;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;background:rgba(7,13,28,.62);border:2px solid rgba(255,255,255,.85);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);box-shadow:0 6px 24px rgba(0,0,0,.45);pointer-events:none}
.pthumb__play::after{content:"";position:absolute;left:25px;top:19px;border-left:19px solid #fff;border-top:12px solid transparent;border-bottom:12px solid transparent}
.pthumb__dur{position:absolute;right:.7rem;bottom:.7rem;padding:.15rem .55rem;border-radius:6px;background:rgba(7,13,28,.78);color:#fff;font-weight:600;font-size:.8rem;line-height:1.4;letter-spacing:.04em}
.pdet__minis{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.8rem}
.pdet__mini{width:88px;padding:0;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer;overflow:hidden;opacity:.7;transition:opacity .2s,border-color .2s}
.pdet__mini:hover{opacity:1}
.pdet__mini[aria-current="true"]{border-color:var(--blue-l);opacity:1}
.pdet__mini img{width:100%;aspect-ratio:16/10;object-fit:cover;object-position:top left;display:block}
.pdet__txt h3{font-size:clamp(1.5rem,3vw,2rem);margin:.8rem 0 .6rem;padding-right:5.5rem}
.pdet__txt p{color:var(--mut)}
.pdet__txt h4{margin:1.2rem 0 .5rem;font-size:1rem}
.pdet__txt .btn{margin-top:1.4rem}

@media(max-width:960px){
  .pitem--destacado,.port>.pitem:not(.pitem--destacado):nth-child(2):last-child{grid-template-columns:1fr}
  .pitem--destacado img,.port>.pitem:not(.pitem--destacado):nth-child(2):last-child img{height:auto;min-height:0;aspect-ratio:16/10;border-right:0;border-bottom:1px solid var(--line)}
  .pitem--destacado .pitem__b,.port>.pitem:not(.pitem--destacado):nth-child(2):last-child .pitem__b{padding:1.3rem}
  .pdet__in{grid-template-columns:1fr;gap:1.4rem;padding:1.4rem}
  .pdet__txt h3{padding-right:0;margin-top:.4rem}
  .pdet--video .pdet__in{padding:3.6rem 1rem 1.2rem}
  .pdet.pdet--video{width:calc(100% - 1rem)}
  .pdet{width:calc(100% - 1rem);max-height:calc(100vh - 1rem);max-height:calc(100dvh - 1rem)}
  .pdet__in{max-height:calc(100vh - 1rem);max-height:calc(100dvh - 1rem);padding-top:4rem}
}
@media(max-width:600px){
  .pfiltro{padding:.4rem .95rem;font-size:.88rem}
  .pdet__mini{width:76px}
}
@media(prefers-reduced-motion:reduce){.pfiltro,.pdet__mini{transition:none}}

/* Una sola área de desplazamiento vertical: el contenedor .pdet__in; el diálogo no desplaza por sí mismo */
.pdet{overflow:hidden}
.pdet .pdet__in{max-height:calc(100vh - 2rem - 2px);max-height:calc(100dvh - 2rem - 2px)}
@media(max-width:960px){.pdet .pdet__in{max-height:calc(100vh - 1rem - 2px);max-height:calc(100dvh - 1rem - 2px)}}
