:root {
    --page-width: 732px;
    --article-x: 21px;
    --text: rgba(0, 0, 0, 0.8);
    --muted: #79828b;
    --placeholder: rgba(0, 0, 0, 0.44);
    --line: #e8e8e8;
    --link: #168acd;
    --link-hover: #0e6faa;
    --danger: #b42318;
    --success: #15805d;
    --sans: -apple-system, BlinkMacSystemFont, "Lucida Grande", "Segoe UI", Arial, sans-serif;
    --serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --mono: Menlo, "Courier New", Courier, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    padding: 0;
    margin: 0;
    min-height: 100%;
    background: #fff;
}

body {
    color: var(--text);
    font-family: var(--sans);
}

button,
input,
textarea {
    font: inherit;
}

button,
input,
textarea,
[contenteditable="true"] {
    outline: 0;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: default;
    opacity: 0.55;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.page-wrap {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    min-height: 48px;
    border-bottom: 1px solid #f2f2f2;
    background: rgba(255, 255, 255, 0.96);
}

.article-body .topbar {
    display: none;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 var(--article-x);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #222;
    border-radius: 50%;
    color: #222;
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}

.topbar-title {
    color: #333;
    font-size: 14px;
    text-decoration: none;
}

.topbar-nav {
    margin-left: auto;
}

.topbar-nav a {
    color: var(--link);
    font-size: 14px;
    text-decoration: none;
}

.topbar-nav a:hover {
    color: var(--link-hover);
}

/* Home */
.home-page {
    padding: 70px 21px 90px;
}

.home-hero h1 {
    margin: 0 0 12px;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 700;
    font-style: normal;
    line-height: 34px;
}

.lead {
    margin: 0 0 22px;
    color: var(--placeholder);
    font-family: var(--sans);
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
}

.button,
.publish-button,
.text-button {
    appearance: none;
    border: 0;
    background: transparent;
    text-decoration: none;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 4px 12px;
    border: 2px solid #333;
    border-radius: 16px;
    background: #fff;
    color: #000;
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 600;
    line-height: 20px;
    text-transform: uppercase;
}

.button:hover {
    border-color: #000;
}

.recent {
    margin-top: 54px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.recent h2 {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-list {
    display: grid;
    gap: 2px;
}

.article-card {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f4f4f4;
    text-decoration: none;
}

.article-card:hover .article-card-title {
    color: var(--link);
}

.article-card-title,
.article-card-description {
    display: block;
}

.article-card-title {
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
}

.article-card-description {
    margin-top: 4px;
    color: var(--muted);
    font-size: 15px;
    line-height: 18px;
}

/* Password access */
.access-page {
    padding: 70px 21px 90px;
}

.access-form {
    max-width: 360px;
}

.access-form h1 {
    margin: 0 0 12px;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 700;
    line-height: 34px;
}

.access-form p {
    margin: 0 0 18px;
    color: var(--placeholder);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 22px;
}

.password-input {
    display: block;
    width: 100%;
    margin: 0 0 14px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #d8d8d8;
    background: transparent;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 20px;
    line-height: 26px;
}

.password-input::placeholder {
    color: var(--placeholder);
}

.access-error {
    margin: -4px 0 12px;
    color: var(--danger);
    font-size: 14px;
    line-height: 18px;
}

/* Editor */
.editor-body .topbar {
    border-bottom-color: transparent;
}

.editor-page {
    padding: 21px 0 90px;
}

.article-form {
    margin: 0;
}

.editor-actionbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 46px;
    margin: -21px 0 0;
    padding: 8px 21px;
    border-bottom: 1px solid rgba(240, 240, 240, 0.78);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.editor-mode,
.editor-hint,
.form-status {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 13px;
    line-height: 16px;
}

.editor-mode {
    white-space: nowrap;
}

.editor-actionbar-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.text-button,
.publish-button {
    padding: 0;
    color: var(--link);
    font-size: 14px;
    line-height: 18px;
}

.text-button:hover,
.publish-button:hover {
    color: var(--link-hover);
}

.publish-button {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.title-input {
    display: block;
    width: calc(100% - 42px);
    margin: 21px 21px 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 700;
    font-style: normal;
    line-height: 34px;
}

.title-input::placeholder {
    color: var(--placeholder);
}

.editor-hint {
    margin: 0 21px 12px;
}

.editorjs {
    min-height: 470px;
    padding: 0 0 30px;
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.58;
}

.codex-editor,
.ce-block__content,
.ce-toolbar__content {
    max-width: 100%;
}

.ce-block__content {
    padding: 0 21px;
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.58;
}

.ce-paragraph {
    line-height: 1.58;
}

.ce-header {
    padding: 0;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
}

h2.ce-header,
.ce-header[data-level="2"] {
    font-size: 28px;
}

h3.ce-header,
h4.ce-header,
.ce-header[data-level="3"],
.ce-header[data-level="4"] {
    font-size: 24px;
}

.ce-toolbar__content {
    padding: 0 21px;
}

.ce-toolbar__plus,
.ce-toolbar__settings-btn {
    color: #9b9b9b;
}

.cdx-list {
    padding-left: 0;
}

.image-tool__image-picture {
    display: block;
    width: 100%;
    vertical-align: top;
}

.image-tool__caption,
.cdx-quote__caption {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 18px;
    text-align: center;
}

.form-actions {
    min-height: 22px;
    margin: 4px 21px 0;
}

.form-status[data-type="error"] {
    color: var(--danger);
}

.form-status[data-type="success"] {
    color: var(--success);
}

body.modal-open {
    overflow: hidden;
}

.publish-result[hidden] {
    display: none;
}

.publish-result {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 21px;
}

.publish-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
}

.publish-modal {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 26px 28px 24px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 28px;
    line-height: 28px;
}

.modal-close:hover {
    color: #000;
}

.publish-modal h2 {
    margin: 0 32px 10px 0;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
}

.modal-note {
    margin: 0 0 18px;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 20px;
}

.modal-link-group {
    margin-top: 16px;
}

.modal-link-group span {
    display: block;
    margin-bottom: 5px;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
}

.modal-link-group a {
    display: block;
    overflow-wrap: anywhere;
    color: var(--link);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 20px;
}

.copy-button {
    margin: 7px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--link);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 18px;
}

.copy-button:hover {
    color: var(--link-hover);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .button {
    margin: 0;
}

.button-muted {
    color: var(--muted);
    border-color: #d8d8d8;
}

.button-muted:hover {
    color: #000;
    border-color: #999;
}

/* Public article: Telegraph-like sizing */
.article-page {
    padding: 21px 0 90px;
}

.article-head {
    word-wrap: break-word;
}

.article-head h1 {
    margin: 21px 21px 12px;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 700;
    font-style: normal;
    line-height: 34px;
}

.article-head time {
    display: block;
    margin: 12px 21px;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 15px;
    font-style: normal;
    line-height: 18px;
}

.article-content {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.58;
    white-space: normal;
}

.article-content p {
    margin: 0 21px 12px;
    word-wrap: break-word;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 18px 21px 9px;
    color: rgba(0, 0, 0, 0.84);
    font-family: var(--sans);
    font-weight: 700;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: 0;
}

.article-content h2,
.article-content h3 {
    font-size: 28px;
}

.article-content h4 {
    margin-bottom: 7px;
    font-size: 24px;
}

.article-content ul,
.article-content ol {
    margin: 21px;
    padding: 0;
    list-style-position: outside;
}

.article-content li {
    margin: 0 0 14px 30px;
    padding: 0;
    word-wrap: break-word;
}

.article-content a[href] {
    color: inherit;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.44);
    text-decoration: underline;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.16em;
}

.article-content blockquote {
    margin: 18px 21px 16px 0;
    padding-left: 15px;
    border-left: 3px solid #000;
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    font-style: italic;
    line-height: 1.58;
    word-wrap: break-word;
}

.article-content blockquote p {
    margin: 0;
}

.article-content blockquote cite {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 15px;
    font-style: normal;
    line-height: 18px;
}

.article-content figure {
    margin: 0 21px 16px;
    padding: 0;
    position: relative;
    text-align: center;
}

.article-content img,
.article-content video,
.article-content iframe {
    max-width: 100%;
    vertical-align: top;
}

.article-content img {
    max-width: 100%;
    height: auto;
}

.article-content figcaption {
    padding: 12px 21px 0;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 18px;
    text-align: center;
    vertical-align: top;
}

.article-content hr {
    width: 50%;
    height: 1px;
    margin: 30px auto;
    border: 0;
    background: #c9cdd1;
}

.article-image--border {
    border: 1px solid var(--line);
}

.article-image--stretched {
    width: min(920px, calc(100vw - 42px));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.article-content code,
.article-content pre {
    background: #f5f8fc;
    font-family: var(--mono);
    font-size: 16px;
}

.article-content code {
    padding: 1px 3px;
}

.article-content pre {
    margin: 14px 0;
    padding: 7px 21px;
    overflow-x: auto;
    color: var(--text);
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.article-content pre code {
    padding: 0;
    background: transparent;
}

@media (max-width: 760px) {
    .page-wrap {
        max-width: none;
    }

    .topbar-title {
        display: none;
    }
}

@media (max-width: 620px) {
    .editor-actionbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .editor-actionbar-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .ce-toolbar__actions {
        right: 0;
    }
}
