/**
 * Featured Attorneys — new UI
 *
 * Card layout from the Lexinter homepage redesign, mapped onto the brand
 * palette. Everything is namespaced under .lex-fa- so it cannot collide with
 * the legacy lawyer-display styles or the parent theme.
 *
 * Scope note: the shortcode outputs the grid only — the heading and the section
 * padding/background around it come from Elementor. So .lex-fa-grid is the root
 * here: it carries the palette tokens and sets no outer margin of its own.
 */

.lex-fa-grid {
    /* Brand palette */
    --lex-fa-blue:        #006FC0;
    --lex-fa-blue-accent: #218FFF;
    --lex-fa-blue-light:  #EDF6FF;
    --lex-fa-gold:        #FFC000;
    --lex-fa-gold-alt:    #F9BE0C;
    --lex-fa-navy:        #0F1B31;
    --lex-fa-panel:       #F7F7F7;
    --lex-fa-white:       #ffffff;
    --lex-fa-ink:         var(--lex-fa-navy);
    --lex-fa-ink-soft:    #5b6577;
    --lex-fa-line:        #e3e8ef;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* desktop — see breakpoints at the end */
    gap: 18px;
    color: var(--lex-fa-ink);
}

.lex-fa-grid,
.lex-fa-grid *,
.lex-fa-grid *::before,
.lex-fa-grid *::after {
    box-sizing: border-box;
}

/* ---------- card ---------- */

.lex-fa-card {
    position: relative; /* anchor for the whole-card link overlay */
    background: var(--lex-fa-white);
    border: 1px solid var(--lex-fa-line);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.lex-fa-card:hover,
.lex-fa-card:focus-within {
    border-color: var(--lex-fa-blue-accent);
    box-shadow: 0 10px 26px rgba(0, 111, 192, .12);
    transform: translateY(-2px);
}

/*
 * One invisible anchor stretched over the card is the profile link — the name
 * and the View profile button are plain text on top of it, so a card carries
 * just two links: this one and Call.
 */
.lex-fa-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lex-fa-cover:focus-visible {
    outline: 2px solid var(--lex-fa-blue-accent);
    outline-offset: -3px;
    border-radius: 12px;
}

/* Cover band — the listing thumbnail, or a navy gradient when there is none. */
.lex-fa-photo {
    position: relative;
    z-index: 0; /* contains the badge/avatar so the link overlay stays on top */
    height: 120px;
    background: linear-gradient(135deg, #1b2c4a 0%, var(--lex-fa-navy) 100%);
    background-size: cover;
    background-position: center;
}

.lex-fa-photo.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 27, 49, .15) 0%, rgba(15, 27, 49, .55) 100%);
}

.lex-fa-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: var(--lex-fa-gold);
    color: var(--lex-fa-navy);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 99px;
}

.lex-fa-avatar {
    position: absolute;
    z-index: 2;
    bottom: -30px;
    left: 20px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--lex-fa-blue-light);
    border: 3px solid var(--lex-fa-white);
    box-shadow: 0 2px 8px rgba(15, 27, 49, .12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lex-fa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    display: block;
}

.lex-fa-initials {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--lex-fa-blue);
}

/* ---------- card body ---------- */

.lex-fa-body {
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.lex-fa-name {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--lex-fa-navy);
    margin: 0 0 4px;
}

.lex-fa-card:hover .lex-fa-name,
.lex-fa-cover:focus-visible ~ .lex-fa-body .lex-fa-name {
    color: var(--lex-fa-blue);
}

.lex-fa-firm {
    font-size: 15.5px;
    color: var(--lex-fa-ink-soft);
    margin-bottom: 6px;
}

.lex-fa-pa {
    color: var(--lex-fa-blue);
    font-size: 15.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.lex-fa-loc {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--lex-fa-ink-soft);
    font-size: 14.5px;
    margin-bottom: 14px;
}

.lex-fa-loc svg {
    flex: none;
    opacity: .8;
}

/* ---------- actions ---------- */

.lex-fa-actions {
    position: relative;
    z-index: 2; /* sits above the card link overlay so Call stays clickable */
    pointer-events: none; /* ...but View profile lets clicks through to it */
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.lex-fa-actions a {
    pointer-events: auto;
}

.lex-fa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid var(--lex-fa-line);
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.lex-fa-btn-main {
    background: var(--lex-fa-blue);
    border-color: var(--lex-fa-blue);
    color: var(--lex-fa-white);
}

.lex-fa-card:hover .lex-fa-btn-main,
.lex-fa-cover:focus-visible ~ .lex-fa-body .lex-fa-btn-main {
    background: var(--lex-fa-navy);
    border-color: var(--lex-fa-navy);
    color: var(--lex-fa-white);
}

.lex-fa-btn-ghost {
    background: var(--lex-fa-white);
    color: var(--lex-fa-ink);
}

.lex-fa-btn-ghost:hover,
.lex-fa-btn-ghost:focus {
    border-color: var(--lex-fa-blue);
    color: var(--lex-fa-blue);
    background: var(--lex-fa-blue-light);
}

.lex-fa-btn:focus-visible {
    outline: 2px solid var(--lex-fa-blue-accent);
    outline-offset: 2px;
}

/* ---------- empty state ---------- */

.lex-fa-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: var(--lex-fa-panel);
    border-radius: 12px;
    color: var(--lex-fa-ink-soft);
    font-size: 15px;
}

/* ---------- skeleton ---------- */

.lex-fa-skeleton-card {
    cursor: default;
}

.lex-fa-skeleton-card .lex-fa-photo {
    background: var(--lex-fa-panel);
}

.lex-fa-skeleton-card .lex-fa-avatar {
    background: #ececec;
    border-color: var(--lex-fa-white);
}

.lex-fa-skeleton {
    background: linear-gradient(90deg, #eeeeee 25%, #f6f6f6 37%, #eeeeee 63%);
    background-size: 400% 100%;
    animation: lex-fa-shimmer 1.4s ease infinite;
    border-radius: 6px;
}

.lex-fa-skeleton-line {
    height: 12px;
    margin-bottom: 10px;
}

.lex-fa-skeleton-line.short {
    width: 60%;
}

.lex-fa-skeleton-btn {
    height: 34px;
    width: 100%;
    margin-top: 8px;
    border-radius: 6px;
}

@keyframes lex-fa-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Fade the real cards in once painted. */
.lex-fa-grid.is-loaded .lex-fa-card {
    animation: lex-fa-fade .25s ease both;
}

@keyframes lex-fa-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .lex-fa-card,
    .lex-fa-btn,
    .lex-fa-skeleton,
    .lex-fa-grid.is-loaded .lex-fa-card {
        transition: none;
        animation: none;
    }
}

/* ---------- responsive ----------
 * 4 per row on desktop, 2 on tablet, 1 on mobile. Breakpoints match Elementor's
 * defaults (tablet <= 1024px, mobile <= 767px) so the grid switches on the same
 * widths as the widgets around it.
 */

@media (max-width: 1024px) {
    .lex-fa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .lex-fa-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}
