/* The examples, wherever they show (Home, Ejemplos): a card opens its example large in the viewer,
   the catalogue's filters, and the viewer itself (visor.js). DESIGN.md "Example sites". */

/* A card is a link: to the viewer, or without visor.js to the whole page's picture. */
.ws-ex__open { display: block; color: inherit; text-decoration: none; border-radius: 14px; }
.ws-ex__open .ws-browser, .ws-ex__open .ws-browser__view { display: block; }
.ws-ex__open:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
.ws-ex__open:focus-visible .ws-browser { transform: translateY(-4px); }
.ws-examples-all { margin: 12px 0 0; font-weight: 700; }

/* The catalogue: a grid that grows with the list, filtered by type of business. */
.ws-examples--todos { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 28px 20px; overflow: visible; margin: 0; }
.ws-ex[hidden] { display: none; }
.ws-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; }
.ws-filtros[hidden] { display: none; }
.ws-filtros button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 700 .95rem/1 var(--f-body); cursor: pointer; }
.ws-filtros button:hover { border-color: var(--fg); }
.ws-filtros button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ws-filtros__cuenta { margin-left: auto; color: var(--muted); font-size: .92rem; }

/* The viewer: a modal over the page, the example in a computer or a phone, scrolling natively. */
.ws-visor { width: min(1180px, calc(100vw - 24px)); height: min(920px, calc(100dvh - 24px)); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: var(--fg); overflow: hidden; }
.ws-visor[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.ws-visor::backdrop { background: rgba(23, 21, 18, .72); }
html.ws-visor-abierto { overflow: hidden; }
.ws-visor__barra { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ws-visor__titulo { min-width: 0; }
.ws-visor__marca { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ws-visor__titulo h2 { margin: 4px 0 2px; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); line-height: 1.15; }
.ws-visor__detalle { margin: 0; color: var(--muted); font-size: .92rem; }
.ws-visor__mandos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ws-visor__cerrar .ws-ico { width: 18px; height: 18px; }
/* The live link shows only where data/examples.json has one: the button's display must not override [hidden]. */
.ws-visor [hidden] { display: none !important; }
.ws-visor__marco { display: flex; justify-content: center; min-height: 0; padding: 16px 16px 0; background: var(--surface-2); }
.ws-visor__pantalla { height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 10px solid #1d1b19; border-bottom: 0; }
.ws-visor__pantalla:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.ws-visor__pantalla { position: relative; }
.ws-visor__pantalla img { display: block; width: 100%; height: auto; }
/* The sharp tiles (visor.js), stacked; the first screen's picture lies over the first until it has loaded. */
.ws-visor__pantalla img.is-cover { position: absolute; top: 0; left: 0; z-index: 1; }
.ws-visor__tiras img { background: #fff; }
.ws-visor__marco[data-dev="laptop"] .ws-visor__pantalla { width: min(100%, 960px); border-radius: 14px 14px 0 0; }
.ws-visor__marco[data-dev="phone"] .ws-visor__pantalla { width: min(100%, 400px); border-width: 12px 12px 0; border-radius: 36px 36px 0 0; }
.ws-visor__nota { margin: 0; padding: 10px 18px 14px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
@media (max-width: 640px) {
  .ws-visor { width: 100vw; height: 100dvh; border-radius: 0; }
  /* On a phone the example gets the screen: the title on one line, the controls in one row under it. */
  .ws-visor__barra { position: relative; display: block; padding: 10px 56px 8px 12px; }
  .ws-visor__titulo h2 { font-size: 1.05rem; margin: 2px 0 0; }
  .ws-visor__detalle { display: none; }
  .ws-visor__mandos { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-top: 8px; padding-bottom: 2px; }
  .ws-visor__mandos .ws-langsw { flex: none; padding: 3px; }
  .ws-visor__mandos .ws-langsw button { min-height: 44px; padding: 4px 12px; font-size: .88rem; }
  .ws-visor__mandos .ws-btn { flex: none; white-space: nowrap; }
  .ws-visor__cerrar { position: absolute; top: 8px; right: 8px; }
  .ws-visor__nota { padding: 6px 12px 10px; font-size: .78rem; }
  .ws-visor__marco { padding: 10px 8px 0; }
  .ws-visor__marco[data-dev="laptop"] .ws-visor__pantalla { border-width: 6px 6px 0; border-radius: 10px 10px 0 0; }
}
