/* El portfolio: la grilla de trabajos del shortcode [mdpd_trabajos] (mdd-trabajos.php).
   Se encola en las páginas que usan los shortcodes (mdd-trabajos.php). 2026-09-24. */

.tj { --tj-rojo: var(--e-global-color-primary, #FF1632); --tj-tinta: var(--e-global-color-secondary, #1E293B); --tj-linea: var(--e-global-color-mdpdborde, #E2E8EE); }

/* La grilla */
.tj-grilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1100px) { .tj-grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .tj-grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }

.tj-card {
    display: grid; grid-template-rows: auto 1fr; overflow: hidden;
    background: #fff; border: 1px solid var(--tj-linea); border-radius: 12px;
    color: var(--tj-tinta); text-decoration: none !important;
    transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s, border-color .2s;
}
/* El nombre del cliente va en tinta (2026-09-25): la tarjeta es un enlace y `.mdpd-svc a`
   (paginas-servicio.css) la pintaba de rojo. El dominio sigue en rojo, con su color propio. */
.tj a.tj-card, .tj a.tj-card:hover { color: var(--tj-tinta); }
a.tj-card:hover { transform: translateY(-4px); border-color: var(--tj-rojo); box-shadow: 6px 6px 0 color-mix(in srgb, var(--tj-rojo) 22%, transparent); }
.tj-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #F2F5F7; border-bottom: 1px solid var(--tj-linea); }
/* Selector largo: la regla de imágenes de Elementor (height: auto) pisa uno corto */
.tj .tj-card .tj-img img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top center; transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
a.tj-card:hover .tj-img img { transform: scale(1.04); }
.tj-info { display: grid; gap: 3px; align-content: start; padding: 13px 15px 15px; }
.tj-info b { font-size: 16px; font-weight: 800; line-height: 1.25; }
.tj-info small { font-size: 13.5px; color: #475569; line-height: 1.35; }
.tj-info em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--tj-rojo); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    .tj-info { padding: 10px 11px 12px; }
    .tj-info b { font-size: 14px; }
    .tj-info small, .tj-info em { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .tj-card, .tj .tj-card .tj-img img { transition: none; } }

/* ---------- El mosaico del hero: capturas reales flotando de fondo ---------- */
.tj-mosaico { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
    -webkit-mask: radial-gradient(95% 100% at 50% 50%, #000 40%, transparent 90%); mask: radial-gradient(95% 100% at 50% 50%, #000 40%, transparent 90%); }
.tj-tesela { position: absolute; width: 180px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; opacity: .32;
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .18);
    animation: tj-flota 18s ease-in-out infinite alternate; will-change: transform; }
.tj-mosaico .tj-tesela img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top; }
/* Repartidas parejas a lo ancho (del 2% al 91%), para que el grupo quede centrado en la
   ventana: antes iban del 22% al 96% y se cargaban a la derecha (Emir, 2026-09-25). */
.tj-tesela:nth-child(1)  { left: 6%; top: 10%; --r: -6deg; animation-duration: 19s; animation-delay: 0s; width: 180px; }
.tj-tesela:nth-child(2)  { left: 18%; top: 62%; --r: 5deg; animation-duration: 23s; animation-delay: -6s; width: 210px; }
.tj-tesela:nth-child(3)  { left: 30%; top: 6%; --r: 4deg; animation-duration: 17s; animation-delay: -3s; width: 180px; }
.tj-tesela:nth-child(4)  { left: 43%; top: 74%; --r: -5deg; animation-duration: 21s; animation-delay: -9s; width: 170px; }
.tj-tesela:nth-child(5)  { left: 55%; top: 8%; --r: -3deg; animation-duration: 25s; animation-delay: -12s; width: 160px; }
.tj-tesela:nth-child(6)  { left: 66%; top: 60%; --r: -2deg; animation-duration: 20s; animation-delay: -4s; width: 190px; }
.tj-tesela:nth-child(7)  { left: 78%; top: 12%; --r: 6deg; animation-duration: 18s; animation-delay: -15s; width: 180px; }
.tj-tesela:nth-child(8)  { left: 88%; top: 58%; --r: 3deg; animation-duration: 22s; animation-delay: -8s; width: 170px; }
.tj-tesela:nth-child(9)  { left: 2%; top: 42%; --r: -4deg; animation-duration: 24s; animation-delay: -2s; width: 150px; }
.tj-tesela:nth-child(10) { left: 91%; top: 30%; --r: 5deg; animation-duration: 19s; animation-delay: -11s; width: 150px; }
@keyframes tj-flota { from { transform: translate3d(0, 12px, 0) rotate(var(--r)); } to { transform: translate3d(0, -14px, 0) rotate(calc(var(--r) * -1)); } }

/* ---------- Tres ventanas de navegador, en el panel del hero ---------- */
.tj-ventanas { position: relative; height: 330px; }
.tj-ventana { position: absolute; width: 74%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #fff;
    border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); display: grid; grid-template-rows: 18px 1fr; }
.tj-ventana i { display: block; background-color: #E2E8EE; background-image: radial-gradient(circle at 10px 9px, #FF5F57 0 3px, transparent 3.5px), radial-gradient(circle at 21px 9px, #FEBC2E 0 3px, transparent 3.5px), radial-gradient(circle at 32px 9px, #28C840 0 3px, transparent 3.5px); }
.tj-ventanas .tj-ventana img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top; }
.tj-ventana:nth-child(1) { left: 0; top: 30px; transform: rotate(-4deg); z-index: 1; }
.tj-ventana:nth-child(2) { right: 0; top: 0; transform: rotate(3deg); z-index: 2; }
.tj-ventana:nth-child(3) { left: 14%; bottom: 0; transform: rotate(-1deg); z-index: 3; }
@media (max-width: 880px) { .tj-ventanas { height: 250px; } .tj-mosaico .tj-tesela:nth-child(n) { width: 110px; } }
@media (prefers-reduced-motion: reduce) { .tj-tesela { animation: none; transform: rotate(var(--r)); } }

/* ---------- El resumen por rubro: una fila deslizable por categoría ---------- */
.tj-rubros { display: grid; gap: 46px; }
.tj-rubro-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--tj-linea); }
.tj-rubro-cab h3 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--tj-tinta); }
.tj-ver { font-size: 16px; font-weight: 800; color: var(--tj-rojo) !important; text-decoration: none !important; white-space: nowrap; }
.tj-ver span { display: inline-block; transition: transform .2s; }
.tj-ver:hover span { transform: translateX(4px); }

.tj-marco { position: relative; }
.tj-fila {
    display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 60px) / 4); gap: 20px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 0; overscroll-behavior-x: contain;
    padding: 6px 2px 14px; margin: -6px -2px 0; scrollbar-width: none;
}
.tj-fila::-webkit-scrollbar { display: none; }
.tj-fila > .tj-card { scroll-snap-align: start; }

/* La última tarjeta de cada fila lleva a la página del rubro */
.tj-rubros .tj-mas { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px;
    background: var(--tj-tinta); border-color: var(--tj-tinta); color: #fff;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px); background-size: 16px 16px; }
.tj-rubros .tj-mas span { font-size: 19px; font-weight: 600; line-height: 1.3; }
.tj-rubros .tj-mas b { display: block; font-size: 24px; font-weight: 800; color: #fff; }
.tj-rubros .tj-mas i { font-style: normal; font-size: 22px; font-weight: 800; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--tj-rojo); transition: transform .2s; }
.tj-rubros a.tj-mas:hover { border-color: var(--tj-rojo); }
.tj-rubros a.tj-mas:hover i { transform: translateX(4px); }

.tj-flecha {
    position: absolute; top: calc(50% - 30px); z-index: 2; width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--tj-linea); background: #fff; color: var(--tj-tinta); cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, .35); transition: background-color .15s, color .15s, opacity .2s;
}
.tj-flecha svg { width: 20px; height: 20px; }
.tj-flecha.es-ant { left: -23px; }
.tj-flecha.es-ant svg { transform: scaleX(-1); }
.tj-flecha.es-sig { right: -23px; }
.tj-flecha:hover { background: var(--tj-rojo); border-color: var(--tj-rojo); color: #fff; }
.tj-flecha:focus-visible { outline: 3px solid #FFCD57; outline-offset: 2px; }
.tj-flecha:disabled { opacity: 0; pointer-events: none; }

@media (max-width: 1100px) { .tj-fila { grid-auto-columns: calc((100% - 40px) / 3); } }
@media (max-width: 760px) {
    .tj-rubros { gap: 36px; }
    .tj-rubro-cab h3 { font-size: 21px; }
    .tj-ver { font-size: 15px; }
    .tj-fila { grid-auto-columns: 62%; gap: 14px; }
    .tj-flecha { display: none; }
    .tj-rubros .tj-mas { padding: 16px; }
    .tj-rubros .tj-mas span { font-size: 16px; }
    .tj-rubros .tj-mas b { font-size: 20px; }
}

/* ---------- Collage de capturas, en las tarjetas de rubro ---------- */
.tj-collage { position: relative; width: 100%; aspect-ratio: 16 / 11; margin-bottom: 8px; }
.tj-foto { position: absolute; width: 62%; aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; background: #F2F5F7;
    border: 1px solid var(--e-global-color-mdpdborde, #E2E8EE); box-shadow: 0 12px 24px -12px rgba(15, 23, 42, .45);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.tj-collage .tj-foto img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: top; }
.tj-foto:nth-child(1) { left: 0; top: 4%; transform: rotate(-6deg); }
.tj-foto:nth-child(2) { right: 0; top: 0; transform: rotate(5deg); }
.tj-foto:nth-child(3) { left: 19%; bottom: 0; transform: rotate(-1deg); z-index: 1; }
a:hover > .tj-collage .tj-foto:nth-child(1) { transform: rotate(-9deg) translate(-4px, -2px); }
a:hover > .tj-collage .tj-foto:nth-child(2) { transform: rotate(8deg) translate(4px, -2px); }
a:hover > .tj-collage .tj-foto:nth-child(3) { transform: rotate(0) translateY(-4px); }
@media (prefers-reduced-motion: reduce) { .tj-foto, .tj-flecha, .tj-ver span, .tj-rubros .tj-mas i { transition: none; } }
