/* Compact post identity. Loaded after forum-avatars.css.
   Markup: html/com_kunena/layouts/user/profile/horizontal.php (.row.emjey-identity).
   The rank card, staff-eye crop and reduced-motion rank rules stay in forum-kunena.css;
   the rank column keeps its col-* class and second position so those rules still match.
   Avatar size (48px) is owned by forum-avatars.css. Logical properties only. */

.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom):has(> .container > .row.emjey-identity) {
    min-height: 0;
    padding: 0.55rem 0.75rem;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container:has(> .row.emjey-identity) {
    max-width: 100%;
    padding-inline: 0;
}

.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    margin: 0;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > :is(.emjey-identity__who, .emjey-identity__rank) {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__rank:not(:has(.profilebox > li)) {
    display: none;
}

/* Identity card: avatar | name, role, posts, status. */
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: start !important;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card:has(> .emjey-identity__avatar) {
    grid-template-columns: 48px minmax(0, 1fr);
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li {
    order: 0;
    grid-column: -2 / -1;
    flex: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--emjey-text-muted, #6a6a6a);
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__avatar {
    grid-column: 1;
    grid-row: 1 / span 5;
    align-self: center;
    line-height: 0;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--emjey-text, #1a1a1a);
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__starter {
    justify-self: start;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #f3ead9;
    color: #6b4b1f;
    font-size: 0.7rem;
    font-weight: 600;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__posts {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.3rem;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__count {
    color: var(--emjey-text, #1a1a1a);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Secondary fields disclosure. */
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__more {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: var(--kf-touch-min, 44px);
    min-height: var(--kf-touch-min, 44px);
    padding-block: 0;
    padding-inline: 0.75rem;
    box-sizing: border-box;
    border: 1px solid #e5ddd0;
    border-radius: var(--kf-radius-sm, 6px);
    background: #fff;
    color: #554737;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle::-webkit-details-marker {
    display: none;
}
/* Symmetric chevron, so physical borders are direction-neutral here. */
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle::after {
    content: "";
    flex: none;
    width: 0.45em;
    height: 0.45em;
    margin-block-start: -0.2em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__more[open] > .emjey-identity__toggle::after {
    margin-block-start: 0.2em;
    transform: rotate(225deg);
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle:hover {
    border-color: #b8894c;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle:focus-visible {
    outline: 2px solid var(--kf-gold, #FFD371);
    outline-offset: 2px;
    border-color: #554737;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__fields {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.3rem 0.85rem;
    margin: 0.45rem 0 0;
    padding: 0.55rem 0.7rem;
    border: 1px solid #e5ddd0;
    border-inline-start: 3px solid #b8894c;
    border-radius: 0.35rem;
    background: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: start;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__field > dt {
    margin: 0;
    font-weight: 600;
    color: #554737;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__field > dd {
    min-width: 0;
    margin: 0;
    color: var(--emjey-text, #1a1a1a);
    overflow-wrap: anywhere;
}
.emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__field > dd img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}
.emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__modules {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

@media (min-width: 769px) {
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity {
        flex-wrap: nowrap;
        align-items: flex-start;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity:has(> .emjey-identity__modules) {
        flex-wrap: wrap;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__more {
        flex: 0 1 26rem;
        width: auto;
        margin-inline-start: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__more > .emjey-identity__fields {
        align-self: stretch;
    }
}

@media (max-width: 768px) {
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity {
        gap: 0.4rem 0.6rem;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who {
        flex: 1 1 10rem;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__rank {
        flex: 0 1 auto;
    }
    /* Replaces the old one-line ellipsis; the full name stays in the link text. */
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
    .emjey-forum-standalone .emjey-forum-main #kunena :is(.profile-horizontal-top, .profile-horizontal-bottom) > .container > .row.emjey-identity > .emjey-identity__who > .profilebox.emjey-identity__card > li.emjey-identity__name:has(a:focus-visible) {
        display: block;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .emjey-forum-standalone .emjey-forum-main #kunena .row.emjey-identity .emjey-identity__toggle::after {
        transition: none;
    }
}
