/* gusmejia.com/off-the-clock · Fuera de obra (US-116, Lara Croft, 13/11/2026; ajustes de Mario, 13/11/2026). Dos vistas de las mismas
   fotos: mosaico por fecha (con filtros por tema) y mazo de postales. Va encima de /software/software.css
   (tokens, barra, pie). Sin estilos ni scripts en línea: cabe en el CSP de /off-the-clock/*. Sin JS: la lista es una cuadrícula. */
@font-face { font-family: "Caveat"; src: url("/off-the-clock/fonts/caveat-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --papel: #fbfaf6; --papel-tinta: #1f2c4d; --papel-gris: #6b6a64; --papel-linea: #dcd6c8; --papel-sombra: rgba(11, 13, 16, .42);
}
:root[data-theme="dark"] { --papel: #ebe8e0; --papel-linea: #cfc8b8; --papel-sombra: rgba(0, 0, 0, .8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --papel: #ebe8e0; --papel-linea: #cfc8b8; --papel-sombra: rgba(0, 0, 0, .8); }
}

.fuera-open { padding-bottom: 40px; }
.fuera-open .say p { max-width: 36ch; }

/* ── Los botones de las vistas (como el avión y el globo de Flying, con su nombre al lado) ── */
.vistas { display: inline-flex; gap: 4px; margin-top: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.vistas[hidden] { display: none; }
.vista-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: 500 .875rem/1 var(--sans); cursor: pointer; transition: background-color .16s var(--ease), color .16s var(--ease); }
.vista-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.vista-btn:hover { color: var(--ink); }
.vista-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.vista-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 420px) { .vista-btn { padding: 0 11px 0 8px; gap: 6px; font-size: .8125rem; } }

/* overflow-x: clip: las postales que vuelan o se barajan salen de la pantalla; sin esto, en el celular ensanchan la página y el navegador la corre (el scroll salta) */
.fuera-app { padding-bottom: 104px; overflow-x: clip; }
.pista { color: var(--muted); margin-bottom: 18px; }

/* ── Sin JS (o antes de que arme las vistas): la cuadrícula con su pie ── */
.fotos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 20px; }
.fotos figure { margin: 0; }
.fotos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--line); }
.fotos figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.35; color: var(--text-2); }
.fotos figcaption .anio { color: var(--muted); white-space: nowrap; }
/* The note under a photo that is not Gus's (the coffee, 13/11/2026): on its own line, quieter, in the list, the loupe, the viewer and the postcard. */
.credito { display: block; font-style: italic; color: var(--muted); }
.credito[hidden] { display: none; }
.lupa-pie { flex-wrap: wrap; }
.lupa-pie .credito { flex-basis: 100%; margin-top: -6px; font-size: .8125rem; }
.visor-pie .credito { margin-top: 2px; font-size: .875rem; color: #8f99a3; }
.dorso .mano small.credito { margin-top: 6px; font-size: .5em; font-style: normal; line-height: 1.15; }
.js .fotos { display: none; }
.vista[hidden] { display: none; }

/* ── A. Mosaico por fecha: el año como rótulo de cada grupo, y filtros por tema arriba ── */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filtro { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: none;
  color: var(--muted); font: 500 .875rem/1 var(--sans); cursor: pointer; transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease); }
.filtro .n { font-size: .6875rem; opacity: .75; }
.filtro:hover { color: var(--ink); border-color: var(--ink); }
.filtro[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filtro:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cuenta { min-height: 1.4em; margin-bottom: 18px; color: var(--muted); }
.rotulo { grid-column: 1 / -1; margin: 22px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: .8125rem; letter-spacing: .12em; }
.rotulo:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.rotulo[hidden], .tesela[hidden] { display: none; }
.tesela picture { display: block; width: 100%; height: 100%; }
.mosaico-caja { position: relative; }
.mosaico { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 3px; }
.tesela { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 2px; overflow: hidden; background: var(--line); cursor: zoom-in; }
.tesela img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); }
.tesela img.lista { opacity: 1; }
.tesela:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--ink); outline-offset: 2px; }
.lupa { position: absolute; left: 0; top: 0; z-index: 5; padding: 6px 6px 0; border-radius: 6px; background: var(--band); pointer-events: none;
  box-shadow: 0 0 0 1px var(--line), 0 28px 60px -24px rgba(11, 13, 16, .6); transform-origin: 50% 50%; }
.lupa[hidden] { display: none; }
.lupa-foto img { display: block; width: 100%; height: auto; border-radius: 3px; }
.lupa-pie { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 4px 10px; font-size: .875rem; line-height: 1.3; }
.lupa-pie .mono { color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .mosaico { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 2px; } }

/* ── B. Mazo de postales ── */
.mazo { --w: min(84vw, 520px); position: relative; height: calc(var(--w) + 48px); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.postal { position: absolute; left: 50%; top: 50%; width: var(--w); aspect-ratio: 3 / 2; margin-left: calc(var(--w) / -2); margin-top: calc(var(--w) / -3);
  perspective: 1600px; transition: transform .45s var(--ease); }
.postal.v { width: calc(var(--w) * 2 / 3); aspect-ratio: 2 / 3; margin-left: calc(var(--w) / -3); margin-top: calc(var(--w) / -2); }
.postal.arriba { cursor: grab; }
.postal.arrastrando { cursor: grabbing; transition: none; }
.postal:focus-visible { outline: none; }
.postal:focus-visible .cara, .postal:focus-visible .dorso { box-shadow: 0 0 0 3px var(--ink), 0 18px 40px -18px var(--papel-sombra); }
.postal-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.volteada .postal-in { transform: rotateY(180deg); }
.cara, .dorso { position: absolute; inset: 0; padding: 10px; border-radius: 4px; background: var(--papel); -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 1px 0 rgba(11, 13, 16, .06), 0 18px 40px -18px var(--papel-sombra); }
.cara picture, .cara img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.cara img { background: var(--papel-linea); pointer-events: none; }
.dorso { transform: rotateY(180deg); display: grid; grid-template-columns: 1.15fr 1px 1fr; gap: 18px; padding: 20px 22px; color: var(--papel-tinta); }
.dorso .mano { align-self: center; font: 400 clamp(1.625rem, 5vw, 2.5rem)/1.02 "Caveat", "Bradley Hand", "Segoe Print", cursive; transform: rotate(-3deg); overflow-wrap: anywhere; }
.dorso .mano small { display: block; margin-top: 10px; font-size: .62em; color: var(--papel-gris); }
.dorso .raya { background: var(--papel-linea); }
.dorso .der { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.estampilla { align-self: flex-end; display: grid; place-items: center; width: 54px; height: 64px; padding: 6px; background: var(--papel); color: var(--papel-tinta);
  outline: 1px dashed var(--papel-linea); outline-offset: -4px; box-shadow: 0 0 0 1px var(--papel-linea); }
.estampilla svg { width: 30px; height: 30px; fill: currentColor; }
.matasellos { position: absolute; top: 22px; right: 34px; display: grid; place-items: center; width: 66px; height: 66px; border: 1.5px solid currentColor; border-radius: 50%;
  font: 500 .625rem/1.1 var(--mono); letter-spacing: .08em; text-align: center; opacity: .55; transform: rotate(-14deg); }
.lineas { display: grid; gap: 22px; }
.lineas span { display: block; border-bottom: 1px solid var(--papel-linea); }
.postal.v .dorso { grid-template-columns: 1fr; grid-template-rows: auto 1px 1fr; gap: 14px; padding: 18px; }
.postal.v .dorso .mano { order: 3; align-self: center; }
.postal.v .dorso .raya { order: 2; }
.postal.v .dorso .der { order: 1; min-height: 76px; }
.postal.v .matasellos { top: 4px; right: 62px; }
.postal.v .lineas { display: none; }
/* Los botones no se mueven: una fila de ancho fijo, centrada, de cuatro columnas iguales. El texto va aparte, debajo, con el alto de dos líneas reservado. */
.mazo-ctl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 460px); margin: 18px auto 0; }
.mazo-ctl .btn { justify-content: center; min-width: 0; padding: 0 4px; background: none; color: var(--ink); cursor: pointer; font-size: .875rem; }
.mazo-ctl .btn:hover { background: var(--line-hover); }
.mazo-n { width: min(100%, 460px); height: 2.8em; margin: 12px auto 0; overflow: hidden; line-height: 1.4; text-align: center; color: var(--muted); }

/* ── El visor: la foto grande, con un fundido ── */
.visor { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #e8ecef; }
.visor[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; }
.visor::backdrop { background: rgba(6, 7, 9, .93); }
.visor-marco { display: grid; place-items: center; width: 100%; min-height: 0; padding: 28px 20px 0; }
.visor-foto { position: relative; line-height: 0; }
.visor-foto img { display: block; width: auto; height: auto; max-width: min(calc(100vw - 40px), 1600px); max-height: calc(100dvh - 128px); border-radius: 2px; }
.visor-pie { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: min(100%, 1640px); padding: 14px 20px 18px; }
.visor-pie p { font-size: .9375rem; line-height: 1.35; }
.visor-pie .mono { color: #8f99a3; }
.visor-ctl { display: flex; gap: 4px; flex: none; }
.ico { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: none; color: #b9c1c8; cursor: pointer; transition: background-color .16s var(--ease), color .16s var(--ease); }
.ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.ico:focus-visible { outline: 2px solid #e8ecef; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .postal, .postal-in, .tesela img, .vista-btn, .filtro { transition: none; }
}
