/* "Where it lives" peek (js/features/wherepeek.js; owner: preview): inside the hover card (.hp-card.is-where) and
   as the large overlay (W in quick look). Tokens from style.css only. */

@keyframes wp-shimmer { to { background-position: -150% 0; } }

.hp-card.is-where { pointer-events: auto; cursor: pointer; padding: 10px; }
.wp { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wp-sec { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.wp-label { color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.wp-crumbs { display: flex; flex-wrap: nowrap; align-items: center; min-width: 0; overflow: hidden; font-size: 12px; line-height: 20px; white-space: nowrap; }
.wp-crumb { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; margin: 0 -1px; border: 0; border-radius: 5px;
  background: none; color: var(--muted); font: inherit; cursor: pointer; }
.wp-crumb.cut { cursor: default; padding: 0 2px; }
.wp-crumb:not(.cut):hover { background: var(--raised); color: var(--text); }
.wp-crumb.last { color: var(--text); font-weight: 600; flex-shrink: 1; }
.wp-sep { flex: none; color: var(--dim); }
.wp-crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

.wp-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; min-height: 0; }
.wp-cell { position: relative; aspect-ratio: 1; min-width: 0; overflow: hidden; border-radius: 5px; background: var(--ph); display: grid; place-items: center; }
.wp-cell img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .2s; }
.wp-cell img.ld { opacity: 1; }
.wp-cell.sk { background: linear-gradient(100deg, var(--ph) 30%, var(--raised) 50%, var(--ph) 70%) 0 0 / 300% 100%; animation: wp-shimmer 1.4s infinite linear; }
.wp-cell.this { z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: 0 0 0 2px var(--accent-soft), 0 0 14px 2px var(--accent-soft); }
.wp-cell:not(.this):not(.sk) { opacity: .82; }
.wp-ext { color: var(--dim); font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.wp-empty { grid-column: 1 / -1; padding: 22px 8px; text-align: center; color: var(--faint); font-size: 12px; }

.wp-foot { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wp-pos { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 17px; }
.wp-file { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp[data-state="missing"] .wp-pos { color: var(--faint); font-weight: 500; }

.wp-link { padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.wp-linkname { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; min-width: 0; }
.wp-linkname span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the large peek (W in quick look) */
.wp-over { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(8, 9, 10, .72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.wp-bigcard { position: relative; width: min(780px, 100%); max-height: 100%; overflow: auto; padding: 22px 22px 14px; border: 1px solid var(--line-3); border-radius: 16px;
  background: var(--pane); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); cursor: pointer; }
.wp-big { gap: 16px; }
.wp-big .wp-crumbs { font-size: 13.5px; line-height: 26px; padding-right: 40px; }
.wp-big .wp-grid { gap: 5px; }
.wp-big .wp-cell { border-radius: 7px; cursor: pointer; }
.wp-big .wp-cell:not(.this):hover { opacity: 1; }
.wp-big .wp-pos { font-size: 15px; min-height: 21px; }
.wp-big .wp-file { font-size: 12.5px; }
.wp-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--raised); color: var(--muted); cursor: pointer; }
.wp-x:hover { background: var(--raised-2); color: var(--text); }
.wp-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--faint); font-size: 11.5px; }

@media (max-width: 767px) {
  .wp-over { padding: 12px; }
  .wp-bigcard { padding: 16px 14px 10px; }
  .wp-x { width: 44px; height: 44px; top: 8px; right: 8px; }
  .wp-big .wp-grid { --cols: 4 !important; }
}
@media (hover: none), (pointer: coarse) { .hp-card.is-where { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .wp-cell.sk { animation: none; } .wp-cell img { transition: none; } }
