/*
    Public Profile — SC Design System styling (no dedicated Figma node;
    built from DS tokens). One stylesheet, two roots:
      .pp.pp--desktop  → PublicProfileDesktop view
      .pp.pp--mobile   → PublicProfileMobile view
    Tokens: Inter; Brand/600 #465DA6, Brand/700 #5E69A8, Brand/50 #EBF1FF,
    Brand/25 #F6F9FF; Gray/900 #181D27, Gray/700 #414651, Gray/600 #535862,
    Gray/300 #D5D7DA, Gray/200 #E9EAEB, Gray/100 #F5F5F5. Spacing 4..64,
    radius 8/12, desktop content 1216 (32 gutter), mobile 16 gutter.
*/

.pp {
    font-family: 'Inter', sans-serif;
    color: #535862;
    background: #FFFFFF;
}
.pp * { box-sizing: border-box; }

/* Desktop / Mobile roots render together; CSS toggles per viewport
   (same 768px breakpoint as the other migrated desktop/mobile pairs). */
.pp--desktop { display: block; }
.pp--mobile  { display: none; }
@media (max-width: 768px) {
    .pp--desktop { display: none; }
    .pp--mobile  { display: block; }
}

.pp__container { width: 100%; margin: 0 auto; }
.pp--desktop .pp__container { max-width: 1280px; padding: 48px 32px; }
.pp--mobile  .pp__container { max-width: 100%; padding: 24px 16px; }

/* ── Header ─────────────────────────────────────────────── */
.pp__header { width: 100%; }
.pp--desktop .pp__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #E9EAEB;
}
.pp--mobile .pp__header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E9EAEB;
}

.pp__identity { display: flex; gap: 24px; align-items: flex-start; }
.pp--mobile .pp__identity { gap: 16px; }
.pp__avatar {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: #F5F5F5;
}
.pp--desktop .pp__avatar { width: 120px; height: 120px; }
.pp--mobile  .pp__avatar { width: 80px; height: 80px; }

.pp__info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pp__name {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #181D27;
}
.pp--desktop .pp__name { font-size: 30px; line-height: 38px; }
.pp--mobile  .pp__name { font-size: 24px; line-height: 32px; }
.pp__name img { height: 22px; width: auto; vertical-align: middle; }
.pp__role { margin: 0; font-size: 16px; line-height: 24px; color: #414651; font-weight: 500; }
.pp__bio { margin: 0; font-size: 16px; line-height: 24px; color: #535862; }

.pp__achievements { margin-top: 4px; }

.pp__follow {
    align-self: flex-start;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #465DA6;
    background: #465DA6;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease;
}
.pp__follow:hover { background: #384A85; border-color: #384A85; color: #FFFFFF; }
.pp__follow.following { background: #FFFFFF; color: #465DA6; }
.pp__follow.following:hover { background: #EBF1FF; color: #465DA6; }

/* Preferred-category chips */
.pp__chips { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; }
.pp--mobile .pp__chips { gap: 8px; }
.pp__chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    background: #EBF1FF;
    color: #5E69A8;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.pp__chip:hover { background: #DADFED; color: #384A85; }

/* Followers */
.pp__followers { padding-top: 24px; }
.pp__followers-title {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #414651;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pp__followers-row { display: flex; flex-wrap: wrap; gap: -8px; }
.pp__follower-av {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #FFFFFF;
    margin-right: -8px;
    background-color: #F5F5F5;
}

/* About */
.pp__about-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    color: #181D27;
}
.pp__about {
    font-size: 16px;
    line-height: 24px;
    color: #535862;
}
.pp__about--empty { color: #717680; font-size: 14px; }

/* ── Tabs ───────────────────────────────────────────────── */
.pp__tabs { width: 100%; padding-top: 32px; }
.pp__tablist {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #E9EAEB;
    margin-bottom: 24px;
}
.pp__tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    color: #717680;
    cursor: pointer;
    text-decoration: none;
    flex: 1 1 auto;
    text-align: center;
}
.pp__tab:hover { color: #465DA6; }
.pp__tab.active { color: #465DA6; border-bottom-color: #465DA6; }

.pp__panel { padding-bottom: 40px; }
.pp__courses-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pp--mobile .pp__courses-grid,
.pp--desktop .pp__courses-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .pp__courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .pp__courses-grid { grid-template-columns: 1fr; } }

/* Badges (carried from original achievements widget) */
.pp .badge-item { display: inline-block; text-align: center; margin-right: 6px; margin-bottom: 6px; cursor: pointer; transition: transform .2s ease; }
.pp .badge-item:hover { transform: scale(1.1); }
.pp .badge-item img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; border: 2px solid #79B59B; padding: 2px; background: #F5FAF9; }
@keyframes ppBadgePop { 0% { transform: scale(1);} 30% { transform: scale(1.25);} 60% { transform: scale(.95);} 100% { transform: scale(1);} }
.pp .badge-item.pop { animation: ppBadgePop .4s ease; }
@keyframes ppAchFade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }
.pp .achievements-fade-in { animation: ppAchFade .4s ease; }
