@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    html {
        font-family: "Pretendard", system-ui, sans-serif;
    }

    body {
        color: var(--text);
        background-color: var(--bg);
    }
}

@layer components {
    .prose {
        color: var(--tw-prose-body);
        /* max-width: 65ch; */
        font-size: 1rem;
        line-height: 1.75;
    }

    .prose-theme {
        --tw-prose-body: var(--text);
        --tw-prose-headings: var(--text);
        --tw-prose-lead: var(--text-soft);
        --tw-prose-links: var(--text);
        --tw-prose-bold: var(--text);
        --tw-prose-counters: var(--text-soft);
        --tw-prose-bullets: var(--border-strong);
        --tw-prose-hr: var(--border);
        --tw-prose-quotes: var(--text);
        --tw-prose-quote-borders: var(--border);
        --tw-prose-captions: var(--text-soft);
        --tw-prose-kbd: var(--text);
        --tw-prose-kbd-shadows: color-mix(in srgb, var(--text) 10%, transparent);
        --tw-prose-code: var(--text);
        --tw-prose-pre-code: #f8f5f0;
        --tw-prose-pre-bg: #26221f;
        --tw-prose-th-borders: var(--border-strong);
        --tw-prose-td-borders: var(--border);
    }

    .prose :where(p):not(:where(.not-prose, .not-prose *)) {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
    }

    .prose :where(a):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-links);
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 0.12em;
    }

    .prose :where(strong):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-bold);
        font-weight: 600;
    }

    .prose :where(ol):not(:where(.not-prose, .not-prose *)) {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
        padding-inline-start: 1.625em;
        list-style-type: decimal;
    }

    .prose :where(ul):not(:where(.not-prose, .not-prose *)) {
        margin-top: 1.25em;
        margin-bottom: 1.25em;
        padding-inline-start: 1.625em;
        list-style-type: disc;
    }

    .prose :where(ol > li):not(:where(.not-prose, .not-prose *))::marker {
        color: var(--tw-prose-counters);
        font-weight: 400;
    }

    .prose :where(ul > li):not(:where(.not-prose, .not-prose *))::marker {
        color: var(--tw-prose-bullets);
    }

    .prose :where(li):not(:where(.not-prose, .not-prose *)) {
        margin-top: 0.5em;
        margin-bottom: 0.5em;
    }

    .prose :where(ol > li, ul > li):not(:where(.not-prose, .not-prose *)) {
        padding-inline-start: 0.375em;
    }

    .prose :where(hr):not(:where(.not-prose, .not-prose *)) {
        border-color: var(--tw-prose-hr);
        border-top-width: 1px;
        margin-top: 3em;
        margin-bottom: 3em;
    }

    .prose :where(blockquote):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-quotes);
        border-inline-start-width: 0.25rem;
        border-inline-start-color: var(--tw-prose-quote-borders);
        margin-top: 1.6em;
        margin-bottom: 1.6em;
        padding-inline-start: 1em;
        font-style: italic;
        font-weight: 500;
    }

    .prose :where(h1):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-headings);
        margin-top: 0;
        margin-bottom: 0.888889em;
        font-size: 2.25em;
        font-weight: 800;
        line-height: 1.11111;
    }

    .prose :where(h2):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-headings);
        margin-top: 2em;
        margin-bottom: 1em;
        font-size: 1.5em;
        font-weight: 700;
        line-height: 1.33333;
    }

    .prose :where(h3):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-headings);
        margin-top: 1.6em;
        margin-bottom: 0.6em;
        font-size: 1.25em;
        font-weight: 600;
        line-height: 1.6;
    }

    .prose :where(h4):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-headings);
        margin-top: 1.5em;
        margin-bottom: 0.5em;
        font-weight: 600;
        line-height: 1.5;
    }

    .prose :where(img, picture, video):not(:where(.not-prose, .not-prose *)) {
        margin-top: 2em;
        margin-bottom: 2em;
    }

    .prose :where(picture):not(:where(.not-prose, .not-prose *)) {
        display: block;
    }

    .prose :where(picture > img):not(:where(.not-prose, .not-prose *)) {
        margin-top: 0;
        margin-bottom: 0;
    }

    .prose :where(figure):not(:where(.not-prose, .not-prose *)) {
        margin-top: 2em;
        margin-bottom: 2em;
    }

    .prose :where(figure > *):not(:where(.not-prose, .not-prose *)) {
        margin-top: 0;
        margin-bottom: 0;
    }

    .prose :where(figcaption):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-captions);
        margin-top: 0.857143em;
        font-size: 0.875em;
        line-height: 1.42857;
    }

    .prose :where(code):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-code);
        font-size: 0.875em;
        font-weight: 600;
    }

    .prose :where(code):not(:where(.not-prose, .not-prose *))::before,
    .prose :where(code):not(:where(.not-prose, .not-prose *))::after {
        content: "`";
    }

    .prose :where(pre):not(:where(.not-prose, .not-prose *)) {
        color: var(--tw-prose-pre-code);
        background-color: var(--tw-prose-pre-bg);
        padding: 0.857143em 1.14286em;
        border-radius: 0.375rem;
        margin-top: 1.71429em;
        margin-bottom: 1.71429em;
        font-size: 0.875em;
        font-weight: 400;
        line-height: 1.71429;
        overflow-x: auto;
    }

    .prose :where(pre code):not(:where(.not-prose, .not-prose *)) {
        font-weight: inherit;
        color: inherit;
        font-size: inherit;
        background-color: transparent;
        padding: 0;
    }

    .prose :where(pre code):not(:where(.not-prose, .not-prose *))::before,
    .prose :where(pre code):not(:where(.not-prose, .not-prose *))::after {
        content: none;
    }

    .prose :where(table):not(:where(.not-prose, .not-prose *)) {
        table-layout: auto;
        width: 100%;
        margin-top: 2em;
        margin-bottom: 2em;
        font-size: 0.875em;
        line-height: 1.71429;
    }

    .prose :where(thead):not(:where(.not-prose, .not-prose *)) {
        border-bottom-width: 1px;
        border-bottom-color: var(--tw-prose-th-borders);
    }

    .prose :where(tbody tr):not(:where(.not-prose, .not-prose *)) {
        border-bottom-width: 1px;
        border-bottom-color: var(--tw-prose-td-borders);
    }

    .prose :where(th, td):not(:where(.not-prose, .not-prose *)) {
        text-align: start;
        padding: 0.571429em;
    }

    .prose :where(.prose > :first-child):not(:where(.not-prose, .not-prose *)) {
        margin-top: 0;
    }

    .prose :where(.prose > :last-child):not(:where(.not-prose, .not-prose *)) {
        margin-bottom: 0;
    }
}

@layer utilities {
    [x-cloak] {
        display: none !important;
    }

    .rounded-theme {
        border-radius: 18px;
    }

    .border-brd {
        border-color: var(--border);
    }

    .bg-bgr-tone {
        background-color: var(--surface-muted);
    }

    .text-typ {
        color: var(--text);
    }

    .text-typ-tone {
        color: var(--text-soft);
    }

    .bg-accent {
        background: var(--color-accent);
    }

    .bg-accent\/10 {
        background-color: color-mix(in srgb, var(--color-accent) 10%, transparent);
    }

    .hover\:bg-accent\/5:hover {
        background-color: color-mix(in srgb, var(--color-accent) 5%, transparent);
    }

    .text-accent {
        color: var(--color-accent);
    }

    .gap-0\.75 {
        gap: 0.1875rem;
    }

    .flex-2 {
        flex: 2 1 0%;
    }

    .flex-3 {
        flex: 3 1 0%;
    }

    .flex-4 {
        flex: 4 1 0%;
    }

    .size-3\.5 {
        width: 0.875rem;
        height: 0.875rem;
    }

    .size-4 {
        width: 1rem;
        height: 1rem;
    }

    .min-w-16 {
        min-width: 4rem;
    }

    .max-w-content {
        max-width: var(--content-header);
    }

    .divide-brd > :not([hidden]) ~ :not([hidden]) {
        border-color: var(--border);
    }

    .line-clamp-1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
