/* =========================================================
   Works extras (works-extra.js): list or grid view.
   ========================================================= */

/* ---------- View switch ----------
   Two icons (rows, a 2 by 2 grid) in the same glass pill as the filter,
   at the right end of the sticky filter bar. */
.wk-view { position: absolute; right: 0; top: 0; display: inline-flex; padding: 0.1875rem; border: 1px solid var(--hairline); border-radius: 999px; background: rgba(255, 255, 255, 0.93); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0.5rem 1.5rem -1rem rgba(13, 13, 13, 0.2); }
:root[data-theme="dark"] .wk-view { background: rgba(28, 28, 30, 0.93); border-color: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0.5rem 1.5rem -1rem rgba(0, 0, 0, 0.6); }
.wk-view button { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.wk-view button svg { width: 1.125rem; height: 1.125rem; }
.wk-view button[aria-pressed="true"] { background: #202020; color: #fff; }
:root[data-theme="dark"] .wk-view button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .wk-view button[aria-pressed="false"]:hover { color: var(--ink); } }
.wk-view button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The filter now sits at the left of the bar, the view switch at the right. */
@media (min-width: 641px) { .wk-filter-bar { justify-content: flex-start; } }
/* Phones: one column either way, so no switch. */
@media (max-width: 640px) { .wk-view { display: none; } }

/* ---------- Grid view ----------
   Two cards a row, the screenshot on top and the words under it. */
@media (min-width: 641px) {
  .wk-list.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
  .wk-list.is-grid > .wk-item { margin-top: 0; }
  .wk-list.is-grid .wk-card { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; min-height: 0; height: 100%; }
  .wk-list.is-grid .wk-visual { order: -1; min-height: 0; aspect-ratio: 16 / 10; margin: calc(4px - var(--space-3)) calc(4px - var(--space-3)) 0; }
  .wk-list.is-grid .wk-copy { padding: 0.25rem 0.375rem 0.375rem; }
  .wk-list.is-grid .wk-name { margin-top: 0.625rem; font-size: 1.375rem; }
  /* Room between the end of the words and the divider above the meta. */
  .wk-list.is-grid .wk-what { margin-bottom: 1.25rem; }
}
/* The switch between the two morphs each card (View Transitions): a short,
   even glide; the rest of the page holds still. */
::view-transition-group(*.wk-morph) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.77, 0, 0.175, 1); }
::view-transition-old(*.wk-morph), ::view-transition-new(*.wk-morph) { height: 100%; }
