/* Testimonios con fotos de los viajeros: tarjetas, carrusel de la home y visor
   de fotos. Lo usan index.html ("Lo que dicen...") y testimonios.html; el JS
   vive en assets/js/pages/testimonios-comun.js.
   OJO: /assets/ se cachea un año (vercel.json). Si se cambia este archivo, subir
   el ?v= de su URL en las dos páginas. */

/* ── Fotos dentro de la tarjeta: polaroids chiquitas ── */
.tm-fotos { display: grid; gap: 8px; margin: 2px 0 16px; }
.tm-fotos-1 { grid-template-columns: 1fr; }
.tm-fotos-2 { grid-template-columns: 1fr 1fr; }
.tm-fotos-3 { grid-template-columns: repeat(3, 1fr); }
.tm-foto {
    position: relative;
    display: block;
    width: 100%;
    padding: 4px 4px 12px;
    background: #fff;
    border: 1px solid #e8e0d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.tm-foto:nth-child(odd) { transform: rotate(-2deg); }
.tm-foto:nth-child(even) { transform: rotate(1.5deg); }
.tm-foto:hover, .tm-foto:focus-visible { transform: rotate(0deg) scale(1.05); z-index: 1; }
.tm-foto img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #e8e0d0; }
.tm-fotos-1 .tm-foto img { aspect-ratio: 4 / 3; }
.tm-foto-mas {
    position: absolute;
    inset: 4px 4px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 26, 0.55);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

/* ── Carrusel infinito de la home (con 4 testimonios reales o más) ── */
.tm-carrusel {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 30px 0 40px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.tm-carrusel::-webkit-scrollbar { display: none; }
.tm-pista { display: flex; width: max-content; }
/* El padding-right hace de separación entre las dos copias: así el ancho de
   una vuelta es exactamente el de un grupo. */
.tm-grupo { display: flex; gap: 24px; padding-right: 24px; align-items: flex-start; }
.tm-grupo .tm-card { flex: 0 0 300px; }
@media (max-width: 640px) { .tm-grupo .tm-card { flex-basis: 78vw; } }

/* ── Página /testimonios: columnas tipo mural ── */
.tm-lista { columns: 1; column-gap: 28px; }
@media (min-width: 768px) { .tm-lista { columns: 2; } }
@media (min-width: 1024px) { .tm-lista { columns: 3; } }
.tm-lista .tm-card { break-inside: avoid; margin: 0 0 32px; }

/* ── Visor de fotos ── */
.tm-visor {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 12, 10, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tm-visor[hidden] { display: none; }
.tm-visor-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; touch-action: pan-y; }
.tm-visor-fig img {
    display: block;
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    background: #222;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}
.tm-visor-cont { color: rgba(255, 255, 255, 0.75); font-size: 13px; letter-spacing: 1px; font-family: 'Lato', sans-serif; }
.tm-visor button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}
.tm-visor button:hover, .tm-visor button:focus-visible { background: rgba(255, 255, 255, 0.28); }
.tm-visor-cerrar { top: 16px; right: 16px; font-size: 20px !important; }
.tm-visor-ant { left: 16px; top: 50%; transform: translateY(-50%); }
.tm-visor-sig { right: 16px; top: 50%; transform: translateY(-50%); }
.tm-visor[data-una] .tm-visor-ant, .tm-visor[data-una] .tm-visor-sig { display: none; }
@media (max-width: 640px) {
    .tm-visor-ant, .tm-visor-sig { top: auto; bottom: 20px; transform: none; }
}
