/* OPINI.AI.ID — Author Profile V2 polish
   Scoped overrides. No impact on global pages or writer data.
*/
.ap-profile-card {
    margin: 22px 0 40px;
    border: 1px solid #dfe8e7;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 14px 42px rgba(13, 43, 46, .045);
}
.ap-profile-card .ap-cover {
    position: relative;
    height: clamp(150px, 17vw, 184px);
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(114deg, #0a171b 0%, #10383d 44%, #0f7773 100%);
}
.ap-profile-card .ap-cover::after {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 84% 14%, rgba(59, 200, 185, .13), transparent 60%),
        linear-gradient(90deg, rgba(3, 19, 23, .19), transparent 72%);
}
.ap-profile-card .ap-cover > img {
    position: relative;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}
/* V1 put this label at the bottom, where the overlapping avatar covered it. */
.ap-profile-card .ap-cover-label {
    position: absolute;
    z-index: 2;
    left: 25px;
    top: 21px;
    bottom: auto;
    display: inline-flex;
    max-width: calc(100% - 50px);
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 6px;
    background: rgba(6, 25, 29, .30);
    color: #fff;
    font: 500 10px/1.35 'JetBrains Mono', monospace;
    letter-spacing: .125em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    overflow-wrap: anywhere;
}
.ap-profile-card .ap-profile-content {
    padding: 0 clamp(18px, 3vw, 35px) 31px;
}
.ap-profile-card .ap-identity {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: -35px;
}
.ap-profile-card .ap-avatar {
    z-index: 1;
    width: 100px;
    height: 100px;
    flex: 0 0 100px;
    display: grid;
    place-items: center;
    border: 5px solid #fff;
    border-radius: 22px;
    overflow: hidden;
    background: #e0f2ef;
    color: #08796f;
    box-shadow: 0 5px 18px rgba(9, 34, 37, .10);
}
.ap-profile-card .ap-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ap-profile-card .ap-identity-copy {
    flex: 1;
    min-width: 0;
    padding-top: 40px;
}
.ap-profile-card .ap-identity-copy .eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #0b8b7e;
}
.ap-profile-card .ap-identity-copy h1 {
    margin: 0 0 12px;
    color: #101b1e;
    font-size: clamp(27px, 3.8vw, 39px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.ap-profile-card .ap-profession {
    margin: 8px 0 4px;
    color: #172a2e;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 700;
}
.ap-profile-card .ap-expertise,
.ap-profile-card .ap-location {
    margin: 4px 0;
    color: #566a70;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.ap-profile-card .ap-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 25px;
}
.ap-profile-card .ap-stats > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    min-height: 104px;
    padding: 18px 21px;
    border: 1px solid #eef2f2;
    border-radius: 13px;
    background: #f6f8f8;
}
.ap-profile-card .ap-stats strong {
    display: block;
    color: #101d20;
    font-size: clamp(26px, 3vw, 35px);
    font-weight: 800;
    line-height: 1.12;
    font-variant-numeric: tabular-nums;
}
.ap-profile-card .ap-stats span {
    display: block;
    margin-top: 9px;
    color: #566b71;
    font-size: 12px;
    font-weight: 550;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.ap-profile-card .ap-metric-note {
    margin: 10px 1px 17px;
    color: #718085;
    font-size: 11px;
    line-height: 1.55;
}
.ap-profile-card .ap-bio {
    margin: 17px 0 0;
    color: #30484c;
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}
.ap-profile-card .ap-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding-top: 18px;
    margin-top: 19px;
    border-top: 1px solid #e7eeee;
}
.ap-profile-card .ap-socials {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
}
.ap-profile-card .ap-socials a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #087f75;
    font-size: 12px;
    font-weight: 700;
    text-underline-offset: 3px;
}
.ap-profile-card .ap-controls .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 9px 14px;
    white-space: normal;
    text-align: center;
}
.ap-author-posts {
    margin: 44px 0 56px;
}
.ap-author-posts > .section-head {
    margin-bottom: 24px;
}
.ap-author-posts > .section-head h2 {
    font-size: clamp(23px, 3vw, 30px);
    line-height: 1.25;
    letter-spacing: -.025em;
}
/* Four articles become a balanced 2 x 2 editorial grid instead of 3 + 1. */
.ap-author-posts .article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 31px 26px;
}
.ap-author-posts .article-grid > * {
    min-width: 0;
}
.ap-author-posts .article-grid img {
    width: 100%;
    object-fit: cover;
}
/* Keep member preview and edit form as tidy as the public page. */
.ap-editor {
    border-radius: 18px;
}
.ap-editor .ap-form-grid {
    gap: 16px 22px;
}
.ap-editor .ap-form-grid label {
    min-width: 0;
    line-height: 1.5;
}
.ap-editor input:focus-visible,
.ap-editor textarea:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}
@media (max-width: 800px) {
    .ap-profile-card .ap-cover {height: 156px;}
    .ap-author-posts .article-grid {gap: 22px 18px;}
}
@media (max-width: 620px) {
    .ap-profile-card {margin: 15px 0 29px; border-radius: 16px;}
    .ap-profile-card .ap-cover {height: 142px;}
    .ap-profile-card .ap-cover-label {
        top: 15px;
        left: 16px;
        max-width: calc(100% - 32px);
        font-size: 9px;
        letter-spacing: .10em;
        padding: 6px 9px;
    }
    .ap-profile-card .ap-profile-content {padding: 0 15px 22px;}
    .ap-profile-card .ap-identity {gap: 13px; margin-top: -31px;}
    .ap-profile-card .ap-avatar {
        width: 78px;
        height: 78px;
        flex: 0 0 78px;
        border-width: 4px;
        border-radius: 18px;
        font-size: 30px;
    }
    .ap-profile-card .ap-identity-copy {padding-top: 36px;}
    .ap-profile-card .ap-identity-copy h1 {
        font-size: clamp(22px, 6vw, 29px);
        margin-bottom: 8px;
    }
    .ap-profile-card .ap-profession {font-size: 13px; margin: 6px 0 3px;}
    .ap-profile-card .ap-expertise,
    .ap-profile-card .ap-location {font-size: 12px;}
    .ap-profile-card .ap-stats {gap: 7px; margin-top: 21px;}
    .ap-profile-card .ap-stats > div {min-height: 84px; padding: 12px 10px; border-radius: 10px;}
    .ap-profile-card .ap-stats strong {font-size: 25px;}
    .ap-profile-card .ap-stats span {font-size: 10px; margin-top: 6px;}
    .ap-profile-card .ap-bio {font-size: 13px;}
    .ap-profile-card .ap-controls {align-items: stretch; flex-direction: column;}
    .ap-profile-card .ap-socials {gap: 4px 15px;}
    .ap-profile-card .ap-controls .button {width: 100%;}
    .ap-author-posts {margin: 33px 0 42px;}
    .ap-author-posts .article-grid {grid-template-columns: 1fr;gap: 24px;}
    .ap-editor .ap-form-grid {grid-template-columns: 1fr;}
}
