/* Library (v3 Wall): the shared page heading (.lede, .sentence), the For you shelf, the bare wall and its tiles, and the states. Tokens only (tokens.css). */

/* page heading: brand and folder pages use .lede and .sentence; the filtered wall's result line is in search.css */
.lede { padding: var(--s-4) var(--gutter) 0; }
.sentence { font: 600 var(--fs-28)/1.15 var(--sans); letter-spacing: -.02em; max-width: 1180px; text-wrap: pretty; min-height: 1.15em; }
.sentence .num, .sentence .noun { font: inherit; font-variant-numeric: tabular-nums; }
.sentence .lead { color: var(--t3); font-weight: 450; font-size: var(--fs-16); letter-spacing: 0; margin-left: 8px; }
.sentence em { font-style: normal; color: var(--t2); }

.add-btn { height: 36px; padding: 0 12px 0 10px; gap: 8px; color: var(--t2); }
.add-btn kbd { background: var(--s2); margin-left: 4px; }

.sentence { font: var(--w-semibold) var(--t-20)/1.25 var(--font); min-height: 0; }
.add-btn { height: 36px; padding: 0 12px 0 10px; gap: 8px; color: var(--t2); }
.link-btn-line { margin-left: 0; }

/* ---------- the For you shelf: four collections, then the wall ---------- */
.shelf { padding-inline: var(--gutter); padding-top: var(--s-3); margin-bottom: var(--s-5); }
.shelf-label { margin: 0 0 var(--s-3); font-size: var(--t-12); font-weight: var(--w-medium); letter-spacing: .02em; color: var(--text-3); }
.shelf-row { display: flex; gap: var(--gutter); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-card { position: relative; flex: 0 0 var(--cover-w); min-width: 0; scroll-snap-align: start; display: block; border-radius: var(--r-card); }
.shelf-link { display: block; border-radius: var(--r-card); text-decoration: none; color: inherit; }
.shelf-link:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-gap); }
/* Hide this collection: a small round button on the cover's corner, shown on hover and focus (always on touch, where there is no hover) */
.shelf-x { position: absolute; top: var(--s-3); right: var(--s-3); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--img-btn-bg); color: var(--img-btn-text);
  opacity: 0; transform: scale(.94); transition: opacity var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-out), background var(--dur-quick); }
.shelf-x .ic { width: 14px; height: 14px; }
.shelf-x:hover { background: var(--mask); }
.shelf-card:hover .shelf-x, .shelf-card:focus-within .shelf-x { opacity: 1; transform: none; }
.shelf-x:focus-visible { outline: var(--focus-w) solid var(--img-btn-text); outline-offset: var(--focus-gap); box-shadow: 0 0 0 4px var(--img-btn-bg); }
@media (hover: none) { .shelf-x { opacity: .9; transform: none; } }
.mosaic { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--s-1); height: var(--cover-h); border-radius: var(--r-card); overflow: hidden; background: var(--surface-1); }
.mosaic span { display: block; overflow: hidden; background: var(--surface-2); }
.mosaic span:first-child { grid-row: span 2; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.shelf-card h2 { margin: var(--s-3) 0 0; font-size: var(--t-16); font-weight: var(--w-semibold); line-height: 1.25; letter-spacing: var(--track-display); text-wrap: balance; }
.shelf-card p { display: none; margin: var(--s-1) 0 0; font-size: var(--t-13); line-height: 1.4; color: var(--text-3); white-space: nowrap; }
.shelf-card:hover .mosaic { background: var(--surface-2); }
@media (min-width: 700px) {
  .shelf-row { display: grid; grid-template-columns: repeat(var(--shelf-cols, 3), minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
  .shelf-card { flex: none; }
  .shelf-card[hidden] { display: none; }
  .mosaic { height: 200px; }
}

/* ---------- the wall: bare tiles, one gutter both axes ---------- */
.wall-wrap { padding: 0 var(--gutter) 120px; }
.wall-wrap.no-shelf { padding-top: var(--s-3); }
.wall { position: relative; }
.tile { position: absolute; left: 0; top: 0; border-radius: var(--r-tile); }
/* elements per tile: .tile > a.tile-link > img, the hover brand label, the sub line (kept for the folder notes, hidden here), the copy button */
.tile-link { position: relative; display: block; overflow: hidden; border-radius: var(--r-tile); background: var(--surface-1); cursor: pointer; outline: 0; text-decoration: none;
  transition: scale var(--dur-press) var(--spring-snappy), translate var(--dur-lift) var(--ease-out); }
.tile-link img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity var(--dur-base) var(--ease-out), scale var(--dur-panel) var(--ease-out); }
.tile-link img.in { opacity: 1; }
.tile-link.vector { background: #fff; }   /* vectors are drawn for a white ground in both themes */
.tile-link.vector img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 8%; box-sizing: border-box; }
.tile-link video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-quick); pointer-events: none; }
.tile-link video.live { opacity: 1; }
/* hover scrim, under the brand label */
.tile-link::before { content: ""; position: absolute; inset: 0; background: var(--scrim-tile); opacity: 0; pointer-events: none; z-index: 1; transition: opacity var(--dur-quick) var(--ease-out); }
/* tall prints are capped and fade into the ground; a video carries a small play glyph. Both step aside on hover. */
.tile-link.tall::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; pointer-events: none; z-index: 1; background: linear-gradient(transparent, var(--surface-1)); }
.tile-link.video:not(.tall)::after { content: ""; position: absolute; z-index: 2; left: var(--s-3); bottom: var(--s-3); width: var(--s-5); height: var(--s-5); border-radius: 50%; pointer-events: none; transition: opacity var(--dur-quick) var(--ease-out);
  background: var(--img-btn-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M3.5 2l6.5 4-6.5 4z' fill='%23fff'/%3E%3C/svg%3E") center / 12px no-repeat; }
.tile-link.video.tall::before { z-index: 1; }
/* hover ring on the tile: pre-drawn, opacity only */
.tile::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-tile); pointer-events: none; z-index: 2; box-shadow: inset 0 0 0 1px var(--hover-ring); opacity: 0; transition: opacity var(--dur-quick) var(--ease-out), translate var(--dur-lift) var(--ease-out); }
/* hover lift shadow: drawn once, under the print (it comes first in the tile); only its opacity animates */
.tile::before { content: ""; position: absolute; inset: 0; border-radius: var(--r-tile); pointer-events: none; box-shadow: var(--lift-shadow); opacity: 0; transition: opacity var(--dur-lift) var(--ease-out); }
/* skeleton sheen: the tile link's own ::before (the hover scrim, idle until hover) carries a transformed gradient while .ld is set (grid.js: print not yet loaded) */
.tile-link.ld::before { background: linear-gradient(100deg, transparent 25%, var(--sheen) 50%, transparent 75%); opacity: 1; transition: none; transform: translateX(-100%);
  animation: sheen var(--dur-sheen) var(--ease-in-out) infinite; will-change: transform; }
.tile-link.vector.ld::before { background: linear-gradient(100deg, transparent 25%, var(--sheen-vector) 50%, transparent 75%); }
@keyframes sheen { to { transform: translateX(100%); } }
.tile-link:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--focus-gap); }
.tile.pressed .tile-link { scale: var(--press-ui); translate: 0 0; }
.tile.is-open .tile-link { opacity: 0; }
.cap-sub { display: none; }
/* brand on hover (desktop only): bottom left over the scrim; nothing on touch */
.cap-brand { position: absolute; z-index: 3; left: var(--s-3); bottom: var(--s-3); max-width: calc(100% - var(--s-3) * 2 - var(--tap)); padding: 0; font-weight: var(--w-medium); font-size: var(--t-13); line-height: 1.3; color: var(--img-btn-text);
  display: flex; max-width: calc(100% - var(--s-3) * 2 - var(--tap)); white-space: nowrap; border-radius: 4px; opacity: 0; translate: 0 4px; pointer-events: none; text-decoration: none; transition: opacity var(--dur-quick) var(--ease-out), translate var(--dur-quick) var(--ease-out); }
.cap-brand .cb-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* the count: a quiet second word, the on-image text dimmed (text-3 itself is too dark on the scrim in the light theme) */
.cap-brand .cb-c { flex: none; white-space: pre; color: color-mix(in srgb, var(--img-btn-text) 62%, transparent); font-variant-numeric: tabular-nums; }
.cap-brand[href]:hover .cb-n, .cap-brand[href]:focus-visible .cb-n { text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover::after, .tile:focus-within::after { opacity: 1; transition-duration: var(--dur-hover); }
  .tile:hover .tile-link::before, .tile:focus-within .tile-link::before { opacity: 1; }
  .tile:hover .tile-link img { scale: 1.015; }
  .tile:hover .tile-link, .tile:focus-within .tile-link { translate: 0 var(--lift-y); }
  .tile:hover::after, .tile:focus-within::after { translate: 0 var(--lift-y); }
  .tile:hover::before, .tile:focus-within::before { opacity: 1; }
  .tile.pressed .tile-link, .tile.pressed::after { translate: 0 0; }
  .tile:hover .cap-brand:not([href]), .tile:focus-within .cap-brand:not([href]) { pointer-events: none; }
  .tile:hover .tile-link::after, .tile:focus-within .tile-link::after { opacity: 0; }
  .tile:hover .cap-brand, .tile:focus-within .cap-brand { opacity: 1; translate: 0 0; pointer-events: auto; transition-duration: var(--dur-hover); }
}
@media (hover: none) { .cap-brand { display: none; } }

#few { margin-top: 32px; }

/* ---------- states ---------- */
.state { padding: 32px var(--page-x) 120px; }
.state.empty { display: grid; justify-items: center; align-content: start; text-align: center; padding-top: 80px; }
.state .st-ic { width: 56px; height: 56px; border-radius: var(--r-card); background: var(--s1); color: var(--t2); display: grid; place-items: center; margin-bottom: 24px; }
.state .st-ic .ic { width: 22px; height: 22px; }
.state h2 { font: 600 var(--fs-20)/1.25 var(--sans); letter-spacing: -.01em; }
.state h2 em { font-style: normal; color: var(--t2); }
.state p { color: var(--t2); margin: 8px 0 24px; max-width: 460px; }
.state .fixes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.state.error { max-width: 760px; }
.state.error pre, .state code { font: 400 var(--fs-13)/1.5 var(--mono); background: var(--s1); border-radius: 6px; padding: 2px 6px; }
.state.error pre { padding: 16px; margin: 0 0 24px; overflow-x: auto; border-radius: var(--r-ctl); }
.skeleton { position: relative; padding: 32px var(--page-x); columns: 5 180px; column-gap: 24px; }
.skeleton i { display: block; break-inside: avoid; margin-bottom: 24px; border-radius: var(--r-media); background: linear-gradient(110deg, var(--s1) 30%, var(--s2) 50%, var(--s1) 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.placeholder { padding: 32px var(--page-x) 100px; max-width: 900px; color: var(--t2); }
.placeholder p { margin-bottom: 16px; }
.ph-list { columns: 3 200px; gap: 24px; }
.ph-list li { padding: 3px 0; }
.ph-list a { text-underline-offset: 3px; }


@media (max-width: 820px) { .state { padding-left: var(--gutter); padding-right: var(--gutter); } .skeleton { columns: 2 140px; column-gap: var(--gutter); } }
.wall.is-scrolling { pointer-events: none; }
.wall.is-scrolling .tile-link, .wall.is-scrolling .tile::before, .wall.is-scrolling .tile::after { transition: none; }

/* tile controls are added by js/account-core.js and styled by css/account.css, which loads lazily (and gives up waiting after 1.5 s): until it
   arrives the controls must not show, stacked, over every tile. Hidden here; account.css sets the real layout and reveals them on hover. */
.tile-acts { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.tile-acts > * { position: absolute; opacity: 0; }
@media (hover: none), (pointer: coarse) { .tile-acts > .t-like, .tile-acts > .t-save { display: none; } }

/* copy button: bottom right of a tile, on hover or focus; the work is never dimmed. Top right is left for Save (B-5). */
.tile-copy { position: absolute; bottom: var(--s-3); right: var(--s-3); z-index: 4; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--img-btn-bg); color: var(--img-btn-text); opacity: 0; transform: scale(.92); transition: opacity var(--dur-quick) var(--ease-out), transform var(--dur-quick) var(--ease-out), background var(--dur-quick); }
.tile-copy .ic { width: 16px; height: 16px; }
.tile-copy:hover { background: var(--mask); }
.tile:hover .tile-copy, .tile:focus-within .tile-copy, .tile-copy:focus-visible { opacity: 1; transform: none; }
.tile-copy:focus-visible { outline: var(--focus-w) solid var(--img-btn-text); outline-offset: var(--focus-gap); box-shadow: 0 0 0 4px var(--img-btn-bg); }
.wall.is-scrolling .tile:not(:focus-within) .tile-copy { opacity: 0; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); right: 0; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-1); font: var(--w-medium) var(--t-12)/1 var(--font); white-space: nowrap; box-shadow: var(--pop-shadow); pointer-events: none; z-index: 5; }
@media (hover: none) { .tile-copy { display: none; } }
@media (prefers-reduced-motion: reduce) { .tile:hover .tile-link img { scale: none; } .tile-link { transition: none; } .tile.pressed .tile-link { scale: none; } .tile-link.ld::before { animation: none; background: none; } }
