/* Media Dream typography overrides for the official Ghost Source theme. */
@import url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy/Paperlogy.css');
@import url('https://cdn.jsdelivr.net/gh/fonts-archive/Paperlogy/Paperlogy.css');
@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

:root {
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body,
button,
input,
textarea,
select {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 400 !important;
}

h1,
h3,
h4,
h5,
h6,
.gh-card-title,
.gh-header-title,
.gh-article-title,
.gh-footer-signup-header,
.gh-navigation-logo {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 900 !important;
}

h2,
.gh-content h2,
.gh-article-excerpt,
.gh-header-subhead,
.gh-footer-signup-subhead {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 600 !important;
}

.gh-content p,
.gh-content li,
.gh-card-excerpt,
.gh-card-meta,
.gh-header-description,
.gh-footer-signup-description {
    font-weight: 400 !important;
}

.md-post-metrics {
    display: flex;
    align-items: center;
    color: var(--color-secondary-text, #6b7280);
}

/* Paperlogy headings + Pretendard body for readable Korean long-form content. */
:root {
    --font-sans: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body,
button,
input,
textarea,
select,
.gh-content,
.gh-content p,
.gh-content li,
.gh-card-excerpt,
.gh-article-excerpt,
.gh-header-description,
.gh-footer-signup-description {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.gh-card-title,
.gh-article-title,
.gh-navigation-logo,
.gh-footer-signup-header {
    font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.md-post-metrics-top {
    justify-content: flex-start;
    gap: 14px;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 15px;
}

.md-post-metrics-bottom {
    justify-content: center;
    gap: 22px;
    margin: 40px auto 8px;
    font-size: 16px;
}

.md-post-metrics-card {
    gap: 11px;
    margin-top: 13px;
    font-size: 14px;
}

.md-post-metric-item,
.md-post-like,
.md-post-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.md-post-metric-icon {
    line-height: 1;
    font-size: 18px;
}

.md-post-like {
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 999px;
    padding: 11px 18px;
    color: inherit;
    font-size: 16px;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.md-post-like:hover,
.md-post-like:focus-visible,
.md-post-like.is-liked {
    border-color: #d85858;
    color: #b42318;
}

.md-post-like:hover {
    transform: translateY(-1px);
}

.md-post-like.is-liked {
    background: #fff1f1;
}

.md-post-like:disabled {
    cursor: wait;
    opacity: 0.65;
}

.md-post-like-heart {
    font-size: 25px;
    line-height: 0.8;
}

.md-post-views {
    font-size: 16px;
}

.md-post-metric-count {
    font-variant-numeric: tabular-nums;
    font-size: inherit;
    font-weight: 700;
}

body .gh-content h2 {
    font-family: 'Paperlogy', 'Pretendard', sans-serif !important;
    font-weight: 600 !important;
}

body .gh-content h3 {
    font-family: 'Paperlogy', 'Pretendard', sans-serif !important;
    font-weight: 900 !important;
}

.gh-content a[data-wiki-link],
.gh-content a[data-wiki-concept] {
    color: var(--ghost-accent-color);
    font-weight: 700;
    text-decoration-color: color-mix(in srgb, var(--ghost-accent-color) 42%, transparent);
    text-decoration-style: dashed;
    text-underline-offset: 0.22em;
}

.gh-content a[data-wiki-link]::before,
.gh-content a[data-wiki-concept]::before {
    content: '↗ ';
    font-size: 0.82em;
}

/* Post navigation: a document-style right rail on desktop and a compact outline on mobile. */
.md-post-layout {
    position: relative;
}

.md-post-aside {
    display: none;
}

.md-post-discovery {
    margin-top: 96px;
}

.md-post-discovery + .md-post-discovery {
    margin-top: 64px;
}

.md-post-discovery-heading {
    margin-bottom: 24px;
}

.md-post-discovery-heading p,
.md-post-aside-eyebrow {
    margin: 0 0 6px;
    color: var(--ghost-accent-color);
    font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.md-post-discovery-heading h2,
.md-post-aside h2 {
    margin: 0;
    font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(2.2rem, 1.8vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.md-post-discovery-empty {
    margin: 0;
    color: var(--color-secondary-text);
    font-size: 1.6rem;
}

.md-post-discovery-feed {
    display: flex !important;
    gap: var(--grid-gap);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 0 0 18px;
    scroll-snap-type: inline mandatory;
    scrollbar-color: var(--ghost-accent-color) transparent;
    scrollbar-width: thin;
}

.md-post-discovery-feed > [data-related-candidate] {
    flex: 0 0 calc((100% - var(--grid-gap) * 3) / 4);
    min-width: 248px;
    scroll-snap-align: start;
}

@media (min-width: 1180px) {
    .post-template .md-post-layout {
        display: grid;
        grid-template-columns: minmax(0, 1120px) 260px;
        column-gap: 32px;
        margin: 0 auto;
        max-width: 1440px;
        width: calc(100% - 32px);
    }

    .post-template .md-post-layout .gh-article {
        min-width: 0;
    }

    .post-template .md-post-layout .gh-article .gh-canvas {
        --container-width: 1120px;
    }

    .md-post-aside {
        display: grid;
        align-self: start;
        grid-template-rows: minmax(250px, 320px) auto;
        height: auto;
        position: sticky;
        top: 24px;
        margin-top: 136px;
        padding: 16px 0 18px 18px;
        border-left: 1px solid var(--color-border);
        overflow: visible;
    }

    .md-post-graph,
    .md-post-toc {
        min-height: 0;
        padding-bottom: 18px;
    }

    .md-post-graph {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        position: relative;
    }

    .md-post-toc {
        border-top: 1px solid var(--color-border);
        padding-top: 22px;
        overflow: visible;
    }

    .md-post-aside h2 {
        font-size: 1.8rem;
    }

    .md-post-graph-canvas {
        height: auto;
        min-height: 200px;
        margin: 10px 0 8px;
        width: 100%;
        border: 1px solid #332c3b;
        border-radius: 6px;
        background:
            radial-gradient(circle at 1px 1px, rgba(208, 190, 220, 0.14) 1px, transparent 0) 0 0 / 18px 18px,
            radial-gradient(circle at center, rgba(255, 78, 150, 0.08), transparent 62%),
            #1b1820;
        cursor: grab;
        overflow: hidden;
    }

    .md-post-graph-empty {
        margin: 0;
        color: var(--color-secondary-text);
        font-size: 1.25rem;
        line-height: 1.5;
    }

    .md-post-graph-controls {
        display: flex;
        gap: 5px;
        position: absolute;
        right: 8px;
        top: 62px;
        pointer-events: none;
        z-index: 2;
    }

    .md-post-graph-controls button {
        align-items: center;
        background: rgba(35, 29, 42, 0.92);
        border: 1px solid #55495e;
        border-radius: 4px;
        color: #e6dce9;
        cursor: pointer;
        display: inline-flex;
        font-family: 'Paperlogy', sans-serif;
        font-size: 13px;
        height: 25px;
        justify-content: center;
        pointer-events: auto;
        width: 25px;
    }

    .md-post-graph-controls button:hover,
    .md-post-graph-controls button:focus-visible {
        background: var(--ghost-accent-color);
        border-color: var(--ghost-accent-color);
        color: #fff;
    }

    .md-post-graph-controls [data-graph-expand] {
        width: auto;
        padding-inline: 9px;
    }

    .md-post-toc ol {
        display: grid;
        gap: 7px;
        margin: 14px 0 0;
        padding: 0;
        list-style: none;
    }

    .md-post-toc a {
        display: block;
        color: var(--color-secondary-text);
        font-size: 1.35rem;
        line-height: 1.45;
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .md-post-toc a:hover,
    .md-post-toc a:focus-visible,
    .md-post-toc a[aria-current='location'] {
        color: var(--ghost-accent-color);
        font-weight: 700;
    }

}

.md-post-graph,
.md-post-graph h2,
.md-post-graph p,
.md-post-graph button {
    font-family: 'Paperlogy', sans-serif !important;
    font-weight: 200 !important;
}

.md-post-graph-dialog {
    width: calc(100vw - 48px);
    height: calc(100dvh - 48px);
    max-width: 1600px;
    max-height: none;
    margin: auto;
    padding: 24px;
    border: 1px solid #55495e;
    border-radius: 12px;
    background: #1b1820;
    color: #e6dce9;
}

.md-post-graph-dialog::backdrop {
    background: rgb(8 6 12 / 78%);
}

.md-post-graph-dialog .md-post-graph {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    position: relative;
    height: 100%;
    padding: 0;
}

.md-post-graph-dialog .md-post-aside-heading h2 {
    margin: 0;
    font-size: 22px;
    color: #e6dce9;
}

.md-post-graph-dialog .md-post-graph-canvas {
    width: 100%;
    min-height: 0;
    margin-top: 20px;
    overflow: hidden;
    background: radial-gradient(circle at 1px 1px, rgb(208 190 220 / 14%) 1px, transparent 0) 0 0 / 18px 18px, #1b1820;
}

.md-post-graph-dialog .md-post-graph-controls {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    gap: 6px;
}

.md-post-graph-dialog .md-post-graph-controls button {
    min-width: 40px;
    width: auto;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #55495e;
    border-radius: 5px;
    background: #231d2a;
    color: #e6dce9;
    font-size: 14px;
    cursor: pointer;
}

.md-post-graph-dialog button:focus-visible {
    outline: 2px solid #ff76b3;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .md-post-graph-dialog { width: 100vw; height: 100dvh; padding: 16px; border-radius: 0; }
    .md-post-graph-dialog .md-post-aside-heading { padding-bottom: 48px; }
    .md-post-graph-dialog .md-post-graph-controls { top: 60px; }
}

@media (max-width: 1179px) {
    .md-post-aside {
        display: block;
        margin: 0 auto 34px;
        max-width: min(720px, calc(100% - 40px));
    }

    .md-post-graph {
        display: none;
    }

    .md-post-toc {
        border: 1px solid var(--color-border);
        border-radius: 14px;
        padding: 18px 20px;
    }

    .md-post-toc h2 {
        font-size: 2rem;
    }

    .md-post-toc ol {
        display: grid;
        gap: 8px;
        margin: 14px 0 0;
        padding: 0;
        list-style: none;
    }

    .md-post-toc a {
        color: var(--color-secondary-text);
        font-size: 1.4rem;
        line-height: 1.45;
        text-decoration: none;
    }

    .md-post-toc .is-subheading a {
        display: block;
        padding-left: 14px;
        font-size: 1.3rem;
    }
}

@media (max-width: 767px) {
    .md-post-discovery {
        margin-top: 64px;
    }

    .md-post-discovery + .md-post-discovery {
        margin-top: 48px;
    }

    .md-post-discovery-feed {
        gap: 16px;
    }

    .md-post-discovery-feed > [data-related-candidate] {
        flex-basis: min(84vw, 320px);
    }
}

/* Media Dream navigation: a compact, logo-first information architecture. */
@media (min-width: 768px) {
    .media-dream-navigation {
        height: auto;
        min-height: 148px;
    }

    .media-dream-navigation.gh-navigation .gh-navigation-inner {
        position: relative;
        display: grid;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto;
        gap: 0;
        height: auto;
        padding-block: 22px 18px;
    }

    .media-dream-navigation.gh-navigation .gh-navigation-brand {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
    }

    .media-dream-navigation.gh-navigation .gh-navigation-menu {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        justify-content: center;
        margin: 17px 0 0 !important;
        width: 100% !important;
    }

    .media-dream-navigation .gh-navigation-actions {
        position: absolute;
        top: 22px;
        right: 0;
    }

    .media-dream-navigation .nav {
        flex-wrap: nowrap;
        gap: 12px 30px;
        justify-content: center;
        white-space: normal;
    }

    .media-dream-navigation .nav a,
    .media-dream-navigation .nav-parent-link {
        white-space: nowrap;
    }

    .media-dream-navigation .gh-more-toggle {
        display: none !important;
    }
}
