/* Resources (2026-10-15): the tile every resource is drawn on (dock, Launcher, Library, Manage) and the top bar's
   Launcher. Loaded on every page (Appearance::afterStylesHtml) because the Launcher is. Page styles are in
   resources-page.css. */

/* The tile: one shape for every logo so they line up: Planning Center's "inflated" squircle (Josh, 2026-10-16), a
   superellipse with n = 3.05 fitted to its 180px icon to within half a pixel (public/images/resources/squircle.svg;
   how it was made is in CLAUDE.md › Resources). The outer .rs-tile carries the shadow (a drop-shadow follows the cut
   shape); the inner .rs-shape is cut to the outline by the mask alone. A logo that's a designed square icon fills it
   ("fill": no backing, and it runs 5% past the mask, so its own edge is cut away and only one edge is drawn); a mark
   with a transparent background sits smaller on its tile color ("pad": white unless chosen, like an app icon, in both
   themes); with no logo, the item's icon in its color on the card surface ("glyph").

   The look (locked in 2026-10-16 after comparing five: Josh picked the soft rim): a soft shadow below that deepens as
   a dock icon grows, and light along the edge (squircle-rim.svg: the mask's own path, blurred over 2–3px, strongest at
   the top left and bottom right, after iPadOS) with a faint lighter top. The variables keep any later change to one
   place: --rs-sh scales the shadow, --rs-lift-k how much it deepens, --rs-gloss is drawn over the face (::after),
   --rs-fill-bg / --rs-bleed are for full-tile logos. */
:root { --rs-sh: 1; --rs-lift-k: 1; --rs-gloss-blend: normal; --rs-fill-bg: transparent; --rs-bleed: 105%;
    --rs-gloss: url("../images/resources/squircle-rim.svg") center / 100% 100% no-repeat, linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 45%); }

.rs-tile { --rs-size: 2.6rem; --rs-lift: 0; width: var(--rs-size); height: var(--rs-size); display: inline-flex; flex: none;
    /* At rest 1px down, 1.5px blur, 13%; fully grown 4px down, 5.5px blur, 19%. */
    filter: drop-shadow(0 calc(1px + var(--rs-lift) * var(--rs-lift-k) * 3px) calc(1.5px + var(--rs-lift) * var(--rs-lift-k) * 4px) rgba(15, 23, 42, calc((.13 + var(--rs-lift) * var(--rs-lift-k) * .06) * var(--rs-sh))));
    transition: filter .12s ease-out; }
html[data-bs-theme=dark] .rs-tile { filter: drop-shadow(0 calc(1px + var(--rs-lift) * var(--rs-lift-k) * 3px) calc(2px + var(--rs-lift) * var(--rs-lift-k) * 4px) rgba(0, 0, 0, calc((.35 + var(--rs-lift) * var(--rs-lift-k) * .1) * var(--rs-sh)))); }
/* No overflow: hidden: the mask already hides everything outside the shape (the logo's extra 5% included), and
   clipping to the pixel-rounded box flattened the sides where the curve meets it. */
.rs-shape { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--rs-bg, #fff);
    -webkit-mask: url("../images/resources/squircle.svg") center / 100% 100% no-repeat; mask: url("../images/resources/squircle.svg") center / 100% 100% no-repeat; }
/* The light over the face: 70% in light mode, 50% in dark mode. */
.rs-shape::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--rs-gloss); mix-blend-mode: var(--rs-gloss-blend); opacity: .7; }
html[data-bs-theme=dark] .rs-shape::after { opacity: .5; }
.rs-tile img { display: block; }
.rs-tile.is-fill .rs-shape { background: var(--rs-fill-bg); }
.rs-tile.is-fill img { width: var(--rs-bleed); height: var(--rs-bleed); max-width: none; object-fit: cover; flex: none; }
.rs-tile.is-pad img { width: 66%; height: 66%; object-fit: contain; }
.rs-tile.is-glyph .rs-shape { background: var(--rs-bg, rgb(var(--lp-surface-rgb, 255, 255, 255))); color: var(--rs-color, var(--tblr-body-color)); }
.rs-tile.is-glyph .cli { width: 55%; height: 55%; vertical-align: 0; }
/* A dock icon's shadow deepens as it grows (--s is the dock's growth, 1 to 1.35), as if it lifts toward the pointer. */
.home-dockbar-tile .rs-tile { --rs-lift: calc((var(--s, 1) - 1) / .35); }
.rs-tile.rs-sm { --rs-size: 1.6rem; }
.rs-tile.rs-xs { --rs-size: 1.25rem; }
.rs-tile.rs-lg { --rs-size: 3rem; }

/* The Launcher: a grid icon in the top bar opening a panel with your few, and a search over everything. */
.lp-launcher-toggle .cli { width: 1.6rem; height: 1.6rem; vertical-align: -.35em; }
.lp-launcher-menu { width: min(22rem, calc(100vw - 1.5rem)); padding: .75rem; }
/* Phones (Josh, 2026-10-16: hung from its button's right edge, it ran off the left of the screen): the panel spans the
   screen under the top bar, 12px from each side. The toggle uses data-bs-display="static", so CSS places it. */
@media (max-width: 575.98px) {
    .lp-launcher-menu.show { position: fixed; left: .75rem; right: .75rem; top: calc(var(--lp-launcher-top, 3.5rem) + .25rem); width: auto; max-height: calc(100dvh - var(--lp-launcher-top, 3.5rem) - 1.5rem); overflow-y: auto; }
    .lp-launcher-menu.dropdown-menu-arrow::before, .lp-launcher-menu.dropdown-menu-arrow::after { display: none; }
}
.lp-launcher-search { margin-bottom: .6rem; }
.lp-launcher-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.lp-launcher-item { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .5rem .1rem; border-radius: .6rem; color: inherit; text-decoration: none; min-width: 0; }
.lp-launcher-item:hover, .lp-launcher-item:focus-visible, .lp-launcher-result:hover, .lp-launcher-result.is-active { background: var(--tblr-bg-surface-secondary); text-decoration: none; color: inherit; }
.lp-launcher-name { font-size: .72rem; line-height: 1.3; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-launcher-results { display: flex; flex-direction: column; max-height: 20rem; overflow-y: auto; }
.lp-launcher-result { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: .5rem; color: inherit; text-decoration: none; min-width: 0; }
.lp-launcher-result .rs-tile { --rs-size: 1.9rem; }
.lp-launcher-result small { display: block; color: var(--tblr-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-launcher-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--tblr-border-color); font-size: .8rem; }
.lp-launcher-empty { font-size: .85rem; color: var(--tblr-secondary); padding: .75rem .25rem; text-align: center; }
