/* A profile its owner arranges (panels/profile-home.js): favourites as the
   largest covers on the page, the year in numbers as one figure and a quiet
   row of months, and the dialogs that choose and order them. */

/* ---- favourites ---- */
.fav-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.fav-row li { min-width: 0; }
.fav-title { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.fav-frame { display: flex; align-items: flex-end; aspect-ratio: 2 / 3; }
.fav-art {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px;
  background: var(--glass-tray, var(--bg-2)); box-shadow: 0 22px 30px -22px rgb(var(--shade, 0 0 0) / .8);
  transition: transform .3s var(--ease);
}
.fav-art[data-aspect='square'] { aspect-ratio: 1; }
.fav-art > b { padding: 12px; font: 600 15px/1.3 var(--font-display); text-align: center; overflow-wrap: anywhere; }
.fav-art.is-loaded > b { visibility: hidden; }
.fav-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fav-title:hover .fav-art { transform: translateY(-3px); }
.fav-title:focus-visible { outline: none; }
.fav-title:focus-visible .fav-art { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
.fav-name { font: 600 15px/1.3 var(--font-display); letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.fav-title small { color: var(--ink-2); font-size: 13px; }

/* ---- choosing favourites ---- */
.fav-picked { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fav-picked li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; min-height: 52px; padding: 4px 4px 4px 6px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.fav-picked li > span:not(.fav-mini) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.fav-picked .fav-none { display: block; padding: 14px; color: var(--ink-2); background: none; box-shadow: inset 0 0 0 1px var(--line); }
.fav-mini { position: relative; display: grid; place-items: center; width: 36px; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 3px; background: var(--glass-tray, var(--bg-2)); }
.fav-mini[data-aspect='square'] { aspect-ratio: 1; }
.fav-mini > b { font-size: 0; }
.fav-mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fav-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; }
.fav-hit { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 10px 6px 6px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.fav-hit:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.fav-hit:disabled { opacity: .45; cursor: default; }
.fav-hit:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
.fav-hit > span:last-child { display: grid; gap: 3px; min-width: 0; }
.fav-hit b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fav-hit small { color: var(--ink-2); font-size: 12.5px; }

/* ---- the year in numbers ---- */
.year-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 1.2fr); align-items: end; gap: 20px 40px; }
.year-total { display: grid; gap: 6px; }
.year-total b { font: 650 clamp(56px, 6vw, 84px)/0.9 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.year-total span { color: var(--ink-2); font-size: 15px; }
.year-kinds { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; color: var(--ink-2); font-size: 14.5px; }
.year-kinds b { color: var(--ink); font: 500 13px/1 var(--font-mono); }
.year-months { display: grid; gap: 8px; }
.year-bars { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 4px; height: 64px; }
.year-bars span { display: block; height: max(3px, calc(var(--share) * 100%)); border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.year-bars span[data-top='1'] { background: color-mix(in srgb, var(--ink) 60%, transparent); }
.year-months small { color: var(--ink-2); font-size: 13.5px; }

/* ---- arranging the profile ---- */
.arrange-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.arrange-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; min-height: 52px; padding: 4px 4px 4px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.arrange-list li.is-hidden .arrange-shown span { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.social-form .arrange-shown, .arrange-shown { display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 550; }
.arrange-shown input { width: 20px; height: 20px; accent-color: var(--ink); }

@media (max-width: 720px) {
  .fav-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .fav-name { font-size: 13px; }
  .fav-title small { display: none; }
  .year-grid { grid-template-columns: 1fr; gap: 18px; }
  .fav-results { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .fav-art { transition: none; } .fav-title:hover .fav-art { transform: none; } }

/* ---- the summary of a member's profile: counts that say what they count (the public /u/ page keeps its own, as in social.css) ---- */
.profile-page:not(.public-profile) .profile-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: start; gap: 14px 24px; margin: 22px 0 14px; }
.profile-page:not(.public-profile) .profile-summary > span { display: grid; gap: 2px; min-width: 0; font-size: 13px; text-transform: none; }
.profile-page:not(.public-profile) .profile-summary > span b { font: 600 26px/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.profile-page:not(.public-profile) .profile-summary > span small { color: var(--ink-3); font-size: 13px; line-height: 1.3; }
.profile-page:not(.public-profile) .profile-summary > small { grid-column: 1 / -1; margin: 0; }

/* ---- the bar of the profile's parts: sticks while the page scrolls, scrolls sideways inside itself ---- */
.profile-nav {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%;
  margin: 0 0 6px; padding: 6px 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.profile-nav::-webkit-scrollbar { display: none; }
.profile-nav[hidden] { display: none; }
.profile-nav-link { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--ink-2); font: 600 13.5px/1 var(--font-ui); text-decoration: none; white-space: nowrap; }
.profile-nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.profile-nav-link[aria-current='true'] { color: var(--ink); background: color-mix(in srgb, var(--ink) 12%, transparent); }
.profile-nav-link:focus-visible, .profile-page .social-section h2:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
.profile-page .social-section > .medal-showcase { margin: 0 0 20px; }
/* the end of the page, which the bar watches so that the last part is current there */
.profile-end { height: 1px; }
/* The page scrolls inside its own <main>, whose top padding counts for a sticky box: the offsets bring the bar to the
   top edge (the top bar is in the flow above it) and, in Aurora, to just under the floating top bar. */
.profile-nav { top: -48px; }
.profile-page:not(.public-profile) .social-section { scroll-margin-top: 64px; }
[data-theme='aurora'] .profile-nav { top: -44px; padding: 4px 6px; border: 0; border-radius: 999px; background: var(--glass-float, var(--glass)); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--rim-soft); }
[data-theme='aurora'] .profile-page:not(.public-profile) .social-section { scroll-margin-top: 140px; }
@media (max-width: 820px) {
  .profile-nav { top: -28px; }
  [data-theme='aurora'] .profile-nav { top: -42px; }
  [data-theme='aurora'] .profile-page:not(.public-profile) .social-section { scroll-margin-top: 130px; }
}

/* the heading's controls stay in one row; a long label gives way before the row wraps */
.profile-actions { flex-wrap: nowrap; min-width: 0; }
.profile-actions > .btn, .profile-actions > .friend-actions, .profile-actions > .friend-actions > .btn { min-width: 0; }
.profile-actions > .btn.icon-only { flex: none; }
.profile-actions .btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-actions > .friend-actions { flex-wrap: nowrap; }

/* a guest at a member's place: what it is and the way in */
.guest-door { max-width: 640px; padding: 56px 0; }
.guest-door h1 { margin: 0 0 12px; font: 650 clamp(32px, 4vw, 48px)/1.08 var(--font-display); letter-spacing: -0.035em; }
.guest-door p { margin: 0 0 22px; color: var(--ink-2); font-size: 17px; line-height: 1.55; }
.guest-door-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.guest-door-actions a.btn { text-decoration: none; }
