/* ---------------------------------------------------------------------------------------------------------------
 * Real app media on a page (portal/apps/*, portal/ci/*: content/story/app-media.json): the logo that identifies an app beside its name, the card "Rented
 * before, on the Core now", a real screenshot with its label, the dialog a screenshot opens in (portal/shots.js) and the "How it runs" pair of columns.
 * Shared by the front page (portal/gallery.css) and a family's page (portal/family.css, site.css): both define the tokens used here. Colours are tokens only;
 * the one literal, the logo tile, is --pg-logo-bg in each page's token block. Hover effects are CSS only and the pages' prefers-reduced-motion rule turns
 * every transition off.
 * ------------------------------------------------------------------------------------------------------------- */

/* a real logo: it identifies the app named beside it (never alone). White tile in both themes so a dark mark stays visible. */
.logo { flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 7px; object-fit: contain; background: var(--pg-logo-bg); box-shadow: inset 0 0 0 1px var(--pg-hairline); }

/* "Rented before, on the Core now": the services a person's moments replace, against the apps that do the job */
.swap { margin-top: 18px; max-width: 54em; padding: 14px 18px 18px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--pg-hairline); }
.swap-h { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--primary); }
.swap-cols { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr); gap: 10px 16px; align-items: start; margin-top: 10px; }
.swap-cap { margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted-foreground); }
.swap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.swap-list li { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 14.5px; font-weight: 600; }
.swap-before li { color: var(--muted-foreground); font-weight: 500; }
.swap-before li::before { content: ""; flex: none; width: 8px; height: 8px; margin: 0 6px 0 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted-foreground); }
.swap-now .swap-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.swap-arrow { align-self: center; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--secondary); color: var(--primary); }
.swap-arrow .i { width: 17px; height: 17px; }

/* real screenshots of a person's apps: a strip of up to three, each a link to the picture itself (portal/shots.js opens it in the dialog) */
.shots { margin-top: 26px; }
.shots h3 { font-size: 15px; font-weight: 700; }
.shots-row { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.shot { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.shot-open { display: block; overflow: hidden; border-radius: 12px; background: var(--pg-thumb-bg); box-shadow: inset 0 0 0 1px var(--pg-hairline), var(--shadow-sm); cursor: zoom-in; }
.shot-open img { width: 100%; height: auto; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.shot-open:hover img { transform: scale(1.025); }
.shot figcaption { font-size: 12.5px; line-height: 1.45; color: var(--muted-foreground); text-wrap: pretty; }

/* the dialog a screenshot opens in: a card over the page, so it is set in the type scale of the tour's cards (rem of the canon's 17 px root: 1.5rem = 25.5 px at 768 px and wider,
   clamp(20px, 5.4vw, 25.5px) below that: the page has no viewer.css to take the tokens from), the canon's radius scale (2xl, +10px) and its Dialog's hairline, and its buttons are as
   tall as the type needs (a control is the canon's 500) */
.shot-dialog { --dlg-min: 1.5rem; width: min(48rem, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: calc(0.625rem + 10px); background: var(--card); color: var(--foreground); box-shadow: var(--shadow-lg), 0 0 0 1px var(--pg-hairline); overflow: hidden; font-size: var(--dlg-min); line-height: 1.38; }
@media (max-width: 767px) { .shot-dialog { --dlg-min: clamp(20px, 5.4vw, 25.5px); } }
.shot-dialog::backdrop { background: color-mix(in srgb, var(--pg-ink) 72%, transparent); }
.shot-dialog-in { display: grid; gap: 1rem; padding: 1.25rem; max-height: calc(100vh - 24px); overflow: auto; }
.shot-dialog-fig img { width: 100%; height: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--pg-hairline); }
.shot-dialog-cap { margin: 0; font-size: var(--dlg-min); line-height: 1.38; color: var(--muted-foreground); }
.shot-dialog-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.shot-dialog .btn { font-size: var(--dlg-min); font-weight: 500; line-height: 1.15; min-height: max(44px, calc(var(--dlg-min) * 2)); padding: 0.4rem 1.4rem; border-radius: calc(0.625rem + 4px); text-align: center; }

/* how it runs: what Companion Hub does and what the Companion account does, each with real screenshots */
.runs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; margin-top: 22px; }
.run h3 { font-size: 19px; font-weight: 700; }
.run > p { margin-top: 6px; max-width: 34em; color: var(--muted-foreground); text-wrap: pretty; }
.run-shots { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }


@media (max-width: 900px) {
  .shots-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pg-gutter); margin: 12px calc(-1 * var(--pg-gutter)) 0; padding: 0 var(--pg-gutter) 8px; scrollbar-width: thin; }
  .shots-row > li { flex: 0 0 min(80%, 360px); scroll-snap-align: start; }
  .runs { grid-template-columns: 1fr; }
  .swap-cols { grid-template-columns: 1fr; }
  .swap-arrow { transform: rotate(90deg); justify-self: start; }
}
@media (hover: none) { .shot-open:hover img { transform: none; } }
@media (prefers-reduced-motion: reduce) { .shot-open img { transition: none !important; } .shot-open:hover img { transform: none; } }
