/**
 * Public profile — minimal cover + identity layout
 * Loaded from user/public_profile.html
 */

.public-profile-page {
  --pp-max: 48rem;
  --pp-cover-h: 9.5rem;
  --pp-avatar: 7rem;
  --pp-radius: 1rem;
  --pp-surface: #ffffff;
  --pp-border: var(--color-slate-200, #e2e8f0);
  --pp-muted: var(--color-slate-500, #64748b);
  --pp-text: var(--color-slate-900, #0f172a);
  --pp-subtle: var(--color-slate-50, #f8fafc);
  --pp-cover-from: #334155;
  --pp-cover-to: #1e293b;
  padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 640px) {
  .public-profile-page {
    --pp-cover-h: 11rem;
    --pp-avatar: 8rem;
    padding: 1.75rem 1.25rem 3rem;
  }
}

.dark .public-profile-page {
  --pp-surface: var(--color-dark-surface, #171717);
  --pp-border: var(--color-dark-border, #3f3f46);
  --pp-muted: var(--color-dark-text-secondary, #a8a29e);
  --pp-text: var(--color-dark-text, #fafaf9);
  --pp-subtle: var(--color-dark-fill-subtle, #141414);
  --pp-cover-from: #262626;
  --pp-cover-to: #0c0a09;
}

.public-profile {
  max-width: var(--pp-max);
  margin: 0 auto;
  border: 1px solid var(--pp-border);
  border-radius: calc(var(--pp-radius) + 0.25rem);
  background: var(--pp-surface);
  overflow: hidden;
  box-shadow: 0 12px 40px -28px rgb(15 23 42 / 45%);
}

.dark .public-profile {
  box-shadow: 0 16px 40px -28px rgb(0 0 0 / 80%);
}

/* Cover */
.public-profile__cover {
  position: relative;
  height: var(--pp-cover-h);
  background:
    radial-gradient(ellipse 80% 120% at 12% 0%, rgb(255 255 255 / 14%), transparent 55%),
    linear-gradient(135deg, var(--pp-cover-from) 0%, #475569 42%, var(--pp-cover-to) 100%);
  overflow: hidden;
}

.public-profile__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgb(255 255 255 / 12%) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.45;
  pointer-events: none;
}

/* Identity header */
.public-profile__identity {
  position: relative;
  padding: 0 1.25rem 1.25rem;
  animation: public-profile-fade-in 0.45s ease-out both;
}

@media (min-width: 640px) {
  .public-profile__identity {
    padding: 0 1.75rem 1.5rem;
  }
}

.public-profile__avatar-wrap {
  width: var(--pp-avatar);
  height: var(--pp-avatar);
  margin-top: calc(var(--pp-avatar) / -2);
  border-radius: 9999px;
  border: 3px solid var(--pp-surface);
  box-shadow: 0 4px 16px rgb(15 23 42 / 18%);
  overflow: hidden;
  background: var(--pp-subtle);
  animation: public-profile-fade-in 0.55s ease-out 0.05s both;
}

.public-profile__avatar-wrap img,
.public-profile__avatar-wrap > div {
  width: 100% !important;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-profile__avatar-wrap span {
  font-size: 1.5rem;
}

.public-profile__name-block {
  margin-top: 0.85rem;
}

.public-profile__name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pp-text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .public-profile__name {
    font-size: 1.75rem;
  }
}

.public-profile__meta {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--pp-muted);
}

.public-profile__header-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pp-text);
}

.public-profile__header-rating svg {
  width: 1rem;
  height: 1rem;
  color: #d97706;
}

.public-profile__header-rating-count {
  font-weight: 500;
  color: var(--pp-muted);
}

.public-profile__empty-hint {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--pp-muted);
  line-height: 1.5;
}

.public-profile__empty-hint a {
  color: var(--pp-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.public-profile__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.public-profile__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

/* Stone trusted-host chip (aligned with marketplace-trust / homepage) */
.public-profile__badge--verified {
  background: rgba(120, 113, 108, 0.1);
  color: #44403c;
  border-color: rgba(120, 113, 108, 0.22);
  cursor: help;
}

.dark .public-profile__badge--verified {
  background: rgba(168, 162, 158, 0.16);
  color: #e7e5e4;
  border-color: rgba(168, 162, 158, 0.28);
}

.public-profile__badge--host {
  background: rgb(15 90 86 / 10%);
  color: var(--color-brand-accent-fg, var(--color-brand-accent, #0f5a56));
  border-color: rgb(15 90 86 / 22%);
}

.dark .public-profile__badge--host {
  background: rgb(15 90 86 / 22%);
  color: var(--color-brand-accent-fg, #5eead4);
  border-color: rgb(94 234 212 / 28%);
}

/* Owner preview notice */
.public-profile__owner-banner {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pp-border);
  background: var(--pp-subtle);
  font-size: 0.8125rem;
  color: var(--pp-muted);
}

@media (min-width: 640px) {
  .public-profile__owner-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.public-profile__owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
}

.public-profile__owner-actions a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-brand-accent-fg, var(--color-brand-accent, #0f5a56));
  text-decoration: none;
}

.public-profile__owner-actions a:hover {
  text-decoration: underline;
}

.dark .public-profile__owner-actions a {
  color: var(--color-brand-accent-fg, #5eead4);
}

.public-profile__owner-actions a.public-profile__link-muted {
  color: var(--pp-muted);
  font-weight: 500;
}

/* Sections */
.public-profile__section {
  padding: 1.15rem 1.25rem 1.35rem;
  border-top: 1px solid var(--pp-border);
}

@media (min-width: 640px) {
  .public-profile__section {
    padding: 1.25rem 1.75rem 1.5rem;
  }
}

.public-profile__section-title {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pp-muted);
}

.public-profile__bio {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--pp-text);
  white-space: pre-line;
}

/* Stats */
.public-profile__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.65rem;
}

.public-profile__stat {
  padding: 0.85rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pp-border);
  background: var(--pp-subtle);
  text-align: center;
}

.public-profile__stat-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--pp-text);
  line-height: 1.2;
}

.public-profile__stat-value svg {
  width: 1.1rem;
  height: 1.1rem;
  color: #eab308;
  flex-shrink: 0;
}

.public-profile__review-star--empty {
  opacity: 0.22;
}

.public-profile__stat-label {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--pp-muted);
}

.public-profile__trust-line {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pp-muted);
  line-height: 1.45;
}

.public-profile__trust-line--after-stats {
  margin-top: 0.85rem;
}

/* Listings strip */
.public-profile__listings {
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .public-profile__listings {
    grid-template-columns: repeat(3, 1fr);
  }
}

.public-profile__listing {
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  border: 1px solid var(--pp-border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--pp-subtle);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.public-profile__listing:hover {
  border-color: rgb(15 90 86 / 35%);
  box-shadow: 0 6px 18px -12px rgb(15 90 86 / 45%);
}

.public-profile__listing-media {
  aspect-ratio: 4 / 3;
  background: var(--color-slate-200, #e2e8f0);
  overflow: hidden;
}

.dark .public-profile__listing-media {
  background: var(--color-dark-surface-raised, #262626);
}

.public-profile__listing-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-profile__listing-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pp-muted);
}

.public-profile__listing-placeholder svg {
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.55;
}

.public-profile__listing-title {
  padding: 0.55rem 0.65rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--pp-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Reviews */
.public-profile__reviews {
  display: grid;
  gap: 0.65rem;
}

.public-profile__review {
  padding: 0.85rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid var(--pp-border);
  background: var(--pp-subtle);
}

.public-profile__review-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.35rem;
}

.public-profile__review-stars {
  display: inline-flex;
  gap: 0.1rem;
  color: #eab308;
}

.public-profile__review-stars svg {
  width: 0.85rem;
  height: 0.85rem;
}

.public-profile__review-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pp-text);
}

.public-profile__review-spot {
  font-size: 0.7rem;
  color: var(--pp-muted);
}

.public-profile__review-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--pp-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes public-profile-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-profile__identity,
  .public-profile__avatar-wrap {
    animation: none;
  }
}
