/*
 * People, organizations, workgroups, profile pictures, languages, and credit,
 * inside the team area: the Directory, profiles, My Account, Settings >
 * Organizations and Workgroups, and the badges other pages use. Colors come
 * from site.css's tokens; a badge's own color is drawn in its SVG, never in a
 * style attribute, so the strict Content Security Policy is met.
 */

/* ---------- Pictures and initials ---------- */
.pp-avatar { flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
svg.pp-avatar text { font-family: var(--display); letter-spacing: .02em; }
.person-inline { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; min-height: 36px; }
.person-inline > span { display: inline-flex; flex-direction: column; line-height: 1.25; }
.person-inline > span .pill { align-self: flex-start; margin-top: .15rem; }
a.person-inline:hover strong, a.person-inline:hover > span { text-decoration: underline; text-underline-offset: .18em; }
.picture-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.picture-row > div { flex: 1 1 220px; min-width: 0; }
.credit-row { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Badges: organizations and workgroups ---------- */
.pp-tile { flex: none; vertical-align: middle; border-radius: 6px; }
.org-badge, .wg-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; line-height: 1.3; max-width: 100%; vertical-align: middle; }
/* break-word, not anywhere: a name wraps between words, and a column of badges never narrows to a few letters. */
.org-badge-name, .wg-badge-name { overflow-wrap: break-word; min-width: 0; }
.org-none { color: var(--ink-soft); font-weight: 400; }
.wg-badge { font-size: .9rem; background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem .1rem .2rem; margin: 0 .2rem .25rem 0; }
.partner-mark { display: inline-flex; align-items: center; gap: .25rem; color: var(--ok); font-size: .9rem; font-weight: 700; }
.partner-mark .ui-icon { width: 1.05em; height: 1.05em; }
.org-cell { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.org-cell > span { display: flex; flex-direction: column; line-height: 1.3; }
a.org-cell:hover strong { text-decoration: underline; text-underline-offset: .18em; }
.org-logo { flex: none; object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.badge-link { text-decoration: none; color: inherit; margin-right: .5rem; }
.badge-link:hover .org-badge-name { text-decoration: underline; }

/* ---------- Languages ---------- */
.lang-level { display: inline-flex; align-items: center; gap: .3rem; font-size: .88rem; background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; margin: 0 .2rem .25rem 0; white-space: nowrap; max-width: 100%; }
@media (max-width: 480px) { .lang-level { white-space: normal; flex-wrap: wrap; } }
.lang-level-name { font-weight: 700; color: var(--ink-soft); }
.lang-level.lv-native .lang-level-name, .lang-level.lv-fluent .lang-level-name { color: var(--ok); }
.lang-list { list-style: none; padding: 0; margin: .5rem 0; }
.lang-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lang-list li:last-child { border-bottom: 0; }
.lang-list-plain li { display: block; }
.lang-list-plain .small { display: block; margin-top: .1rem; }
.level-choices .check { margin-bottom: .4rem; }

/* ---------- The explanation of organizations and workgroups ---------- */
.explain { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1.2rem; max-width: 62rem; }
.explain h2 { display: flex; align-items: center; gap: .35rem; font-size: 1.05rem; margin: 0 0 .35rem; }
.explain p { margin: 0 0 .4rem; font-size: .97rem; }
.explain .explain-roles { color: var(--ink-soft); margin: 0; }
/* Folded (the team area's folding pattern): the summary and body carry the padding. */
.explain.fold { padding: 0; }
.explain.fold .fold-title { margin: 0; font-size: 1.05rem; }
.explain.fold .fold-body p:first-child { margin-top: .8rem; }

/* ---------- The Directory ---------- */
.people-tabs { margin-top: .4rem; }
/* On a phone the tabs sit a little closer together and wrap to a second line when they do not fit, as every row of
   tabs does (Archive, the Switchboard), so none is ever cut off at the screen's edge. */
@media (max-width: 520px) {
  .people-tabs { gap: 2px; }
  .people-tabs .tab { padding-inline: .55rem; }
}
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: .6rem 1rem; margin: 0 0 .5rem; }
.list-head > p { margin: 0; }
.people-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem .8rem; }
.people-filter .field { margin: 0; min-width: 0; flex: 1 1 160px; }
.people-filter .btn-row { margin: 0; }
.people-table th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; min-height: 28px; }
.people-table th a:hover { text-decoration: underline; }
.people-table th[aria-sort] a { color: var(--brand-deep); }
.people-table td { vertical-align: middle; }
.people-table td[data-label="Name"] { min-width: 10rem; }
.people-table td[data-label="Organization"] { min-width: 9.5rem; }
.people-table td[data-label="Languages"] { min-width: 10rem; }
.people-table td[data-label="Workgroups"] { min-width: 9.5rem; }
.wg-desc { max-width: 46em; }
.roles-explained { margin-top: 1.4rem; }
.roles-explained > summary { cursor: pointer; }
.roles-explained > summary h2 { display: inline; font-size: 1.2rem; }
.roles-explained[open] > summary { margin-bottom: .6rem; }

/* On phones each row becomes a small card, with the column names written in. */
@media (max-width: 700px) {
  .people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .people-table, .people-table tbody, .people-table tr, .people-table td { display: block; width: 100%; }
  .people-table tr { border-bottom: 1px solid var(--line); padding: .5rem .2rem; }
  .people-table tr:last-child { border-bottom: 0; }
  .people-table td { border: 0; padding: .2rem .6rem; text-align: left; }
  .people-table td.num { text-align: left; }
  .people-table td[data-label]:not([data-label="Name"]):not([data-label="Organization"]):not([data-label="Workgroup"])::before { content: attr(data-label); margin-right: .45rem; font-weight: 600; color: var(--ink-soft); font-size: .88rem; } /* the label alone, without a colon */
}

/* ---------- Profiles ---------- */
.profile-head { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; align-items: flex-start; margin-bottom: 1rem; }
.profile-head > div:not(.profile-actions) { flex: 1 1 240px; min-width: 0; }
.profile-head h1 { margin: 0 0 .25rem; }
.profile-head p { margin: 0 0 .35rem; }
.profile-head .profile-pronouns { margin-top: -.1rem; }
.profile-desc { max-width: 52em; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.profile h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
.person-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem 1rem; }

/* ---------- My Account ---------- */
.org-readonly .label { font-weight: 700; margin: 0 0 .2rem; }
.request-box { margin: .6rem 0; }
.request-box > summary { list-style: none; display: inline-flex; }
.request-box > summary::-webkit-details-marker { display: none; }
.request-box[open] > summary { margin-bottom: .6rem; }
.request-form { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; background: var(--sunk); }
.request-sent { border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--card)); padding: .6rem .9rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: .6rem; }
.request-sent p, .request-sent ul { margin: 0 0 .3rem; }

/* ---------- Settings forms ---------- */
.pp-icon-editor .icon-preview { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.logo-now { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.partner-field .check { margin-bottom: .5rem; }
.partner-field .partner-mark { vertical-align: middle; }

/* ---------- Credit in the alert form ---------- */
.credit-choices { display: grid; gap: .2rem; }
.credit-other { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.credit-other select { flex: 1 1 220px; max-width: 26rem; }
.credit-line { display: inline-flex; align-items: center; gap: .3rem; }

@media print { .request-box, .profile-actions { display: none; } }

/* Roles and Permissions: each role lists its permissions by name, and each permission is explained once below. */
.perm-list a { color: inherit; }
.perm-head { margin-top: 1.4rem; }
.perm-group { margin: 1.2rem 0 .2rem; padding-bottom: .2rem; font-size: 1.05rem; color: var(--brand-deep); border-bottom: 1px solid var(--line); max-width: 60rem; }
.perm-defs { margin: 0; }
.perm-defs dt { font-weight: 700; margin-top: .5rem; scroll-margin-top: 1rem; }
.perm-defs dd { margin: .1rem 0 0; color: var(--ink-soft); font-size: .92rem; max-width: 60rem; }
.person-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
