/* ============================================================
   portfolio/visor.css — visor del portfolio (/portfolio/ y el inicio).
   Todo cuelga de .gv para no chocar con los estilos de cada página.

   Todo entra en una pantalla, sin scroll de página: arriba los filtros
   (pegados al borde), debajo la web elegida en un recuadro grande sobre un
   fondo claro —se recorre con scroll adentro— y la tira de miniaturas a todo
   el ancho, sin fondo, apoyada sobre el borde de abajo de la web.
   ============================================================ */
.gv, .gv-toolbar {
    --gv-bg: #0b0a09;
    --gv-text: #f5f1e8;
    --gv-soft: #d9d3c8;
    --gv-muted: #9e988e;
    --gv-line: rgba(255, 255, 255, 0.14);
    --gv-line-2: rgba(255, 255, 255, 0.3);
    --gv-gold: #e5b46e;
    --gv-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --gv-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --gv-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --gv-fondo: #ebe8e2;                  /* alrededor de la web */
    --gv-pantalla: 100vh;
    --gv-encima: 47px;                     /* alto de la barra de filtros */
    /* La web baja hasta 5px del final de la pantalla (la tira va encima)
       y toma el ancho que pide una pantalla de compu. */
    --gv-alto: calc(var(--gv-pantalla) - var(--gv-encima) - 11px);   /* 6px arriba, 5px abajo */
    --gv-ancho: min(calc(100% - 12px), calc(var(--gv-alto) * 2.4));
}
@supports (height: 100svh) { .gv, .gv-toolbar { --gv-pantalla: 100svh; } }
.gv {
    position: relative; display: flex; flex-direction: column; align-items: center; overflow: hidden;
    color: var(--gv-text); font-family: var(--gv-sans); background: var(--gv-fondo);
}
.gv *, .gv-toolbar * { box-sizing: border-box; }
.gv-oculto {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.gv svg, .gv-toolbar svg { width: 16px; height: 16px; flex: none; }

/* ── La web ──────────────────────────────────────────────── */
.gv-stage {
    position: relative; flex: none; width: var(--gv-ancho); height: var(--gv-alto); min-height: 320px; margin-top: 6px; cursor: pointer;
    overflow: hidden; border-radius: 10px; border: 1px solid rgba(0, 0, 0, 0.08); background: #fff;
    box-shadow: 0 18px 50px -24px rgba(40, 32, 20, 0.35);
}
.gv-stage[hidden] { display: none; }
.gv-view {
    position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}
.gv-view::-webkit-scrollbar { width: 8px; }
.gv-view::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.3); border-radius: 8px; }
.gv-view:focus-visible { outline: 2px solid var(--gv-gold); outline-offset: -3px; }
.gv-shot { display: block; width: 100%; height: auto; transition: opacity 0.35s var(--gv-ease); }
.gv-stage.cargando .gv-shot { opacity: 0; }

/* ── Filtros ─────────────────────────────────────────────── */
.gv-toolbar { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 6px; font-family: var(--gv-sans); }
/* En la home los filtros van dentro del visor, en una barra pegada arriba. */
.gv--con-filtros > .gv-toolbar {
    align-self: stretch; padding: 8px 14px;
    background: #0e0d0b; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gv-chips { display: flex; flex-wrap: nowrap; gap: 4px; }
.gv-chip {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    height: 30px; padding: 0 12px; border-radius: 999px;
    border: 1px solid transparent; background: transparent;
    color: var(--gv-soft); font: 500 0.74rem/1 var(--gv-sans); cursor: pointer; white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.gv-chip[hidden] { display: none; }
.gv-chip:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.gv-chip:active { transform: scale(0.97); }
.gv-chip[aria-pressed="true"] { background: #fff; color: #111; }
.gv-chip-n { font-size: 0.64rem; color: var(--gv-muted); font-variant-numeric: tabular-nums; }
.gv-chip-n:empty { display: none; }
.gv-chip[aria-pressed="true"] .gv-chip-n { color: #6b665f; }

.gv-tools { display: flex; flex-wrap: nowrap; gap: 4px; flex: none; }
.gv-select, .gv-search {
    position: relative; display: inline-flex; align-items: center;
    height: 30px; border-radius: 999px; border: 1px solid var(--gv-line);
    background: rgba(255, 255, 255, 0.04); color: var(--gv-soft);
}
.gv-select.activo { border-color: var(--gv-gold); color: var(--gv-text); }
.gv-select::after {
    content: ""; position: absolute; right: 12px; top: 50%; width: 5px; height: 5px; margin-top: -4px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); pointer-events: none;
}
.gv-select select {
    appearance: none; -webkit-appearance: none; height: 100%; padding: 0 28px 0 12px;
    border: 0; border-radius: 999px; background: transparent; color: inherit;
    font: 500 0.74rem/1 var(--gv-sans); cursor: pointer; width: 112px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gv-select select option { background: #1a1816; color: #f5f1e8; }
/* El buscador es un botón con la lupa que se abre al tocarlo. */
.gv-search-wrap { position: relative; display: inline-block; width: 30px; height: 30px; flex: none; }
.gv-search {
    position: absolute; right: 0; top: 0; z-index: 3; width: 30px; overflow: hidden;
    padding-left: 8px; background: #1a1816; cursor: text;
    transition: width 0.3s var(--gv-ease);
}
.gv-search:focus-within, .gv-search.lleno { width: 230px; }
.gv-search svg { width: 13px; height: 13px; color: var(--gv-soft); }
.gv-search input {
    flex: 1; min-width: 0; height: 100%; padding: 0 12px 0 8px; border: 0; background: transparent;
    color: var(--gv-text); font: 400 0.76rem/1 var(--gv-sans); outline: none;
}
.gv-search input::placeholder { color: var(--gv-muted); }
.gv-search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }
.gv-chip:focus-visible, .gv-select:focus-within, .gv-search:focus-within,
.gv-thumb:focus-visible, .gv-nav:focus-visible, .gv-btn:focus-visible {
    outline: 2px solid var(--gv-gold); outline-offset: 2px;
}

/* ── Miniaturas, de borde a borde y sin fondo, sobre la parte de abajo ──
   La franja en sí no atrapa el mouse (pointer-events: none): entre
   miniatura y miniatura se sigue scrolleando y clickeando la web. Las
   flechas flotan sobre los extremos de la tira. */
.gv-strip {
    position: absolute; z-index: 5; left: 0; right: 0; bottom: 0;
    display: flex; align-items: flex-end;
    padding: 0 0 12px; pointer-events: none;
}
.gv-strip > * { pointer-events: auto; }
.gv-strip[hidden] { display: none; }
.gv-nav {
    position: absolute; z-index: 2; bottom: calc(12px + 4px + (clamp(169px, 11.7vw, 247px) * 0.625 - 40px) / 2);
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 0; background: #1a1816; color: #fff; cursor: pointer;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.45);
    transition: background 0.2s ease, transform 0.15s ease;
}
.gv-nav:hover { background: #000; }
.gv-prev { left: 12px; }
.gv-next { right: 12px; }
.gv-nav:active { transform: scale(0.94); }
.gv-rail {
    position: relative; flex: 1; min-width: 0;
    display: flex; align-items: flex-end; gap: clamp(18px, 2vw, 30px); padding: 34px 16px 4px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    overscroll-behavior-x: contain; cursor: grab; user-select: none; -webkit-user-select: none;
}
.gv-rail.arrastrando { cursor: grabbing; }
.gv-rail.arrastrando .gv-thumb { pointer-events: none; }
.gv-rail::-webkit-scrollbar { display: none; }
.gv-thumb {
    flex: none; width: clamp(169px, 11.7vw, 247px); aspect-ratio: 16 / 10;
    transform-origin: 50% 100%;
    padding: 0; border: 0; border-radius: 4px; overflow: hidden;
    background: #ddd; cursor: pointer; -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.45);
    transition: transform 0.25s var(--gv-ease), border-color 0.2s ease, box-shadow 0.25s ease;
}
@media (hover: hover) {
    .gv-thumb:hover { transform: translateY(-8px) scale(1.16); box-shadow: 0 16px 34px -10px rgba(0, 0, 0, 0.55); }
}
.gv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* La elegida se distingue porque queda levantada, sin borde de color. */
.gv-thumb.activo { transform: translateY(-8px); box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.6); }

/* ── Sin resultados ──────────────────────────────────────── */
.gv-vacio { padding: 80px 20px; text-align: center; color: #5d574e; }
.gv-vacio[hidden] { display: none; }
.gv-vacio-t { margin: 0 0 8px; font-family: var(--gv-serif); font-size: clamp(1.6rem, 3vw, 2.2rem); color: #1a1816; }
.gv-vacio p { margin: 0 0 22px; }
.gv-btn {
    display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 999px;
    border: 0; background: #1a1816; color: #fff;
    font: 600 0.88rem/1 var(--gv-sans); cursor: pointer;
}

/* ── Celular ─────────────────────────────────────────────── */
@media (max-width: 760px) {
    .gv { --gv-encima: 50px; --gv-ancho: calc(100vw - 12px); --gv-alto: calc(var(--gv-pantalla) - var(--gv-encima) - 11px); }
    .gv-stage { margin-top: 6px; border-radius: 8px; }
    .gv-toolbar { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
    .gv-toolbar::-webkit-scrollbar { display: none; }
    .gv--con-filtros > .gv-toolbar { padding: 8px 10px; }
    /* Dentro de una fila que scrollea, el buscador se abre en el lugar. */
    .gv-search-wrap { width: auto; }
    .gv-search { position: relative; }
    .gv-search:focus-within, .gv-search.lleno { width: 170px; }
    .gv-strip { padding: 0 10px 10px; gap: 8px; }
    .gv-nav { display: none; }
    .gv-rail { gap: 14px; padding: 14px 10px 4px; }
    .gv-thumb { width: 146px; }
}

@media (prefers-reduced-motion: reduce) {
    .gv *, .gv-toolbar * { transition: none !important; animation: none !important; }
}
