/*
 * v4-people.css — /people in the v4 look: notes as cards, the conversation
 * as an app window, photos in a lightbox. Classes come from js/people.js.
 */

/* ---------- toolbar ---------- */

.people-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 28px;
    color: var(--v4-muted);
    font: 500 .88rem var(--v4-mono);
}
/* keeps its place while hidden, so the list doesn't jump when it appears */
.people-toolbar[hidden] { visibility: hidden; }
.people-toolbar label { display: inline-flex; align-items: center; gap: 8px; }
.people-toolbar select {
    padding: 7px 30px 7px 12px;
    border: 0;
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233c4b50' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
    box-shadow: var(--v4-shadow-card);
    color: #18262b;
    font: 600 .92rem var(--v4-font);
    appearance: none;
    cursor: pointer;
}

/* ---------- directory ---------- */

.people-directory,
.people-cta { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.people-directory { position: relative; }
.people-list[aria-busy="true"] { min-height: 480px; }
.people-status { position: absolute; padding: 30px 0; color: var(--v4-muted); font: 500 .9rem var(--v4-mono); }
.people-status[hidden] { display: none; }

.people-list { display: grid; gap: 18px; }

.people-row {
    display: grid;
    grid-template-columns: 64px minmax(170px, .55fr) minmax(0, 1.45fr) auto;
    align-items: center;
    gap: 18px 24px;
    padding: 20px 22px;
    border-radius: 20px;
    background: #fbfaf7;
    color: #18262b;
    box-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(24, 38, 43, .1), 0 20px 40px -28px rgba(10, 30, 40, .45);
    cursor: pointer;
    transition: transform .25s var(--v4-ease), box-shadow .25s ease;
}
.people-row:hover { transform: translateY(-3px); box-shadow: 0 1px 0 #fff inset, 0 0 0 1px rgba(24, 38, 43, .14), 0 30px 50px -26px rgba(10, 30, 40, .5); }
.people-row:focus-visible { outline: 3px solid var(--v4-yellow); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
    .people-row { animation: v4-rise .6s var(--v4-ease) both; animation-delay: calc(var(--people-i, 0) * 60ms); }
}

.people-avatar-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--v4-yellow-hi), var(--v4-yellow));
    box-shadow: 0 0 0 3px #fff, 0 6px 14px -6px rgba(0, 0, 0, .35);
    color: #18262b;
    font: 600 1.25rem var(--v4-font);
    overflow: hidden;
}
.people-avatar-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.people-avatar-wrap img[hidden] { display: none; }

.people-row-name { display: flex; align-items: center; gap: 6px; }
.people-row-name h3 { margin: 0; font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.people-row-identity p { margin: 4px 0 0; color: #5f6d70; font: 500 .82rem var(--v4-mono); }

.people-verified-badge { display: inline-grid; flex: 0 0 auto; width: 18px; height: 18px; }
.people-verified-badge svg { width: 100%; height: 100%; }

.people-row-center p { margin: 0; color: #3c4b50; font-size: 1.05rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.people-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; color: #5f6d70; font: 500 .78rem var(--v4-mono); }
.people-row-brands { display: flex; flex-wrap: wrap; gap: 6px; }

.people-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .12);
    color: #3c4b50;
    font: 500 .76rem var(--v4-mono);
}
.people-tag:not(:has(img)) { padding-left: 10px; }
.people-tag img { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px; object-fit: contain; }
.people-tag-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.people-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.people-votes { display: flex; }
.people-read { color: #18262b; font-weight: 600; white-space: nowrap; }
.people-row:hover .people-read { text-decoration: underline; text-decoration-color: var(--v4-yellow); text-decoration-thickness: 3px; text-underline-offset: 4px; }

.people-recommend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .14);
    color: #3c4b50;
    font: 600 .82rem var(--v4-mono);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.people-recommend:hover { transform: translateY(-1px); background: var(--v4-yellow-hi); }
.people-recommend[data-active="true"] { background: #dff6e7; box-shadow: 0 0 0 1.5px rgba(47, 158, 68, .5); color: #1f6b38; }

.people-empty { padding: 50px 20px; border-radius: 20px; background: #fbfaf7; box-shadow: var(--v4-shadow-card); color: #18262b; text-align: center; }
.people-empty strong { display: block; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; }
.people-empty span { display: block; max-width: 460px; margin: 8px auto 0; color: #5f6d70; line-height: 1.6; }

/* ---------- invite call to action ---------- */

.people-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 30px;
    margin-top: 50px;
    margin-bottom: 110px;
    padding-top: 30px;
    padding-bottom: 30px;
    border-radius: 24px;
    background: radial-gradient(120% 140% at 100% 0%, rgba(255, 194, 71, .35), transparent 60%), #fbfaf7;
    color: #18262b;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .1), 0 24px 44px -28px rgba(10, 30, 40, .45);
}
.people-cta > div { flex: 1 1 320px; }
.people-cta strong { display: block; font-size: 1.8rem; font-weight: 600; }
.people-cta span { display: block; max-width: 560px; margin-top: 6px; color: #5f6d70; line-height: 1.6; }
.people-cta-button {
    padding: 13px 24px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe39b, var(--v4-yellow) 55%, var(--v4-yellow-lo));
    box-shadow: 0 2px 0 rgba(255, 255, 255, .85) inset, 0 0 0 1.5px rgba(150, 85, 0, .45), 0 12px 24px -10px rgba(220, 140, 0, .7);
    color: #18262b;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform .2s var(--v4-ease);
}
.people-cta-button:hover { transform: translateY(-2px); }

/* ---------- the note: an app window ---------- */

.people-modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 20px; }
.people-modal[hidden] { display: none; }
.people-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(10, 18, 24, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; }

.people-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(230px, .62fr) minmax(0, 1.38fr);
    width: min(940px, 96vw);
    max-height: min(720px, 92vh);
    border-radius: 20px;
    background: #fbfaf7;
    color: #18262b;
    box-shadow: 0 0 0 1px rgba(24, 38, 43, .1), 0 50px 90px -40px rgba(0, 0, 0, .7);
    overflow: hidden;
}
.people-dialog:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
    .people-dialog { animation: v4-rise .35s var(--v4-ease) both; }
}

.people-dialog-close {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font: 600 1.2rem/1 var(--v4-font);
    cursor: pointer;
}
.people-dialog-close:hover { background: rgba(255, 255, 255, .26); }

.people-dialog-profile {
    position: relative;
    padding: 34px 26px 28px;
    border-right: 1px solid rgba(24, 38, 43, .1);
    background:
        linear-gradient(180deg, rgba(251, 250, 247, 0) 0, rgba(251, 250, 247, .9) 120px, #fbfaf7 170px),
        url('/assets/v4/art/meadow-720.webp') top / 100% auto no-repeat;
    padding-top: 110px;
}
.people-dialog-profile .people-avatar-wrap { width: 86px; height: 86px; margin-bottom: 16px; font-size: 1.6rem; }
.people-dialog-name-row { display: flex; align-items: center; gap: 8px; }
.people-dialog-name-row h2 { margin: 0; font-size: 1.8rem; font-weight: 600; line-height: 1.1; }
.people-dialog-profile > p { margin: 6px 0 0; color: #5f6d70; font: 500 .85rem var(--v4-mono); }
.people-dialog-period { color: #5f6d70 !important; }
.people-dialog-brandmarks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.people-dialog.is-missing .people-dialog-profile { background: #fbfaf7; padding-top: 34px; }

.people-thread { display: flex; flex-direction: column; min-width: 0; min-height: 460px; background: #fff; }
.people-thread-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 56px 0 18px;
    background: linear-gradient(180deg, #2a2d33, #222429);
    color: #b8bcc4;
    font: 500 .8rem var(--v4-mono);
}
.people-thread-tools { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.people-copy-link { padding: 4px 11px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #e9ece8; font: 500 .76rem var(--v4-mono); cursor: pointer; white-space: nowrap; }
.people-copy-link:hover { background: rgba(255, 255, 255, .2); }
.people-copy-link[hidden] { display: none; }

.people-messages { display: flex; flex-direction: column; gap: 16px; padding: 26px 24px 30px; overflow: auto; }

.people-message { max-width: 86%; padding: 14px 16px 13px; border-radius: 18px 18px 18px 6px; background: #f1ede4; }
.people-message[data-author="romka"] { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: linear-gradient(180deg, #ffe7a6, #ffd56e); }
.people-message-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 6px; color: #5f6d70; font: 600 .72rem var(--v4-mono); text-transform: uppercase; letter-spacing: .03em; }
.people-message p { margin: 0; color: #18262b; font-size: 1.05rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

.people-message--image { padding: 8px; max-width: min(86%, 460px); }
.people-attachment { display: block; padding: 0; border: 0; border-radius: 12px; background: none; overflow: hidden; cursor: zoom-in; }
.people-attachment img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: #e9e5dc; }

.people-message--notice { max-width: 100%; background: #fbfaf7; box-shadow: 0 0 0 1px rgba(24, 38, 43, .1); }
.people-message--notice p { margin-bottom: 14px; }
.people-back { padding: 9px 16px; border: 0; border-radius: 999px; background: var(--v4-yellow); color: #18262b; font: 600 .95rem var(--v4-font); cursor: pointer; }

/* ---------- lightbox ---------- */

.people-lightbox { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 30px; }
.people-lightbox[hidden] { display: none; }
.people-lightbox-backdrop { position: absolute; inset: 0; border: 0; background: rgba(8, 10, 14, .9); cursor: zoom-out; }
.people-lightbox img { position: relative; z-index: 1; max-width: min(94vw, 1500px); max-height: 90vh; border-radius: 12px; object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.people-lightbox-close { position: fixed; z-index: 2; top: 18px; right: 20px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font: 600 1.4rem/1 var(--v4-font); cursor: pointer; }

/* ---------- smaller screens ---------- */

@media (max-width: 860px) {
    .people-row { grid-template-columns: 52px minmax(0, 1fr); gap: 12px 14px; padding: 18px; }
    .people-row .people-avatar-wrap { width: 52px; height: 52px; font-size: 1.05rem; }
    .people-row-center,
    .people-row-actions { grid-column: 1 / -1; }
    .people-row-actions { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (max-width: 760px) {
    .people-directory,
    .people-cta { padding-left: 16px; padding-right: 16px; }
    .people-cta { margin-left: 16px; margin-right: 16px; padding: 22px 18px; }
    .people-modal { padding: 8px; }
    .people-dialog { grid-template-columns: 1fr; max-height: calc(100dvh - 16px); overflow-y: auto; }
    .people-dialog-profile {
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr);
        column-gap: 14px;
        align-items: center;
        padding: 22px 56px 18px 18px;
        border-right: 0;
        border-bottom: 1px solid rgba(24, 38, 43, .1);
        background: #fbfaf7;
    }
    .people-dialog-profile .people-avatar-wrap { grid-row: 1 / span 3; width: 60px; height: 60px; margin: 0; font-size: 1.2rem; }
    .people-dialog-profile > :not(.people-avatar-wrap) { grid-column: 2; }
    .people-dialog-name-row h2 { font-size: 1.4rem; }
    .people-dialog-brandmarks { grid-column: 1 / -1 !important; margin-top: 12px; }
    .people-dialog-close { background: rgba(24, 38, 43, .08); color: #18262b; }
    .people-thread { min-height: 0; }
    .people-messages { padding: 18px 14px 22px; overflow: visible; }
    .people-message { max-width: 94%; }
}

.people-avatar-wrap[hidden] { display: none !important; }
