/* Defaults and saved controls sit below ordinary custom CSS. */
@layer profileDefaults, profileSettings;
@layer profileDefaults {
/* SHARED PROFILE DISPLAY
   Design controls update these variables on .profile-preview.
   Keep selectors scoped so they never restyle the account controls. */

html {
    font-family: degular, sans-serif;
}

p {
    font-family: degular, sans-serif;
}

h2 {
    font-family: degular, sans-serif;
    font-weight:bold;
}

section.profile-section.content-width {
    max-width: 800px;
}

.profile-section--text_section {
    max-width:unset !important;
}

/* PAGE LOGO: change these three mappings to try different author colors. */
#pageIcon {
    --logo-front-color: var(--profile-background, #fff);
    --logo-back-color: var(--profile-rule-color, #d4dce8);
    --logo-outline-color: var(--profile-header-text-color, #333);
    width: 70px;
    max-width: 100%;
    height: auto;
    float:left;
}

#pageIcon .logo-front { fill: var(--profile-margin-color); opacity:.3;}
#pageIcon .logo-back { 
    fill:none;
    /* fill: var(--logo-back-color); */
}
#pageIcon .logo-outline { 
    fill: var(--logo-outline-color); 
}

header.profile-header {
    color: var(--profile-header-text-color, var(--profile-text-color, #333333));
    background: var(--profile-header-background, transparent);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 5em 5vw !important;
    text-align: center;
}

.headerPadding {
    padding:12vw 5vw;
}

a#nextRandomButton {
    padding: .5em 1em !important;
    border-radius: 100px;
    text-decoration: none;
    font-family: 'degular';
    color:white !important;
    box-shadow: 0 0 20px white;
}

#leftRule {
    position: fixed;
    left: 0;
    width: 80px;
    border-right: 1px solid var(--profile-margin-color, #ffc0cb);
    opacity: var(--profile-line-opacity, 30%);
    top: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.profile-preview {
    --profile-line-opacity: 30%;
    --profile-background: #ffffff;
    --profile-text-color: #333333;
    --profile-content-width: 800px;
    --profile-wide-width: 1040px;
    --profile-gutter: 24px;
    background-color: var(--profile-background);
    color: var(--profile-text-color);
}
.profile-preview :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, figcaption) {
    color: inherit;
}

.profile-preview figure { margin: 0; }
.profile-preview img { display: block; max-width: 100%; height: auto; }
.profile-preview .profile-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.profile-preview .profile-gallery-item { flex: 1 1 240px; min-width: 0; }
.profile-preview .profile-embed iframe { display: block; width: 100%; border: 0; }
.profile-preview .profile-embed iframe:is([src*="youtube.com/"], [src*="youtube-nocookie.com/"]) {
    height: auto;
    aspect-ratio: 16 / 9;
}

.profile-image img {
    width:100%;
    float:left;
}

.profile-sections {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items:center;
}

section.profile-section {
    width: 100% !important;
    max-width: none;
    margin: 0;
}

section.profile-section:last-child {
    margin-bottom: 8em;
}

div#designTab {
    background: white;
    right: 0;
    width: 300px;
    border-bottom-left-radius:10px;
}



.profile-text {
    --text-size: 22px;
    --line-spacing: 1.8;
    --heading-line-spacing: 1.25;
    --rule-color: color-mix(in srgb, var(--profile-rule-color, #d4dce8) var(--profile-line-opacity, 30%), transparent);
    --rule-thickness: 1px;
    --content-width: 800px;
    --page-gutter: 24px;

    font-size: var(--text-size);
    /* A unitless multiplier scales with each element's own font size. */
    line-height: var(--line-spacing);
}

/* Shared full-width paper, with readable-width text inside. */
.profile-text :is(p, h1, h2, h3, h4, h5, h6) {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    padding-inline: max(var(--page-gutter), calc((100% - var(--content-width)) / 2));
    margin: 0 0 1.8em;
    margin-bottom: 1lh;
    padding-block: 0;
}

/* Paragraph rules repeat at the paragraph's actual line height. */
.profile-text p {
    font-size: inherit;
    line-height: var(--line-spacing);
    --rule-spacing: calc(1em * var(--line-spacing));
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(var(--rule-spacing) - var(--rule-thickness)),
        var(--rule-color) calc(var(--rule-spacing) - var(--rule-thickness)),
        var(--rule-color) var(--rule-spacing)
    );
}
@supports (height: 1lh) {
    .profile-text p { --rule-spacing: 1lh; }
}

/* One rule beneath the complete heading, regardless of wrapping. */
.profile-text :is(h1, h2, h3, h4, h5, h6) {
    line-height: var(--heading-line-spacing);
    padding-bottom: .25em;
    background-image: linear-gradient(var(--rule-color), var(--rule-color));
    background-size: 100% var(--rule-thickness);
    background-position: left bottom;
    background-repeat: no-repeat;
}
.profile-text h2 { font-size: var(--heading-size, 1.8em); }
} /* End profileDefaults. */

/* Alternate palette is ready for a section toggle or custom CSS class. */
@layer profileSettings {
    .profile-preview .profile-section.use-alternate-colors {
        --profile-text-color: var(--profile-text-color-invert, #ffffff);
        --profile-rule-color: var(--profile-rule-color-invert, #d4dce8);
        --profile-margin-color: var(--profile-margin-color-invert, #ffc0cb);
        color: var(--profile-text-color);
    }
}

/* Regular sections use half the background-boundary spacing on each side.
   Background changes replace that padding with the full amount, rather than adding to it. */
@layer profileDefaults {
    .profile-preview { --section-background-padding: clamp(24px, 4vw, 64px); }
    .profile-preview .profile-section {
        padding-block: calc(var(--section-background-padding) / 2);
    }
    .profile-section.bg-change-top {
        padding-top: var(--section-background-padding);
    }
    .profile-section.bg-change-bottom {
        padding-bottom: var(--section-background-padding);
    }
    /* Full-width photos remain edge-to-edge; their neighbors provide the spacing. */
    section.profile-section.profile-section--image_section.full-width {
        padding: 0;
    }
}

/* The header participates in background boundaries while keeping its base spacing. */
@layer profileDefaults {
    .profile-preview > .profile-header.bg-change-bottom {
        padding-bottom: calc(var(--profile-header-padding, 12vw) + var(--section-background-padding));
    }
}

/* Profile typography: selected families only; custom CSS can override these defaults. */
@layer profileDefaults {
    :is(.profile-preview, .profile-font-scope),
    :is(.profile-preview, .profile-font-scope) :is(p, li, blockquote, figcaption, .profile-byline, .profile-button) {
        font-family: var(--profile-body-font, degular, sans-serif);
    }
    :is(.profile-preview, .profile-font-scope) :is(h1, h2, h3, h4, h5, h6) {
        font-family: var(--profile-heading-font, degular, sans-serif);
        line-height: var(--heading-line-spacing, 1.25);
    }
}

/* Common Page conversations — outside the user-styled page content. */
.common-comments {
    box-sizing: border-box;
    width: min(720px, calc(100% - 48px));
    margin: 5rem auto;
    padding-block: 2rem;
    border-top: 1px solid #d5d5d5;
    color: #222;
    background: #fff;
    font-family: degular, sans-serif;
    line-height: 1.5;
}
.common-comments *, .common-comments *::before, .common-comments *::after { box-sizing: border-box; }
.common-comments h2 { font: inherit; font-size: 2rem; font-weight: 700; }
.common-comments-list { list-style: none; margin: 2rem 0; padding: 0; }
.common-comments-list > li { padding-block: 1.5rem; border-bottom: 1px solid #e5e5e5; }
.common-comments time, .common-comment-pending { display: block; font-size: .875rem; color: #666; }
.common-comment-text { margin-top: .75rem; overflow-wrap: anywhere; }
.common-comment-form { display: grid; gap: .75rem; margin-top: 2rem; }
.common-comment-form textarea { width: 100%; min-height: 120px; resize: vertical; padding: 1rem; border: 1px solid #aaa; border-radius: 12px; font: inherit; color: #222; background: #fff; }
.common-comments button { width: fit-content; padding: .6rem 1.1rem; border: 1px solid #222; border-radius: 100px; background: #222; color: #fff; font: inherit; cursor: pointer; }
.common-comment-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.common-comment-actions button { font-size: .875rem; background: #fff; color: #222; }
.common-comment-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.common-comments a { color: inherit; text-decoration: underline; }
.common-comments :is(button, a, textarea):focus-visible { outline: 2px solid #176daa; outline-offset: 3px; }
