/* Candidate profile gate - blurred placeholder for guests */

.civi-gate-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

/* ── Blur the placeholder ── */
.civi-gate-placeholder {
    filter: blur(6px);
    -webkit-filter: blur(6px);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    padding: 4px 0 8px;
}

/* ── Each fake "entry" row ── */
.civi-gate-entry {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 0 18px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 38px;
}
.civi-gate-entry:last-child { border-bottom: none; }

/* Dot on the left (mimics time-dot) */
.civi-gate-entry::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--civi-color-accent, #2958ff);
    opacity: 0.5;
}

/* ── Bars (zero text, pure background shapes) ── */
.civi-gate-bar {
    display: block;
    height: 14px;
    border-radius: 6px;
    background: #d0d0d0;
}
.civi-gate-bar--title   { width: 55%; height: 18px; background: #555; }
.civi-gate-bar--meta    { width: 40%; height: 13px; background: var(--civi-color-accent, #2958ff); opacity: 0.6; }
.civi-gate-bar--date    { width: 28%; height: 12px; background: #bbb; }
.civi-gate-bar--text    { width: 85%; height: 12px; background: #ccc; }
.civi-gate-bar--text-sm { width: 65%; height: 12px; background: #ccc; }

.civi-gate-name {
    display: inline-block;
    width: 4.5em;
    height: 0.62em;
    margin-left: 0.08em;
    border-radius: 0.3em;
    background: currentColor;
    opacity: 0.35;
    filter: blur(3px);
    -webkit-filter: blur(3px);
    vertical-align: 0.05em;
    pointer-events: none;
    user-select: none;
}

/* ── Overlay - always visible with blur background ── */
.civi-gate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    text-decoration: none;
    z-index: 10;
}

.civi-gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    background: var(--civi-color-accent, #2958ff);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    transition: opacity 0.2s;
}

.civi-gate-btn:hover {
    opacity: 0.85;
}

/* ── Avatar privacy placeholder for guests ─────────────────────
   Real photo URL is never rendered. Pseudo-element paints layered
   gradients shaped like hair / face / shoulders + background, then
   blurs them - reads as a heavily-blurred portrait photo. Twelve
   palette variants are picked in shuffled order so different
   profiles get different tones (warmth, hair color, clothing),
   making the row of placeholders feel like a row of real photos
   instead of identical generic blobs. Parent stays sharp so the
   verified-ring and circular border-radius render cleanly.       */
.civi-gate-avatar {
    position: relative;
    overflow: hidden;
    pointer-events: none;
    user-select: none;

    /* Default (v1) - dark hair, warm tan skin, navy collar */
    --gate-hair-1:      #3f3a33;
    --gate-hair-2:      #4a443c;
    --gate-skin-1:      #d6a988;
    --gate-skin-2:      #b58a6c;
    --gate-shoulders-1: #3e4a5f;
    --gate-shoulders-2: #5b6a82;
    --gate-bg-top:      #e7eaf2;
    --gate-bg-bottom:   #b6bac8;
}
.civi-gate-avatar::before {
    content: '';
    position: absolute;
    inset: -15%;
    background:
        /* hair */
        radial-gradient(ellipse 42% 28% at 50% 22%, var(--gate-hair-1) 0%, var(--gate-hair-2) 55%, transparent 72%),
        /* face / skin tone */
        radial-gradient(ellipse 34% 40% at 50% 44%, var(--gate-skin-1) 0%, var(--gate-skin-2) 65%, transparent 78%),
        /* shoulders / clothing */
        radial-gradient(ellipse 95% 55% at 50% 105%, var(--gate-shoulders-1) 28%, var(--gate-shoulders-2) 58%, transparent 76%),
        /* studio background */
        linear-gradient(180deg, var(--gate-bg-top) 0%, var(--gate-bg-bottom) 100%);
    filter: blur(8px);
    -webkit-filter: blur(8px);
}

/* v2 - deep skin, black hair, light shirt */
.civi-gate-avatar--v2 {
    --gate-hair-1:      #1f1a17;
    --gate-hair-2:      #2a241f;
    --gate-skin-1:      #6b4a3a;
    --gate-skin-2:      #8b6450;
    --gate-shoulders-1: #d8dde6;
    --gate-shoulders-2: #b8bec8;
    --gate-bg-top:      #f0eee8;
    --gate-bg-bottom:   #c5beb0;
}

/* v3 - medium skin, dark hair, blue shirt */
.civi-gate-avatar--v3 {
    --gate-hair-1:      #2f2823;
    --gate-hair-2:      #3a302a;
    --gate-skin-1:      #b48c6e;
    --gate-skin-2:      #95704d;
    --gate-shoulders-1: #4a5d75;
    --gate-shoulders-2: #6878a0;
    --gate-bg-top:      #dfe2eb;
    --gate-bg-bottom:   #aab0c0;
}

/* v4 - fair skin, brown hair, gray jacket */
.civi-gate-avatar--v4 {
    --gate-hair-1:      #5a4234;
    --gate-hair-2:      #6b513f;
    --gate-skin-1:      #e8c4a0;
    --gate-skin-2:      #c89c78;
    --gate-shoulders-1: #50544c;
    --gate-shoulders-2: #707465;
    --gate-bg-top:      #ebecee;
    --gate-bg-bottom:   #b8bbc0;
}

/* v5 - dark skin, very dark hair, burgundy */
.civi-gate-avatar--v5 {
    --gate-hair-1:      #15110e;
    --gate-hair-2:      #1f1916;
    --gate-skin-1:      #5b3f30;
    --gate-skin-2:      #7a5740;
    --gate-shoulders-1: #6a2c2c;
    --gate-shoulders-2: #8a3838;
    --gate-bg-top:      #e8e0d8;
    --gate-bg-bottom:   #b8aa9c;
}

/* v6 - warm tan, lighter hair, khaki/green */
.civi-gate-avatar--v6 {
    --gate-hair-1:      #4a3220;
    --gate-hair-2:      #5a3e2a;
    --gate-skin-1:      #c89876;
    --gate-skin-2:      #a87858;
    --gate-shoulders-1: #4a5c3a;
    --gate-shoulders-2: #687a55;
    --gate-bg-top:      #e4e8dc;
    --gate-bg-bottom:   #b0b8a0;
}

/* v7 - cool tones, dark navy collar */
.civi-gate-avatar--v7 {
    --gate-hair-1:      #2c3340;
    --gate-hair-2:      #3a4150;
    --gate-skin-1:      #c8a888;
    --gate-skin-2:      #a08560;
    --gate-shoulders-1: #1f2a3e;
    --gate-shoulders-2: #2e3a52;
    --gate-bg-top:      #d8dde6;
    --gate-bg-bottom:   #9aa0b0;
}

/* v8 - auburn hair, fair skin, cream shirt */
.civi-gate-avatar--v8 {
    --gate-hair-1:      #5a2818;
    --gate-hair-2:      #7a3a20;
    --gate-skin-1:      #ecd1b0;
    --gate-skin-2:      #d4ad88;
    --gate-shoulders-1: #e8d8b8;
    --gate-shoulders-2: #b8a482;
    --gate-bg-top:      #f0e8db;
    --gate-bg-bottom:   #c5b89c;
}

/* v9 - very dark hair, deep skin, olive green */
.civi-gate-avatar--v9 {
    --gate-hair-1:      #0a0907;
    --gate-hair-2:      #18130f;
    --gate-skin-1:      #4a3220;
    --gate-skin-2:      #6a4a35;
    --gate-shoulders-1: #56603a;
    --gate-shoulders-2: #7a8455;
    --gate-bg-top:      #ddd8c8;
    --gate-bg-bottom:   #a8a285;
}

/* v10 - brown hair, medium skin, plum/purple */
.civi-gate-avatar--v10 {
    --gate-hair-1:      #3a2f25;
    --gate-hair-2:      #4d3e30;
    --gate-skin-1:      #c69876;
    --gate-skin-2:      #a07550;
    --gate-shoulders-1: #5a3a55;
    --gate-shoulders-2: #7a5070;
    --gate-bg-top:      #e6deed;
    --gate-bg-bottom:   #b09cb8;
}

/* v11 - dark hair, fair skin, charcoal sweater */
.civi-gate-avatar--v11 {
    --gate-hair-1:      #2a2520;
    --gate-hair-2:      #38322c;
    --gate-skin-1:      #e0bc98;
    --gate-skin-2:      #c09870;
    --gate-shoulders-1: #2d3038;
    --gate-shoulders-2: #45494f;
    --gate-bg-top:      #e0e2e6;
    --gate-bg-bottom:   #a8acb2;
}

/* v12 - salt-and-pepper hair, medium-dark skin, light blue collar */
.civi-gate-avatar--v12 {
    --gate-hair-1:      #6a6660;
    --gate-hair-2:      #4a4640;
    --gate-skin-1:      #a07a60;
    --gate-skin-2:      #84603e;
    --gate-shoulders-1: #b8d0e0;
    --gate-shoulders-2: #88a8c0;
    --gate-bg-top:      #e8f0f5;
    --gate-bg-bottom:   #b8c8d2;
}

/* Strip any leftover icon/text children so they don't poke through */
.civi-gate-avatar > i,
.civi-gate-avatar > svg,
.civi-gate-avatar > span,
.civi-gate-avatar > img {
    display: none;
}

/* "You" badge shown on the current candidate's own card across the
   public archive and related-candidates strip. Pinned to the top of
   the archive on page 1 by civi_archive_self_pinned_id(). */
.candidate-self-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--civi-color-accent, #4d4ed4);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}
.civi-candidates-item--self {
    outline: 2px solid var(--civi-color-accent, #4d4ed4);
    outline-offset: -2px;
    border-radius: 6px;
}

/* ── Form-submit variant of the gate CTA ──────────────────────
   Used by locked tender sections. Spending a view changes state,
   so the overlay posts instead of linking. Same look as the
   anchor variant; only the element differs.                     */
.civi-gate-form {
    margin: 0;
    padding: 0;
    border: 0;
}

button.civi-gate-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

/* Locked sections carry no real text, so the blurred bars need a
   floor height or a short placeholder collapses to nothing. Scoped to the
   listing wrappers - the candidate profile's own boxes keep their sizing. */
.jobs-description-details .civi-gate-wrap,
.jobs-additional-text .civi-gate-wrap {
    min-height: 120px;
}

/* Popup-trigger variant: the overlay is a plain wrapper and the anchor sits
   inside it, because themes/civi/assets/js/main.js binds ".logged-out a". */
.civi-gate-overlay a {
    text-decoration: none;
}

/* A closed listing, in the two places it is said.

   As a line of text - the sidebar on jobs and scholarships - it reads as a
   warning, so it is red. */
.civi-listing-expired {
	color: #cc0000;
	font-weight: 700;
}

/* As the gate button it is still a button, and has to look like the one it
   replaces, or the panel reads as broken rather than closed. Same accent
   colour, same weight, same size as the "Login to view" button beside it -
   it simply cannot be pressed. Element + two classes so it wins over
   .civi-button.button-disbale without needing !important. */
button.civi-button.civi-listing-expired,
.civi-gate-btn.civi-listing-expired {
	background: var(--civi-color-accent, #2958ff);
	border-color: var(--civi-color-accent, #2958ff);
	color: #fff;
	font-weight: 600;
	opacity: 1;
	cursor: not-allowed;
	pointer-events: none;
}

/* Your own listing in the tender / scholarship archive. Same treatment the
   candidate archive gives your own profile: an accent outline on the card and
   a pill by the title, so it is recognisable at a glance now that it also
   sorts to the top. */
.civi-listing-item--self {
	outline: 2px solid var(--civi-color-accent, #4d4ed4);
	outline-offset: -2px;
	border-radius: 6px;
}

.civi-listing-self-badge {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--civi-color-accent, #4d4ed4);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	vertical-align: middle;
}
