/* Profile activity (26 Oct 2026): the Activity cards on a candidate's profile
   (candidate/public-profile, candidate/_activity-card) and the full posts on
   the profile's Posts page (candidate/profile-posts). One sheet, so the two
   read as one design. Tokens live on .cpa; candidate-dark.css redefines them.

   Images are sized with two classes: a global img[loading="lazy"] rule sets
   width/height to auto at (0,1,1) and would otherwise win. */
.cpa {
    --cpa-ink: rgba(0, 0, 0, .9);
    --cpa-mid: rgba(0, 0, 0, .75);
    --cpa-mute: rgba(0, 0, 0, .6);
    --cpa-line: #e4e4e4;
    --cpa-line-soft: #ededed;
    --cpa-surface: #ffffff;
    --cpa-fill: #f3f6f8;
    --cpa-blue: #0a66c2;
    --cpa-tint: rgba(10, 102, 194, .08);
}

/* ---- Activity: a row of post cards on the profile ---- */
.cpa-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}
.cpa-grid > li { display: flex; min-width: 0; }

.cpa-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--cpa-line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--cpa-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cpa-card:hover {
    border-color: var(--cpa-blue);
    box-shadow: 0 4px 14px rgba(10, 102, 194, .12);
    color: inherit;
    text-decoration: none;
}
.cpa-card:focus-visible { outline: 2px solid var(--cpa-blue); outline-offset: 2px; }

.cpa .cpa-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--cpa-fill);
    overflow: hidden;
}
.cpa .cpa-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cpa .cpa-card__media--video {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cpa-blue);
    font-size: 30px;
}

.cpa-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px 14px;
}
.cpa-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: var(--cpa-mute);
}
.cpa-card__meta i { font-size: 14px; }
.cpa-card__title,
.cpa-card__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.cpa-card__title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cpa-ink);
    -webkit-line-clamp: 2;
}
.cpa-card__text {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cpa-mid);
    white-space: pre-line;
    -webkit-line-clamp: 3;
}
/* No picture: the words take the picture's place, on a tint. */
/* It grows to the row's height (the cards are stretched to the tallest), so
   a card of words has no gap under its meta line. */
.cpa .cpa-card__media--text {
    display: flex;
    align-items: flex-start;
    flex: 1 0 auto;
    aspect-ratio: auto;
    min-height: 130px;
    padding: 14px 16px;
    background: var(--cpa-tint);
}
.cpa-card--words .cpa-card__body { flex: 0 0 auto; }
.cpa-card__quote {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: pre-line;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--cpa-ink);
}
.cpa-card__text--gone { font-style: italic; color: var(--cpa-mute); }

.cpa-card__foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-top: 1px solid var(--cpa-line-soft);
    font-size: 12.5px;
    color: var(--cpa-mute);
}
.cpa-card__foot span { display: inline-flex; align-items: center; gap: 4px; }
.cpa-card__open { margin-left: auto; font-weight: 600; color: var(--cpa-blue); }

/* ---- The profile's Posts page ---- */
.cpa-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.cpa-post {
    padding: 16px 18px;
    border: 1px solid var(--cpa-line);
    border-radius: 10px;
    background: var(--cpa-surface);
}
.cpa-post__head { display: flex; align-items: center; gap: 12px; }
.cpa .cpa-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}
.cpa .cpa-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cpa-post__who { flex: 1 1 auto; min-width: 0; }
.cpa-post__name { display: block; font-size: 14.5px; font-weight: 600; color: var(--cpa-ink); }
.cpa-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
    font-size: 12.5px;
    color: var(--cpa-mute);
}
.cpa-post__open,
.cpa-post__open:hover { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--cpa-blue); text-decoration: none; }

.cpa-post__title { margin: 12px 0 0; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--cpa-ink); }
.cpa-post__body { margin-top: 10px; font-size: 14.5px; line-height: 1.6; color: var(--cpa-ink); overflow-wrap: anywhere; }
.cpa-post__body a { color: var(--cpa-blue); }

.cpa-media {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}
.cpa-media--2, .cpa-media--4 { grid-template-columns: 1fr 1fr; }
.cpa-media--3 { grid-template-columns: 2fr 1fr; }
.cpa-media--3 > :first-child { grid-row: span 2; }
.cpa .cpa-media a { position: relative; display: block; min-height: 0; background: var(--cpa-fill); }
.cpa .cpa-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cpa .cpa-media--1 img { height: auto; max-height: 440px; object-fit: contain; }
.cpa-media--2 a, .cpa-media--4 a { aspect-ratio: 1 / 1; }
.cpa-media--3 a { aspect-ratio: 4 / 3; }
.cpa-media--3 > :first-child { aspect-ratio: auto; }
.cpa-media__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}
.cpa-video { display: block; width: 100%; max-height: 440px; margin-top: 12px; border-radius: 8px; background: #000; }

.cpa-repost {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--cpa-line);
    border-radius: 8px;
}
.cpa-repost__who { font-size: 13px; font-weight: 600; color: var(--cpa-ink); }
.cpa-repost .cpa-post__body { margin-top: 6px; font-size: 14px; }
.cpa-repost--gone { font-style: italic; color: var(--cpa-mute); }

.cpa-post__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--cpa-line-soft);
    font-size: 13px;
    color: var(--cpa-mute);
}
.cpa-post__foot span { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 991.98px) {
    .cpa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
    .cpa-grid { grid-template-columns: 1fr; }
    .cpa-post { padding: 14px; }
}
