/* Ricerca persone, profili pubblici, FAQ e 404 della home (stili presi da style.css, solo dentro .pg). */
.pg {
  --bg: #141414;
  --bg-2: #1b1b1b;
  --card: #202020;
  --card-2: #272727;
  --line: #2f2f2f;
  --text: #f6f3ef;
  --muted: #b3aca5;
  --primary: #ff6b2c;
  --primary-ink: #1a0d06;
  --accent: #ffc93c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  color-scheme: dark;
  font-family: var(--font);
  color: var(--text);
}

.pg .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.pg .wrap.narrow { max-width: 760px; }
.pg .lead.small { color: var(--muted); font-size: 1rem; max-width: 62ch; margin: 12px 0 22px; }

.pg .search { position: relative; max-width: 620px; }
.pg .search input {
  width: 100%; height: 56px; padding: 0 52px 0 50px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  font: inherit; font-size: 1.05rem; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.pg .search input::placeholder { color: #8d8680; }
.pg .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 107, 44, .22); }
.pg .search input::-webkit-search-cancel-button { display: none; }
.pg .search-ico { position: absolute; left: 18px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.pg .search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.pg .search-clear:hover { background: rgba(255, 255, 255, .08); }
.pg .search-clear svg { width: 18px; height: 18px; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.pg .search-status { color: var(--muted); min-height: 1.5em; margin: 14px 0 8px; font-size: .95rem; }

.pg .people { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .pg .people { grid-template-columns: 1fr 1fr; } }
.pg .person {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s, transform .2s; animation: fadeUp .35s ease both;
}
.pg .person:hover { color: var(--text); border-color: rgba(255, 107, 44, .5); background: var(--card-2); transform: translateY(-1px); }
.pg .person-main { min-width: 0; flex: 1; }
.pg .person-name { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.pg .person-name .txt, .pg .person-user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg .person-user { display: block; color: var(--muted); font-size: .9rem; }
.pg .person-meta { display: block; color: #d7d0c9; font-size: .85rem; margin-top: 2px; }
.pg .chev { width: 18px; height: 18px; flex: none; fill: none; stroke: #6f6a65; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Avatar ---------- */
.pg .avatar {
  position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--card-2);
  font-family: var(--display); font-weight: 800; color: #fff; font-size: 1.1rem; text-transform: uppercase;
}
.pg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.pg .avatar.lg { width: 104px; height: 104px; font-size: 2.2rem; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--primary); }
.pg .avatar.md { width: 72px; height: 72px; font-size: 1.5rem; }

.pg .verified { width: 17px; height: 17px; flex: none; }
.pg .verified.lg { width: 24px; height: 24px; }

/* ---------- Tendenze ---------- */
.pg .creators-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 12px;
  overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: #444 transparent;
}
.pg .creator {
  scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 18px 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); height: 100%; transition: border-color .2s, transform .2s;
}
.pg .creator:hover { color: var(--text); border-color: rgba(255, 107, 44, .5); transform: translateY(-2px); }
.pg .creator .rank { align-self: flex-start; margin: -8px 0 -6px -2px; color: var(--accent); font-weight: 800; font-size: .8rem; }
.pg .creator .person-name { justify-content: center; max-width: 100%; margin-top: 8px; font-size: .95rem; }
.pg .creator .person-user { max-width: 100%; font-size: .82rem; }
.pg .creator .person-meta { font-size: .8rem; }

.pg .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pg .chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .95rem;
}
.pg .chip .hash { color: var(--primary); }
.pg .chip small { color: var(--muted); font-weight: 500; font-size: .8rem; }

.pg .grid { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 760px) { .pg .grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
.pg .tile {
  position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #2a2a2a, #1d1d1d); animation: fadeUp .4s ease both;
}
.pg .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pg .tile .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(255, 107, 44, .25), transparent 60%), linear-gradient(160deg, #2b2b2b, #1c1c1c);
}
.pg .tile .ph svg { width: 34px; height: 34px; fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.6; stroke-linejoin: round; }
.pg .tile::after {
  content: ''; position: absolute; inset: auto 0 0; height: 55%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78)); pointer-events: none;
}
.pg .tile-meta {
  position: absolute; z-index: 1; left: 8px; right: 8px; bottom: 7px;
  display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .78rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.pg .tile-meta span { display: inline-flex; align-items: center; gap: 3px; }
.pg .tile-meta svg { width: 13px; height: 13px; fill: currentColor; }
.pg .tile-user {
  position: absolute; z-index: 1; top: 7px; left: 7px; right: 7px; max-width: calc(100% - 14px);
  font-size: .76rem; font-weight: 700; color: #fff; text-decoration: none;
  background: rgba(0, 0, 0, .5); padding: 3px 8px; border-radius: 999px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: max-content;
}
.pg .tile-user:hover { color: var(--accent); }
.pg .tile-type {
  position: absolute; z-index: 1; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .5);
}
.pg .tile-type svg { width: 12px; height: 12px; fill: #fff; }

/* ---------- Skeleton / stati ---------- */
.pg .sk {
  background: linear-gradient(90deg, #232323 0%, #2e2e2e 40%, #232323 80%);
  background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.pg .sk-line { height: 12px; margin: 6px 0; }
.pg .sk-circle { border-radius: 50%; }
.pg .stat .sk-line.big { height: 30px; width: 60%; margin-bottom: 12px; }
.pg .sk-chip { display: inline-block; width: 96px; height: 38px; border-radius: 999px; }

.pg .state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 28px 16px; border: 1px dashed #3a3a3a; border-radius: var(--radius); color: var(--muted);
}
.pg .state strong { color: var(--text); font-size: 1.05rem; }
.pg .state svg { width: 36px; height: 36px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pg .state.inline { grid-column: 1 / -1; }

/* ---------- FAQ ---------- */
.pg .faq { display: grid; gap: 10px; }
.pg .faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.pg .faq details[open] { border-color: rgba(255, 107, 44, .4); }
.pg .faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 18px; font-weight: 700; position: relative;
}
.pg .faq summary::-webkit-details-marker { display: none; }
.pg .faq summary::after {
  content: ''; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg); transition: transform .25s ease;
}
.pg .faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.pg .faq summary:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); }
.pg .faq details p { margin: 0; padding: 0 18px 18px; color: var(--muted); }

/* ---------- Profilo ---------- */
.pg .profile-wrap { padding-top: 22px; padding-bottom: 64px; min-height: 70vh; }
.pg .back {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none;
  font-weight: 600; padding: 8px 12px 8px 6px; border-radius: 10px; margin-left: -6px;
}
.pg .back:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.pg .back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pg .p-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 0 8px; animation: fadeUp .4s ease both; }
.pg .p-name { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pg .p-user { color: var(--muted); font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.pg .p-bio { white-space: pre-line; max-width: 52ch; margin: 14px auto 0; color: #e2dbd4; overflow-wrap: anywhere; }
.pg .p-joined { color: var(--muted); font-size: .9rem; margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.pg .p-joined svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pg .p-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px auto 0; max-width: 560px;
}
@media (min-width: 560px) { .pg .p-stats { grid-template-columns: repeat(5, 1fr); } }
.pg .p-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 6px; text-align: center; }
.pg .p-stat b { display: block; font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.pg .p-stat span { color: var(--muted); font-size: .8rem; }
.pg .p-section-t { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin: 30px 0 12px; }
.pg .p-hashtags { justify-content: center; }

/* ---------- 404 ---------- */
.pg .empty-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 40px; padding-bottom: 60px; }
.pg .big-code {
  margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(5rem, 28vw, 9rem); line-height: 1;
  background: linear-gradient(100deg, var(--accent), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pg .empty-page .h2:focus { outline: none; }

.pg .people { max-width: 620px; margin: 0 auto; }
.pg .search-status { text-align: center; }
.pg .profile-wrap { position: relative; z-index: 3; padding-top: 104px; }
.pg .chips { justify-content: center; }
.pg .p-section-t { text-align: center; }
