/* Profile layout is independent of the selected palette. */
body.profile-page .public-profile .ribbon_graphic { margin-block-start: max(-122px, calc(8px - clamp(245px,31vw,432px) * .38)); }
@media (max-width: 768px) {
    body.profile-page .public-profile .ribbon_graphic { margin-block-start: -107px; }
}
@media (max-width: 400px) {
    body.profile-page .public-profile .ribbon_graphic { margin-block-start: -92px; }
}
body.profile-page .profile-publications { border-top: 0; margin-block-start: 62px; padding-block-start: 15px; }
body.profile-page .profile-publications .profile-story:first-child { border-top: 0; }

/* Use the profile owner's paper only here. The visitor's theme data is unchanged. */
html[data-profile-tone] {
    --editra-paper: var(--profile-paper);
    --editra-ink: #000;
    --inverse-color: #000 !important;
    background: var(--profile-paper);
    filter: none;
}
html[data-profile-tone] body.profile-page { background-color: var(--profile-paper); color: #000; }
html[data-profile-tone] body.profile-page :is(.public-magazine,.public-profile,.profile-publications,.profile-story,.post-excerpt,.profile-byline,.profile-city,.image-credit,.single-image-credit,figcaption,.index-title,.profile_name_title,.edition-picker,.public-profile-menu nav) { color: #000; }
html[data-profile-tone] body.profile-page :is(.public-profile,.profile-publications) a { color: inherit; }
/* Keep the image colors intact while adapting the monochrome interface. */
html[data-profile-tone] body.profile-page :is(img,video) { filter: none; }
html[data-profile-tone=dark] { filter: invert(1); }
html[data-profile-tone=dark] body.profile-page :is(img.profile-avatar,.profile-publications img,.public-profile-menu.has-profile-picture img,video) { filter: invert(1); }
html[data-profile-tone] body.profile-page .ribbon_graphic img { filter: none; }
html[data-profile-tone] body.profile-page .profile-portrait { background: color-mix(in srgb,var(--profile-paper) 85%,#000); }
html[data-profile-tone] body.profile-page .profile-portrait svg rect { fill: color-mix(in srgb,var(--profile-paper) 85%,#000); }
html[data-profile-tone] body.profile-page :is(.editra-control,.public-profile-menu nav,.edition-picker-desktop form,#consent.consent) { background-color: var(--profile-paper); }
html[data-profile-tone] body.profile-page :is(.editra-control,.public-profile-menu nav,.edition-picker-desktop form,#consent.consent) { color: #000; }
html[data-profile-tone] body.profile-page .note-record::after { background: var(--profile-paper); }

html[data-profile-tone] body.profile-page :is(#header,.public-profile-menu,.profile-publications .submission-credit) { color: #000; }
html[data-profile-tone] body.profile-page #header .editra-menu-icon { color: #000; }
html[data-profile-tone] body.profile-page #header .editra-menu-label { color: #000; }

/* Ink and dock borders are calculated in the pre-inversion palette. */
html[data-profile-tone] body.profile-page #consent.consent { color:#000; background:var(--profile-paper); border:1px solid #000; }
html[data-profile-tone] body.profile-page #consent .consent-actions :is(a,button) { color:#000 !important; }
html[data-profile-tone] body.profile-page #consent .consent-actions button { background:transparent; border:1px solid #000 !important; }
html[data-profile-tone] body.profile-page #consent .consent-actions button:hover { background:color-mix(in srgb,var(--profile-paper) 90%,#000); }
/* A contrasting monochrome navigation: black over light paper, white over dark. */
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column { background:#000 !important; color:#fff; --inverse-color:#fff; --background-color:#000; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column_nav_categories :is(a,button,input,.editra-menu-label,.editra-menu-icon,.search-clear) { color:#fff !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column_nav_categories input::placeholder { color:#ccc; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column_nav_categories .editra-menu-icon { opacity:1 !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_artwork_link svg :is(path,rect) { fill:#fff !important; stroke:none !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column_nav_categories .editra-search-icon :is(path,circle) { stroke:#fff !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header .edition-picker-mobile form { background:#000; color:#fff; }

/* Floating menus use the same opposing monochrome palette as the expanded rail.
   Dark profile pages invert this black/white pair along with the rest of the UI. */
html[data-profile-tone] body.profile-page #header :is(.edition-picker-desktop form,.public-profile-menu nav,.edition-picker-profile form) {
    background: #000 !important;
    color: #fff !important;
    border-color: #000;
    --editra-paper: #000;
    --editra-ink: #fff;
    --inverse-color: #fff;
}
html[data-profile-tone] body.profile-page #header :is(.edition-picker-desktop form,.public-profile-menu nav,.edition-picker-profile form) :is(a,button,summary,svg) {
    color: #fff !important;
}
html[data-profile-tone] body.profile-page #header .public-profile-menu nav .edition-picker-profile { color:#fff; border-color:#666; }
html[data-profile-tone] body.profile-page #header :is(.edition-picker-desktop form,.public-profile-menu nav,.edition-picker-profile form) :is(a,button,summary):is(:hover,:focus-visible) {
    background: transparent !important;
    color: #fff !important;
}

/* Opening the navigation never repaints the page or the full-width masthead. */
html[data-profile-tone] body.profile-page { background:var(--profile-paper) !important; color:#000 !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header .fresh_logo-wrapper { background:transparent !important; color:#000; }
html[data-profile-tone] body.profile-page.logo-column-open :is(.public-magazine,.profile-publications,#content) { color:#000 !important; }
html[data-profile-tone] body.profile-page.logo-column-open .ribbon_graphic img { filter:none !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header #logo_column_nav_categories #editra-menu-search-input { color:#fff !important; }
html[data-profile-tone] body.profile-page.logo-column-open #header :is(#menu_column,.public-profile-menu > summary,.edition-picker-desktop > summary) { color:#000; }
