/*
 * Mentor directory (/mentorship): the latest-tips strip and the mentor cards.
 * Card order: the mentor's top tip as a speech bubble, who they are, one meta
 * line (rank · rating · tips · coins), bio, two expertise tags, price + CTA.
 * Flame is the Tips module's colour (tips.css), so tip pieces read as
 * "from the Tips wall".
 */
.mentor-card, .mentor-tipstrip {
    --md-ink: #1c1c6e;
    --md-body: #403d59;
    --md-muted: #6e6a85;
    --md-line: #e7e5f2;
    --md-brand: #4242d6;
    --md-brand-strong: #3634b8;
    --md-chip: #f3f2ff;
    --md-bubble: #f4f3fa;
    --md-bubble-hover: #ecebf7;
    --md-flame: var(--mtp-flame, #e2561b);
    --md-flame-ink: #b8410f;
    --md-star: #e8a317;
}

/* ---- Latest tips strip ---- */
.mentor-tipstrip {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "kicker track all";
    align-items: center; gap: 8px 16px; margin: 0 0 24px; padding: 10px 16px;
    border: 1px solid var(--md-line); border-radius: 14px; background: #fff;
    box-shadow: 0 1px 2px rgba(28, 28, 110, .05);
}
.mentor-tipstrip__kicker {
    grid-area: kicker; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    background: var(--mtp-flame-tint, #fff0e8); font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--md-flame-ink); white-space: nowrap;
}
.mentor-tipstrip__kicker i { font-size: 14px; line-height: 1; }
/* Every tip stacked in one cell; only the active one shows, so the strip never changes height as it rotates. */
.mentor-tipstrip__track { grid-area: track; display: grid; min-width: 0; }
.mentor-tipstrip__item {
    grid-area: 1 / 1; display: flex; align-items: center; gap: 10px; min-width: 0;
    font-size: 13px; color: var(--md-ink); text-decoration: none;
    opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
}
.mentor-tipstrip__item.is-active { opacity: 1; visibility: visible; }
.mentor-tipstrip__item img { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.mentor-tipstrip__name { flex-shrink: 0; font-weight: 700; white-space: nowrap; }
.mentor-tipstrip__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--md-muted); }
.mentor-tipstrip__read { flex-shrink: 0; font-weight: 700; color: var(--md-brand); }
.mentor-tipstrip__item:hover .mentor-tipstrip__text { color: var(--md-body); }
.mentor-tipstrip__item:hover .mentor-tipstrip__read { text-decoration: underline; }
.mentor-tipstrip__all {
    grid-area: all; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font-size: 13px; font-weight: 600; color: var(--md-muted); text-decoration: none;
}
.mentor-tipstrip__all i { line-height: 1; }
.mentor-tipstrip__all:hover { color: var(--md-brand); }

/* ---- Mentor card ---- */
.mentor-card {
    display: flex; flex-direction: column; gap: 14px; height: 100%; padding: 18px;
    border: 1px solid var(--md-line); border-radius: 16px; background: #fff;
    box-shadow: 0 1px 2px rgba(28, 28, 110, .05);
    transition: box-shadow .2s ease, border-color .2s ease;
}
.mentor-card:hover { border-color: #d9d6f5; box-shadow: 0 14px 32px -14px rgba(28, 28, 110, .22); }

/* The mentor's top tip, said by them: a bubble trailing dots toward the avatar. */
.mentor-card__note {
    position: relative; align-self: flex-start; max-width: 92%; display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 8px; padding: 10px 12px; border-radius: 16px; background: var(--md-bubble);
    color: var(--md-body); text-decoration: none; transition: background-color .15s ease;
}
.mentor-card__note::before, .mentor-card__note::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.mentor-card__note::before { bottom: -7px; inset-inline-start: 22px; width: 12px; height: 12px; }
.mentor-card__note::after { bottom: -14px; inset-inline-start: 18px; width: 6px; height: 6px; }
.mentor-card__note:hover { background: var(--md-bubble-hover); color: var(--md-ink); }
.mentor-card__note:focus-visible { outline: 2px solid var(--md-brand); outline-offset: 2px; }
.mentor-card__note-text {
    font-size: 13px; line-height: 1.55; text-align: start; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mentor-card__note-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.4; color: var(--md-muted); }
.mentor-card__note-meta i { font-size: 12px; line-height: 1; color: var(--md-flame); }

.mentor-card__head { display: flex; align-items: center; gap: 12px; }
/* flex-shrink:0 + min-width: a long role must not squeeze the avatar into an oval. */
.mentor-card__avatar {
    width: 56px; height: 56px; min-width: 56px; flex-shrink: 0; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c9c6f3;
}
.mentor-card__who { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.mentor-card__name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--md-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mentor-card__job {
    font-size: 13px; line-height: 1.45; color: var(--md-body); text-align: start; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* The block keeps the page's direction (an English title still sits on the right in Arabic);
   only the <bdi> inside follows the title's own script. */
.mentor-card__company { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.4; color: var(--md-muted); }
.mentor-card__company i { flex-shrink: 0; font-size: 14px; line-height: 1; }
.mentor-card__company img { flex-shrink: 0; width: 14px; height: 14px; border-radius: 3px; object-fit: contain; display: block; }
.mentor-card__company-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* One meta line between hairlines. */
.mentor-card__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: 8px;
    border-block: 1px solid var(--md-line); font-size: 12px; color: var(--md-body);
}
.mentor-card__meta > * { display: inline-flex; align-items: center; gap: 5px; line-height: 1.4; white-space: nowrap; }
.mentor-card__rank { font-weight: 600; }
.mentor-card__rank img { width: 18px; height: 18px; object-fit: contain; display: block; }
.mentor-card__rank--gold { color: #7a4d00; }
.mentor-card__rank--silver { color: #3f4652; }
.mentor-card__rank--bronze { color: #7c3f12; }
.mentor-card__rating i { font-size: 13px; line-height: 1; color: var(--md-star); }
.mentor-card__rating b { font-weight: 700; color: var(--md-ink); }
.mentor-card__rating span { color: var(--md-muted); }
.mentor-card__tips { color: var(--md-body); text-decoration: none; }
.mentor-card__tips i { font-size: 14px; line-height: 1; color: var(--md-muted); }
.mentor-card__tips:hover { color: var(--md-flame-ink); }
.mentor-card__tips:hover i { color: var(--md-flame); }
.mentor-card__coins { font-weight: 600; color: #78350f; }
.mentor-card__coins img { display: block; }

.mentor-card__bio {
    margin: 0; font-size: 13px; line-height: 1.7; color: var(--md-muted); text-align: start; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.mentor-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mentor-card__tag {
    padding: 3px 9px; border-radius: 999px; background: var(--md-chip); box-shadow: inset 0 0 0 1px #e4e2fb;
    font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--md-brand);
}
.mentor-card__more { padding: 3px 4px; font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--md-muted); cursor: default; }

/* Price on the start side, the one button on the end side, on the card's bottom edge so a row lines up.
   last baseline: the price figure sits on the button label's baseline, not below the button. */
.mentor-card__foot { display: flex; align-items: last baseline; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 4px; }
.mentor-card__cta {
    display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 44px; padding: 0 18px;
    border-radius: 12px; background: var(--md-brand); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
    box-shadow: 0 8px 20px -12px rgba(66, 66, 214, .7); transition: background-color .15s ease;
}
.mentor-card__cta i { font-size: 15px; line-height: 1; }
.mentor-card__cta:hover { background: var(--md-brand-strong); color: #fff; }
.mentor-card__cta:focus-visible { outline: 2px solid var(--md-brand); outline-offset: 2px; }

@media (max-width: 767.98px) {
    .mentor-tipstrip { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kicker all" "track track"; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .mentor-tipstrip__item, .mentor-card, .mentor-card__note, .mentor-card__cta { transition: none; }
}
