/* Profile demo (/profile-demo): the working Classic profile, before it replaces profilev2. */

.pd-page {
    padding-top: 20px;
    --navy: #0d2b52;
    --yellow: #EFDC75;
    --ink: #111;
    --muted: #5b6573;
    --line: #e2e2e2;
    --hard: 4px 4px 0 #000;
    /* width comes from .main-board, same as the home page and old profile */
    padding-bottom: 40px;
}
.pd-page *, .pd-page *::before, .pd-page *::after { box-sizing: border-box; letter-spacing: normal; }
.pd-root .board { width: 100%; max-width: none; margin: 0; padding: 22px; }

/* ---------- demo bar ---------- */
.pd-switch-wrap { padding: 14px 0 10px; }
.pd-switch {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    background: #fff; border: 3px solid #000; box-shadow: var(--hard); padding: 8px;
}
.pd-switch-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; padding: 0 8px; }
.pd-tab {
    font: inherit; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    background: #fff; color: #000; border: 2px solid #000; padding: 7px 12px; cursor: pointer;
}
.pd-tab:hover { background: #f0f0f0; }
.pd-tab.is-active { background: var(--navy); color: var(--yellow); }
.pd-note { margin: 8px 2px 0; font-size: 12px; color: var(--muted); }
.pd-load { display: flex; gap: 6px; margin-left: auto; }
.pd-load input { font: inherit; font-size: 13px; padding: 6px 10px; border: 2px solid #000; width: 240px; max-width: 100%; letter-spacing: 0; }
.pd-load button { font: inherit; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; background: var(--yellow); border: 2px solid #000; padding: 6px 12px; cursor: pointer; }

/* ---------- shared pieces ---------- */
.pd-root { color: var(--ink); font-size: 15px; line-height: 1.55; }
.pd-root p { margin: 0 0 10px; }
.pd-name { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 28px; line-height: 1.15; font-weight: 800; }
.pd-tick {
    display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none;
    background: var(--navy); color: var(--yellow); border-radius: 50%; font-size: 12px; font-weight: 800;
}
.pd-name .pd-tick { width: 24px; height: 24px; font-size: 14px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0 !important; font-size: 13px; color: var(--muted); }
.pd-meta span + span::before { content: "·"; margin-right: 14px; }

.pd-avatar {
    display: grid; place-items: center; flex: none;
    width: 72px; height: 72px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2b5a94, var(--navy));
    color: var(--yellow); font-weight: 800; font-size: 24px; border: 3px solid #000;
}
.pd-avatar-xl { width: 150px; height: 150px; font-size: 48px; border-width: 4px; }
.pd-avatar-img { overflow: hidden; background: #fff; }
.pd-avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pd-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border: 2px solid #000; background: var(--yellow); }
.pd-chip-icon { display: inline-flex; align-items: center; gap: 6px; background: #fff; padding: 4px 10px 4px 6px; }
.pd-chip-icon svg { width: 18px; height: 18px; flex: none; }
.pd-chip-icon svg title { display: none; }

.pd-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-actions .button { margin: 6px 10px 6px 0; font-size: 14px; letter-spacing: 2px; background: #fff; text-decoration: none; display: inline-block; }
.pd-root .pd-cta, .pd-modal .pd-cta { background: var(--yellow); }
.pd-actions .button:disabled { opacity: .6; cursor: default; }

.pd-sec + .pd-sec { margin-top: 26px; }
.pd-h {
    display: block; margin: 0 0 14px; font-size: 13px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px; color: var(--navy);
}
.pd-h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pd-h-row .pd-h { margin: 0; }
.pd-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy); text-decoration: underline; cursor: pointer; }
.pd-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.pd-fine { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.pd-text { white-space: pre-line; }
.pd-empty { margin: 0; font-size: 13px; color: var(--muted); }

.pd-stats { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); border: 2px solid #000; background: #fff; }
.pd-stats > div { padding: 14px 10px; text-align: center; }
.pd-stats > div + div { border-left: 2px solid #000; }
.pd-stats b { display: block; font-size: 24px; font-weight: 800; color: var(--navy); }
.pd-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

.pd-platforms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pd-platforms li { list-style: none; }
.pd-platform { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid #000; background: #fff; }
a.pd-platform { color: inherit; text-decoration: none; transition: transform .1s, box-shadow .1s; }
a.pd-platform:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 #000; }
.pd-pbadge {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none;
    font-size: 12px; font-weight: 800; color: #fff; background: #333;
}
.pd-picon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; }
.pd-picon svg { width: 30px; height: 30px; display: block; }
.pd-pinfo { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pd-pinfo b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pd-pinfo .pd-tick { width: 16px; height: 16px; font-size: 10px; }
.pd-pinfo small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-pcount { font-weight: 800; font-size: 16px; }

.pd-audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pd-bars-title { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.pd-bar { display: grid; grid-template-columns: 1fr 1.3fr 38px; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 5px; }
.pd-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-bar b { text-align: right; }
.pd-bar-track { height: 8px; background: #e8e8e8; border: 1px solid #000; }
.pd-bar-track div { height: 100%; background: var(--navy); }

.pd-rates { width: 100%; border-collapse: collapse; font-size: 14px; }
.pd-rates td { padding: 8px 0; border-bottom: 1px dashed #bbb; }
.pd-rates td:last-child { text-align: right; font-weight: 800; }

.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-tags span { font-size: 13px; padding: 4px 10px; background: #fff; border: 1px solid #000; }

.pd-exp, .pd-campaigns { list-style: none; margin: 0; padding: 0; }
.pd-exp li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pd-exp b { font-size: 14px; }
.pd-exp span { grid-column: 1; font-size: 13px; color: var(--muted); }
.pd-exp em { grid-row: 1; grid-column: 2; font-style: normal; font-size: 12px; font-weight: 700; color: var(--navy); }
.pd-campaigns li { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pd-campaigns b { font-size: 14px; }
.pd-campaigns span { font-size: 13px; color: var(--muted); }

.pd-reviews { display: grid; gap: 12px; }
.pd-review { background: #fff; border: 2px solid #000; padding: 12px 14px; }
.pd-review header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.pd-review p { font-size: 14px; margin: 0 0 6px; white-space: pre-line; }
.pd-review small { font-size: 12px; color: var(--muted); }
.pd-stars { color: #e0a800; font-size: 15px; white-space: nowrap; }
.pd-stars-off { color: #ccc; }

/* Posts: photos fill the tile; text-only posts get a coloured tone */
.pd-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pd-post {
    position: relative; margin: 0; aspect-ratio: 4 / 5; border: 2px solid #000; overflow: hidden;
    display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
    background: var(--tone); background-size: cover; background-position: center;
}
.pd-post[role="button"] { cursor: pointer; transition: transform .1s, box-shadow .1s; }
.pd-post[role="button"]:hover, .pd-post[role="button"]:focus-visible { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 #000; }
.pd-post::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 75% 25%, rgba(255,255,255,.35), transparent 40%), linear-gradient(transparent 45%, rgba(0,0,0,.55));
}
.pd-post-photo::before { background: linear-gradient(transparent 55%, rgba(0,0,0,.6)); }
.pd-post-format {
    position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    background: #000; color: #fff; padding: 2px 7px;
}
.pd-post figcaption { position: relative; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.pd-post figcaption span { font-size: 13px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.pd-post-photo figcaption span { -webkit-line-clamp: 2; }
.pd-post figcaption small { font-size: 12px; opacity: .9; }
.pd-tone-sunrise { --tone: linear-gradient(160deg, #ffb37a, #e8577a); }
.pd-tone-forest { --tone: linear-gradient(160deg, #6fae6a, #1f4d34); }
.pd-tone-navy { --tone: linear-gradient(160deg, #3d6fae, #0d2b52); }
.pd-tone-berry { --tone: linear-gradient(160deg, #c45ab3, #5b2a86); }
.pd-tone-ocean { --tone: linear-gradient(160deg, #5fd3e0, #1167a8); }
.pd-tone-sand { --tone: linear-gradient(160deg, #e9cf98, #b0814a); }
.pd-tone-dusk { --tone: linear-gradient(160deg, #f08a5d, #4a3c7a); }
.pd-tone-gold { --tone: linear-gradient(160deg, #f6e27f, #d4911e); }
.pd-tone-mint { --tone: linear-gradient(160deg, #a8e6cf, #2f8f7a); }

/* ---------- header: banner, picture and the essentials ---------- */
.pd-banner {
    position: relative; height: 280px; border: 2px solid #000; overflow: hidden;
    background:
        radial-gradient(circle at 15% 30%, rgba(255,255,255,.7) 1px, transparent 2px) 0 0 / 60px 60px,
        radial-gradient(circle at 60% 70%, rgba(255,255,255,.5) 1px, transparent 2px) 0 0 / 90px 90px,
        linear-gradient(120deg, #0d2b52, #1d4f8c 60%, #2b6aa8);
}
.pd-banner-img { background-size: cover; background-position: center; }
.pd-planet {
    position: absolute; right: 8%; top: 50%; width: 120px; height: 120px; transform: translateY(-50%);
    border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, var(--yellow) 45%, #c9a92f);
}
.pd-planet::after {
    content: ""; position: absolute; left: -30%; top: 38%; width: 160%; height: 24%;
    border: 4px solid rgba(239,220,117,.85); border-radius: 50%; transform: rotate(-18deg);
}
.pd-root .pd-head { padding: 14px; margin-bottom: 22px; }
.pd-head-row { display: flex; align-items: flex-end; gap: 24px; padding: 0 16px 8px; }
.pd-head-avatar { margin-top: -80px; position: relative; z-index: 1; }
.pd-head-id { flex: 1; min-width: 0; padding-top: 16px; }
.pd-head-id .pd-name { font-size: 32px; }
.pd-head-tag { margin: 6px 0 0 !important; font-size: 16px; }
.pd-head .pd-actions { flex: none; padding-bottom: 4px; }

/* Owner: picture and banner can be clicked to change */
.pd-editable { cursor: pointer; }
.pd-change {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
    background: rgba(0,0,0,.5); color: #fff; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    opacity: 0; transition: opacity .15s; border-radius: inherit; text-align: center; padding: 8px;
}
.pd-avatar.pd-editable { position: relative; overflow: hidden; }
.pd-editable:hover .pd-change, .pd-editable:focus-visible .pd-change { opacity: 1; }
@media (hover: none) {
    .pd-banner.pd-editable .pd-change { opacity: 1; inset: auto 8px 8px auto; padding: 4px 10px; border-radius: 0; }
}

/* ---------- body: stats, then two columns ---------- */
.pd-c-cols { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; margin-top: 22px; align-items: start; }

/* ---------- editing ---------- */
.pd-editing-note { margin: 0 0 16px; padding: 10px 14px; background: #fffbe6; border: 2px solid #000; font-size: 14px; }
.pd-edit {
    display: block; width: 100%; min-height: 90px; resize: vertical;
    font: inherit; font-size: 14px; line-height: 1.5; padding: 10px 12px; border: 2px solid #000; background: #fff;
}
.pd-edit::placeholder { color: #888; }
.pd-stats b { overflow-wrap: anywhere; }
.pd-pick-help { margin: -6px 0 14px; }
.pd-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 18px; }
.pd-pick-opt {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
    font: inherit; padding: 9px 12px; background: #fff; border: 2px solid #000; cursor: pointer; color: #000;
}
.pd-pick-opt b { font-size: 13px; }
.pd-pick-opt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pd-pick-opt:hover:not(:disabled) { background: #f6f6f6; }
.pd-pick-opt.is-on { background: var(--yellow); padding-right: 40px; }
.pd-pick-opt.is-on small { color: #333; }
.pd-pick-opt:disabled { cursor: default; opacity: .45; }
.pd-pick-n {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--navy); color: var(--yellow); font-size: 12px; font-weight: 800;
}
.pd-pick-preview { margin-bottom: 8px; }
.button.pd-mini { margin: 0 4px 4px 0; padding: 4px 10px; font-size: 12px; background: var(--yellow); }

/* ---------- modals ---------- */
.orbit-modal.pd-modal-wrap.hidden { display: none; }
.pd-modal-wrap { padding: 16px; z-index: 1000; }
body.pd-modal-open { overflow: hidden; }
.pd-modal {
    width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    color: var(--ink); font-size: 15px; line-height: 1.5;
}
.pd-modal *, .pd-modal *::before, .pd-modal *::after { box-sizing: border-box; letter-spacing: normal; }
.pd-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 2px solid #000; }
.pd-modal-head > span { display: flex; flex-direction: column; }
.pd-modal-head small { font-size: 12px; color: var(--muted); }
.pd-x { background: none; border: 0; font-size: 18px; font-weight: 800; cursor: pointer; padding: 2px 6px; line-height: 1; }
.pd-modal-scroll { padding: 16px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.pd-modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 18px 16px; border-top: 2px solid #000; }
.pd-modal-foot .button { margin: 0 4px 4px 0; font-size: 14px; background: #fff; }
.pd-modal-foot .pd-cta { background: var(--yellow); }
.pd-modal .button:disabled { opacity: .6; cursor: default; }

.pd-crop-body { height: min(60vh, 420px); background: #222; }
.pd-crop-body img { display: block; max-width: 100%; }
.pd-compose-photo { margin-top: 12px; border: 2px solid #000; }
.pd-compose-photo img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #f4f4f4; }

.pd-post-full { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: #f4f4f4; border: 2px solid #000; margin-bottom: 12px; }
.pd-post-text { font-size: 15px; }
.pd-post-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 8px; }
.pd-like { font: inherit; font-size: 15px; font-weight: 800; background: #fff; border: 2px solid #000; padding: 4px 12px; cursor: pointer; color: #000; }
.pd-like.is-liked { background: #e8577a; color: #fff; }
.pd-like:disabled { cursor: default; opacity: .7; }
.pd-danger { color: #b3261e; }
.pd-likers ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.pd-likers a { color: var(--navy); font-weight: 700; }
.pd-likers .pd-empty { margin-top: 12px; }

.pd-sort { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 700; }
.pd-sort select { font: inherit; font-size: 13px; padding: 4px 8px; border: 2px solid #000; background: #fff; }
.pd-star-row { display: flex; gap: 4px; margin: 10px 0 14px; }
.pd-star-row button { background: none; border: 0; padding: 0 2px; font-size: 34px; line-height: 1; color: #ccc; cursor: pointer; }
.pd-star-row button.is-on { color: #e0a800; }

.pd-private { text-align: center; padding: 48px 24px !important; }
.pd-private .pd-name { justify-content: center; margin-bottom: 10px; }
.pd-private .pd-actions { justify-content: center; margin-top: 16px; }

/* ---------- filler (sample content standing in for missing profile details) ---------- */
.pd-fill { position: relative; outline: 2px dashed #c9a92f; outline-offset: 4px; }
.pd-fill::after {
    content: "Filler"; position: absolute; top: -12px; right: -6px; z-index: 2;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    background: var(--yellow); color: #000; border: 1px solid #000; padding: 1px 6px; pointer-events: none;
}
.pd-chips.pd-fill, .pd-stats.pd-fill, .pd-platforms.pd-fill, .pd-posts.pd-fill { margin-top: 18px; }
p.pd-fill { display: block; }
.pd-post.pd-fill { outline-offset: -8px; }
.pd-post.pd-fill::after { top: 6px; right: 6px; }
.pd-filler-btn:not(.is-active) { background: #fff; color: #000; }
.pd-stats > .pd-fill { outline-offset: -6px; }
.pd-stats > .pd-fill::after { top: 4px; right: 4px; }
.pd-meta .pd-fill { outline-offset: 2px; outline-width: 1px; }
.pd-meta .pd-fill::after { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .pd-c-cols { grid-template-columns: minmax(0, 1fr); }
    .pd-audience { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .pd-head-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 4px 6px; }
    .pd-head-avatar { margin-top: -60px; width: 110px; height: 110px; font-size: 36px; }
    .pd-head-id { padding-top: 0; }
    .pd-head-id .pd-name { font-size: 26px; }
}
@media (max-width: 640px) {
    .pd-root .board { padding: 16px; }
    .pd-switch-wrap { padding-top: 8px; }
    .pd-switch { gap: 4px; padding: 6px; }
    .pd-tab { padding: 6px 8px; font-size: 11px; letter-spacing: 0; }
    .pd-load { margin-left: 0; width: 100%; }
    .pd-load input { flex: 1; width: auto; }
    .pd-name { font-size: 24px; }
    .pd-banner { height: 140px; }
    .pd-planet { width: 56px; height: 56px; }
    .pd-stats { grid-template-columns: 1fr 1fr; }
    .pd-stats > div + div { border-left: 0; }
    .pd-stats > div:nth-child(even) { border-left: 2px solid #000; }
    .pd-stats > div:nth-child(n+3) { border-top: 2px solid #000; }
    .pd-stats b { font-size: 20px; }
    .pd-posts { grid-template-columns: 1fr 1fr; }
    .pd-modal-wrap { padding: 8px; }
    .pd-modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
}
.pd-pick-count { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

/* Placeholder until the profile loads: the server puts the name and about text here for search engines */
.pd-root .pd-seo { text-align: left; min-height: 200px; }
.pd-seo h2 { display: block; margin: 0 0 10px; font-size: 28px; font-weight: 800; }
.pd-seo p { color: var(--muted); }
.pd-seo p:empty { display: none; }

/* Same side gaps as the old profile page (#profile-top: 80px each side), smaller on narrow screens */
.main-board.pd-page { padding-left: 80px; padding-right: 80px; box-sizing: border-box; }
@media (max-width: 1100px) { .main-board.pd-page { padding-left: 2.5%; padding-right: 2.5%; } }
@media (max-width: 768px) { .main-board.pd-page { padding-left: 0; padding-right: 0; } }

/* Pop-ups: the site stylesheet is loaded again after this one, so its generic .board rules
   (95% width, 30px padding) would win — these selectors are specific enough to beat it */
.pd-modal-wrap > .board.pd-modal {
    width: min(560px, 100%); max-width: 100%; margin: 0; padding: 0;
}
.pd-modal-wrap .pd-modal-foot .button.pd-cta { background: var(--yellow); }
/* The crop window is opened from the New post window, so it sits on top of it */
#pd-crop-modal { z-index: 1010; }
.pd-modal .pd-edit:focus { top: 0; left: 0; }
/* Pop-ups sit outside .pd-page, so they need the colours too */
.pd-modal-wrap {
    --navy: #0d2b52; --yellow: #EFDC75; --ink: #111; --muted: #5b6573; --line: #e2e2e2; --hard: 4px 4px 0 #000;
}
