/* Lawyer profile: editorial identity, real portrait and readable professional record.
   Scoped to this page so the shared navigation and team directory keep their layout. */
html body.lawyer-detail-page {
    isolation: isolate;
    background: #f3f5f4 !important;
}

/* One fixed photograph continues behind the profile, experience and footer.
   Its crop follows the viewport, so long biographies never stretch the image. */
html body.lawyer-detail-page::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(248, 249, 249, .91) 0%, rgba(248, 249, 249, .84) 45%, rgba(248, 249, 249, .76) 100%),
        url("assets/backgrounds/lawyer-mountain-mist-5120.webp") center / cover no-repeat;
    filter: saturate(.32);
}

html body.lawyer-detail-page main#main-content {
    padding-top: 68px;
    background: transparent;
    color: #25282d;
    font-size: 16px;
    line-height: 1.8;
}

#lawyer-profile {
    --zeheng-type-display: clamp(44px, 4.4vw, 62px);
    --zeheng-type-module-title: 23px;
    --lp-ink: #25282d;
    --lp-muted: #63666b;
    --lp-red: #79171c;
    --lp-line: rgba(54, 65, 73, .18);
    --lp-ease: cubic-bezier(.22, .61, .36, 1);
    width: 100%;
}

#lawyer-profile [hidden] { display: none !important; }

#lawyer-profile .lp-container {
    width: min(1200px, calc(100% - 112px));
    margin-inline: auto;
}

#lawyer-profile .lp-hero {
    background: transparent;
    padding-bottom: 44px;
}

#lawyer-profile .lp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    color: #62676c;
    font-size: 12px;
    letter-spacing: .04em;
}

#lawyer-profile .lp-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #62656a;
    text-decoration: none;
    transition: color 220ms ease;
}

#lawyer-profile .lp-breadcrumb a:hover { color: var(--lp-red); }
#lawyer-profile .lp-breadcrumb [aria-current] { color: var(--lp-ink); }

#lawyer-profile .lp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 336px;
    gap: clamp(56px, 8vw, 120px);
    align-items: center;
}

#lawyer-profile .lp-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    min-width: 0;
    padding-block: 16px;
    animation: lp-enter 650ms var(--lp-ease) both;
}

#lawyer-profile .lp-location {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    color: var(--lp-muted);
    font-size: 13px;
    letter-spacing: .12em;
}

#lawyer-profile .lp-location::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--lp-red);
}

#lawyer-profile h1 {
    margin: 0;
    color: var(--lp-ink);
    font-size: clamp(44px, 4.4vw, 62px);
    line-height: 1.2;
}

html body.lawyer-detail-page main#main-content #lawyer-profile .lp-role {
    display: block;
    margin: 16px 0 0;
    color: var(--lp-red) !important;
    font-size: 17px !important;
    letter-spacing: .03em;
}

#lawyer-profile .lp-bio {
    max-width: 640px;
    padding-top: 26px;
    border-top: 1px solid var(--lp-line);
    color: #4d5156;
    font-size: 17px;
    line-height: 1.95;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

#lawyer-profile .lp-actions { display: flex; }

#lawyer-profile .lp-contact {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    min-height: 46px;
    padding: 0 0 7px;
    border-bottom: 1px solid var(--lp-red);
    color: var(--lp-red);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .06em;
    text-decoration: none;
    transition: color 240ms ease, border-color 240ms ease;
}

#lawyer-profile .lp-contact svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.25;
    transition: transform 280ms var(--lp-ease);
}

#lawyer-profile .lp-contact:hover { color: #431014; border-color: #431014; }
#lawyer-profile .lp-contact:hover svg { transform: translateX(5px); }

#lawyer-profile .lp-portrait {
    width: 100%;
    margin: 0;
    align-self: start;
    animation: lp-enter 800ms 100ms var(--lp-ease) both;
}

#lawyer-profile [data-lawyer-photo-frame] {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    background: #dddde0;
    box-shadow: none !important;
}

#lawyer-profile [data-lawyer-photo-frame] img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: var(--lawyer-photo-position, top center) !important;
    border-radius: 0 !important;
    mix-blend-mode: normal;
    filter: none !important;
    transform: none !important;
}

/* The original photo remains intact; the matching local silhouette and a
   separate bottom gradient are composed only in the profile presentation. */
html body.lawyer-detail-page #lawyer-profile [data-lawyer-photo-frame].lp-cutout-ready {
    background: transparent !important;
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, .95) 75%, rgba(0, 0, 0, .36) 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 62%, rgba(0, 0, 0, .95) 75%, rgba(0, 0, 0, .36) 92%, transparent 100%);
}

html body.lawyer-detail-page #lawyer-profile [data-lawyer-photo-frame].lp-cutout-ready img {
    -webkit-mask-image: var(--lawyer-portrait-mask);
    mask-image: var(--lawyer-portrait-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: cover;
    mask-size: cover;
    -webkit-mask-position: var(--lawyer-photo-position, top center);
    mask-position: var(--lawyer-photo-position, top center);
}

#lawyer-profile [data-lawyer-photo-frame].lp-portrait-pending { opacity: 0; }

#lawyer-profile .lp-details {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 80px;
    padding-block: 52px 72px;
}

#lawyer-profile .lp-section-heading { margin-bottom: 20px; }

#lawyer-profile .lp-section-en {
    display: block;
    margin-bottom: 8px;
    color: #62676c;
    font-size: 10px;
    letter-spacing: .18em;
    line-height: 1.4;
}

main#main-content #lawyer-profile h2 {
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--lp-ink);
    font-size: 23px;
    line-height: 1.4;
}

#lawyer-profile .lp-practice-list,
#lawyer-profile .lp-experience-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#lawyer-profile .lp-practice-list li {
    position: relative;
    padding: 5px 0 5px 15px;
    color: #4d5156;
    font-size: 15px;
}

#lawyer-profile .lp-practice-list li::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 0;
    width: 4px;
    height: 4px;
    background: var(--lp-red);
}

#lawyer-profile .lp-experience-list { border-top: 1px solid var(--lp-line); }

#lawyer-profile .lp-full-profile {
    color: #4d5156;
    font-size: 15px;
    line-height: 1.95;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

#lawyer-profile .lp-introduction + .lp-experience:not([hidden]) { margin-top: 40px; }

#lawyer-profile .lp-experience-list li {
    padding: 17px 0;
    border-bottom: 1px solid var(--lp-line);
    color: #4d5156;
    font-size: 15px;
    overflow-wrap: anywhere;
}

#lawyer-profile .lp-honors { margin-top: 40px; }

#lawyer-profile .lp-details-compact { grid-template-columns: 1fr; }
#lawyer-profile .lp-details-compact .lp-practice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 24px;
}

/* The footer shares the same backdrop; a fine rule is enough to separate it. */
html body.lawyer-detail-page .site-footer {
    background: transparent !important;
    border-top: 1px solid rgba(54, 65, 73, .18) !important;
    color: #4d5156 !important;
}

html body.lawyer-detail-page .site-footer .footer-brand,
html body.lawyer-detail-page .site-footer h4 span + span,
html body.lawyer-detail-page .site-footer h5 span + span {
    color: #25282d !important;
}

html body.lawyer-detail-page .site-footer p,
html body.lawyer-detail-page .site-footer .footer-brand + p,
html body.lawyer-detail-page .site-footer a,
html body.lawyer-detail-page .site-footer li,
html body.lawyer-detail-page .site-footer h4,
html body.lawyer-detail-page .site-footer h5,
html body.lawyer-detail-page .site-footer h4 span,
html body.lawyer-detail-page .site-footer h5 span,
html body.lawyer-detail-page .site-footer .footer-bottom,
html body.lawyer-detail-page .site-footer .footer-bottom a,
html body.lawyer-detail-page .site-footer .footer-bottom span {
    color: #4d5156 !important;
}

html body.lawyer-detail-page .site-footer ul,
html body.lawyer-detail-page .site-footer .footer-grid > div:not(:first-child):not(.footer-bottom),
html body.lawyer-detail-page .site-footer .footer-bottom {
    border-top-color: rgba(54, 65, 73, .18) !important;
}

html body.lawyer-detail-page .site-footer a:hover {
    color: #79171c !important;
    text-decoration-color: currentColor;
}

@keyframes lp-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1001px) {
    #lawyer-profile .lp-practice { position: sticky; top: 106px; }
}

@media (max-width: 1100px) {
    #lawyer-profile .lp-container { width: calc(100% - 80px); }
    #lawyer-profile .lp-hero-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
    #lawyer-profile .lp-identity { gap: 24px; padding-block: 8px; }
    #lawyer-profile .lp-bio { font-size: 16px; }
    #lawyer-profile .lp-details { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
}

@media (max-width: 1000px) {
    html body.lawyer-detail-page main#main-content { padding-top: 64px; }
}

@media (max-width: 760px) {
    html body.lawyer-detail-page::before {
        background-image:
            linear-gradient(180deg, rgba(248, 249, 249, .82), rgba(248, 249, 249, .87)),
            url("assets/backgrounds/lawyer-mountain-mist-1600.webp");
        background-position: center, 58% center;
    }
    #lawyer-profile {
        --zeheng-type-display: clamp(30px, 8.6vw, 42px);
        --zeheng-type-module-title: 21px;
    }
    #lawyer-profile .lp-container { width: calc(100% - 40px); }
    #lawyer-profile .lp-hero { padding-bottom: 32px; }
    #lawyer-profile .lp-breadcrumb { min-height: 58px; font-size: 11px; gap: 10px; }
    #lawyer-profile .lp-hero-grid {
        grid-template-columns: minmax(0, 1fr) 42%;
        grid-template-areas: "identity portrait" "bio bio" "actions actions";
        gap: 24px 16px;
        align-items: center;
    }
    #lawyer-profile .lp-identity { display: contents; animation: none; }
    #lawyer-profile .lp-identity-heading { grid-area: identity; animation: lp-enter 650ms var(--lp-ease) both; }
    #lawyer-profile .lp-location { margin-bottom: 16px; font-size: 12px; gap: 8px; }
    #lawyer-profile .lp-location::before { width: 16px; }
    #lawyer-profile h1 { font-size: clamp(30px, 8.6vw, 42px); }
    html body.lawyer-detail-page main#main-content #lawyer-profile .lp-role { margin-top: 14px; font-size: 13px !important; }
    #lawyer-profile .lp-portrait { grid-area: portrait; align-self: center; }
    #lawyer-profile .lp-bio { grid-area: bio; max-width: none; padding-top: 23px; font-size: 15px; line-height: 1.9; }
    #lawyer-profile .lp-actions { grid-area: actions; }
    #lawyer-profile .lp-contact { min-height: 44px; gap: 32px; padding-bottom: 4px; }
    #lawyer-profile .lp-details { grid-template-columns: 1fr; gap: 34px; padding-block: 36px 44px; }
    #lawyer-profile .lp-section-heading { margin-bottom: 16px; }
    #lawyer-profile .lp-section-en { margin-bottom: 7px; font-size: 9px; }
    #lawyer-profile h2 { font-size: 21px; }
    #lawyer-profile .lp-practice-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
    #lawyer-profile .lp-details-compact .lp-practice-list { grid-template-columns: 1fr 1fr; gap: 2px 16px; }
    #lawyer-profile .lp-practice-list li { font-size: 14px; }
    #lawyer-profile .lp-experience-list li { padding-block: 15px; font-size: 14px; }
    #lawyer-profile .lp-honors { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    #lawyer-profile *, #lawyer-profile *::before { animation: none !important; transition: none !important; }
}
