/* Portfolio gallery pages, plus the image links on portfolio.html */
.bg-page { --bg-amethyst: #48216B; --bg-lavender: #C9A7EB; --bg-pearl: #FAF8FC; --bg-h: min(68vh, 640px); background: var(--bg-pearl); }
.bg-head { max-width: 1110px; margin-inline: auto; padding: 32px 16px 24px; text-align: center; }
.bg-head h1 { color: var(--bg-amethyst); margin: 0; }
.bg-back { display: inline-block; margin-bottom: 12px; color: var(--bg-amethyst); text-decoration: underline; font-size: 18px; }
.bg-window { background: var(--bg-lavender); padding-block: 20px; }
.bg-track { position: relative; display: flex; gap: 16px; padding-inline: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-color: var(--bg-amethyst) transparent; }
.bg-track:focus-visible, .bg-btn:focus-visible, .bg-back:focus-visible, .bg-others a:focus-visible, .bg-link:focus-visible { outline: 3px solid var(--bg-amethyst, #48216B); outline-offset: 2px; }
.bg-item { flex: 0 0 auto; width: min(calc(var(--bg-h) * var(--r, 1.5)), calc(100vw - 32px)); height: var(--bg-h); margin: 0; scroll-snap-align: center; }
.bg-item img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bg-status { min-height: 120px; display: flex; align-items: center; justify-content: center; width: 100%; padding: 16px; text-align: center; color: var(--bg-amethyst); font-size: 22px; }
.bg-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 16px 16px 0; }
.bg-btn { min-width: 88px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 4px; background: var(--bg-amethyst); color: var(--bg-pearl); font: inherit; font-size: 18px; cursor: pointer; }
.bg-btn:hover { background: #351850; }
.bg-count { min-width: 64px; text-align: center; color: var(--bg-amethyst); font-size: 18px; font-variant-numeric: tabular-nums; }
.bg-others { max-width: 1110px; margin-inline: auto; padding: 32px 16px 48px; text-align: center; }
.bg-others h2 { color: var(--bg-amethyst); font-size: 28px; margin: 0 0 12px; }
.bg-others ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.bg-others a { display: inline-block; padding-block: 6px; color: var(--bg-amethyst); text-decoration: underline; font-size: 18px; }
.bg-link { display: block; color: inherit; }
.bg-link img { transition: opacity .15s; }
a.bg-link:hover img { opacity: .85; }
a.bg-caption-link { color: inherit; }
a.bg-caption-link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .bg-link img { transition: none; } }
.bg-page h1, .bg-page h2 { color: var(--bg-amethyst) !important; }
.bg-controls[hidden] { display: none; }
.bg-track { justify-content: safe center; }
a.bg-caption-link { text-decoration: none; }
.bg-desc { max-width: 760px; margin: 0 auto 20px; padding-inline: 16px; text-align: center; color: var(--bg-amethyst); font-size: 20px; line-height: 1.4; }
