@forward "../shared/paper-texture";
@forward "../shared/workleaves";
@forward "../shared/markdown-container";
@forward "../shared/file-margins";

.newspaper {
    background-color: var(--workleaves-background);
    background-image: var(--paper-texture);
    background-size: 500px;
    background-blend-mode: multiply;
}

.newspaper {
    --inline-title-font: "Playfair Display", Georgia, "Times New Roman", Times, serif;
    --page-title-font: "Playfair Display", Georgia, "Times New Roman", Times, serif;
    --inline-title-padding-top: var(--inline-title-margin-bottom);

    --bold-modifier: 500;
    --font-text: Spectral, "Times New Roman", Times, serif;
    --h1-font: "Times New Roman", Times, serif;
    --h1-color: var(--text-normal);
    --h1-background: transparent;
    --h1-style: italic;
    --h1-weight: var(--font-semibold);
    --h1-variant: small-caps;
    --metadata-border-width: 0;
    --image-shadow-offset: 0;
}

.newspaper .metadata-container {
    outline: none;
}
.newspaper .metadata-properties-heading {
    --heading-padding-inline: var(--size-4-1);
    position: relative;
    top: unset;
    transform: none;
    background: none;
}
.newspaper .metadata-properties-heading .collapse-indicator {
    inset-inline-start: -22px;
}

.newspaper :is(.inline-title, .page-header) {
    text-align: center;
}

.newspaper :is(.inline-title, .page-header)::after {
    content: "";
    display: block;
    padding-top: var(--inline-title-padding-top);
    border-bottom: 2px solid var(--text-normal);
    width: calc(100cqw + 2 * var(--file-margins-inline));
    margin-left: calc(50% - 50cqw - var(--file-margins-inline));
}

@container style(--metadata-display-reading: block) {
    :is(.newspaper.show-properties.markdown-preview-view .mod-header)::after {
        content: "";
        display: block;
        border-bottom: 2px solid var(--text-normal);
        width: calc(100cqw + 2 * var(--file-margins-inline));
        margin-left: calc(50% - 50cqw - var(--file-margins-inline));
    }

    :is(.newspaper.show-properties.markdown-preview-view .mod-header) {
        margin-bottom: var(--p-spacing);
    }
}

@container style(--metadata-display-editing: block) {
    :is(.newspaper.show-properties.markdown-source-view .cm-contentContainer)::before {
        content: "";
        position: absolute;
        border-bottom: 2px solid var(--text-normal);
        left: 0;
        right: 0;
    }
}

.newspaper .mod-frontmatter + div ~ div > h1,
.newspaper .cm-content > .cm-line ~ .HyperMD-header-1 {
    border-top: 1px solid var(--text-normal);
}

.newspaper.markdown-preview-view h1 {
    width: fit-content;
    min-width: 300px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 50px;
    padding-right: 50px;
    text-align: center;
}

.newspaper img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

.newspaper p {
    text-align: justify;
}
