/* ==========================================================================
   What's New — Ghost theme
   Layout and type scale mirror notion.com/releases; font is Manrope.
   ========================================================================== */

:root {
    --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --color-text: rgba(0, 0, 0, 0.898);
    --color-heading: rgba(0, 0, 0, 0.95);
    --color-muted: rgba(0, 0, 0, 0.6);
    --color-rule: rgba(0, 0, 0, 0.08);
    --color-border: rgba(0, 0, 0, 0.1);
    --color-code-bg: #f6f5f4;
    --color-bg: #fff;
    --accent: var(--ghost-accent-color, #4895ef);

    --header-height: 64px;
    --sticky-offset: 88px;      /* header height + 24px */
    --content-width: 1024px;
    --side-gutter: 125px;
}

/* Reset ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-padding-top: var(--sticky-offset);
}

body {
    margin: 0;
    font-family: var(--gh-font-body, var(--font-sans));
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
    background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-family: var(--gh-font-heading, var(--font-sans)); font-weight: 700; color: var(--color-heading); }
p { margin: 0; }
img, video, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.arrow { display: inline-block; margin-left: 0.3em; }
.arrow-before { margin-left: 0; margin-right: 0.3em; }

/* Buttons ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 4px 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    white-space: nowrap;
    transition: background-color 0.15s ease, filter 0.15s ease;
}

.btn-primary {
    color: #fff;
    background: var(--accent);
}
.btn-primary:hover { filter: brightness(0.92); }

.btn-secondary {
    color: var(--color-heading);
    background: #fff;
    border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: #f6f5f4; }

/* Header ----------------------------------------------------------------- */

.site-header-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    box-shadow: 0 1px 0 0 transparent;
    transition: box-shadow 0.2s ease;
}
.site-header-wrap.is-scrolled { box-shadow: 0 1px 0 0 var(--color-border); }

.site-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: var(--header-height);
    padding: 14px 24px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    height: 36px;
}
.site-logo img {
    display: block;
    height: 34px;
    width: auto;
}

.site-header-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav a {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 20px;
    color: var(--color-text);
}
.nav a:hover { background: rgba(0, 0, 0, 0.04); }

/* Layout ----------------------------------------------------------------- */

.site-main {
    max-width: calc(var(--content-width) + var(--side-gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--side-gutter) 40px;
}

/* Hero ------------------------------------------------------------------- */

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 80px 0;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 542px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    line-height: 64px;
    letter-spacing: -0.033em;
}

.hero-subtitle {
    margin-bottom: 4px;
    font-size: 20px;
    line-height: 28px;
    color: var(--color-text);
}

.hero-link {
    font-size: 16px;
    line-height: 24px;
    color: var(--accent);
}
.hero-link:hover span:first-child { text-decoration: underline; text-underline-offset: 2px; }

.hero-illustration {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.hero-illustration img,
.hero-illustration svg {
    display: block;
    width: 160px;
    height: auto;
}
.hero-error .hero-title { font-size: 96px; line-height: 1; }

/* Releases list ---------------------------------------------------------- */

.releases { display: block; }

.release {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 24px;
    row-gap: 24px;
    align-items: start;
    padding: 40px 0 0;
    margin: 0 0 128px;
    border-top: 1px solid var(--color-rule);
}
.release:last-child { margin-bottom: 128px; }

.release-meta {
    position: sticky;
    top: var(--sticky-offset);
}

.release-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.release-date {
    display: block;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-muted);
}

.release-pill {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--color-text);
    border-radius: 3px;
    font-size: 12px;
    line-height: 1;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.release-pill:hover { background: var(--color-text); color: #fff; }

.release-back {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-muted);
}
.release-back:hover { color: var(--color-text); }

.release-body { min-width: 0; }

.release-title {
    margin: 0 0 32px;
    font-size: 42px;
    font-weight: 700;
    line-height: 48px;
    letter-spacing: -0.036em;
}
.release-title-link { display: block; color: var(--color-heading); }
.release-title-link:hover .release-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Single post page keeps the same two-column layout; no top rule. */
.releases-single .release { border-top: 0; padding-top: 40px; margin-bottom: 80px; }

/* Rich text (post content) ---------------------------------------------- */

.rich-text {
    font-size: 18px;
    line-height: 28px;
    color: var(--color-text);
    word-wrap: break-word;
}

.rich-text > * + * { margin-top: 0.65em; }

.rich-text p { margin: 0.65em 0; }
.rich-text > p:first-child { margin-top: 0; }

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    margin: 1.6em 0 0.5em;
    color: var(--color-text);
}
.rich-text > :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }

.rich-text h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 38px;
    letter-spacing: -0.03em;
}
.rich-text h3 {
    font-size: 26px;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: -0.024em;
}
.rich-text h4 {
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.01em;
}
.rich-text h5,
.rich-text h6 {
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
}

.rich-text a {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 1.8px;
}
.rich-text a:hover { text-decoration-thickness: 2px; }

.rich-text strong, .rich-text b { font-weight: 700; }

.rich-text ul,
.rich-text ol {
    margin: 0.65em 0;
    padding: 0 0 0 1.25em;
}
.rich-text li { margin: 0.25em 0; }
.rich-text li > ul, .rich-text li > ol { margin: 0.25em 0; }

.rich-text hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--color-rule);
}

.rich-text blockquote {
    margin: 1em 0;
    padding: 0 0 0 1em;
    border-left: 3px solid var(--color-text);
}
.rich-text blockquote.kg-blockquote-alt {
    border: 0;
    padding: 0;
    text-align: center;
    font-size: 24px;
    line-height: 34px;
    font-style: italic;
}

.rich-text code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--color-code-bg);
    font-family: var(--font-mono);
    font-size: 0.8em;
}
.rich-text pre {
    margin: 1em 0;
    padding: 16px 20px;
    border-radius: 8px;
    background: var(--color-code-bg);
    overflow-x: auto;
    font-size: 14px;
    line-height: 22px;
}
.rich-text pre code { padding: 0; background: none; font-size: inherit; }

.rich-text table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 24px;
}
.rich-text th, .rich-text td {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}
.rich-text th { font-weight: 600; background: var(--color-code-bg); }

.rich-text img { display: block; max-width: 100%; height: auto; }
.rich-text video { display: block; width: 100%; height: auto; }

.rich-text figure { margin: 1.3em 0; }
.rich-text figcaption {
    margin-top: 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-muted);
    text-align: center;
}

/* Ghost cards */
.rich-text .kg-card { margin: 1.3em 0; }
.rich-text .kg-image-card img, .rich-text .kg-gallery-image img { width: 100%; }
.rich-text .kg-width-wide, .rich-text .kg-width-full { width: 100%; max-width: 100%; }
.rich-text .kg-embed-card { position: relative; }
.rich-text .kg-embed-card iframe { max-width: 100%; }
.rich-text .kg-embed-card > iframe[src*="youtube"],
.rich-text .kg-embed-card > iframe[src*="vimeo"],
.rich-text .kg-embed-card > iframe[src*="loom"] { aspect-ratio: 16 / 9; width: 100%; height: auto; }
.rich-text .kg-callout-card { border-radius: 8px; font-size: 16px; line-height: 24px; }
.rich-text .kg-button-card .kg-btn { border-radius: 8px; font-family: var(--font-sans); font-weight: 500; }
.rich-text .kg-header-card h2, .rich-text .kg-header-card h3 { color: inherit; }
.rich-text .kg-toggle-card { border-radius: 8px; }

/* Gallery card */
.rich-text .kg-gallery-card { margin: 1.3em 0; }
.rich-text .kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.rich-text .kg-gallery-row { display: flex; flex-direction: row; justify-content: center; gap: 8px; }
.rich-text .kg-gallery-image { flex: 1 1 0; min-width: 0; }
.rich-text .kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Bookmark card */
.rich-text .kg-bookmark-card { margin: 1.3em 0; }
.rich-text .kg-bookmark-container {
    display: flex;
    min-height: 120px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    color: var(--color-text);
    text-decoration: none;
    background: #fff;
}
.rich-text .kg-bookmark-container:hover { background: var(--color-code-bg); }
.rich-text .kg-bookmark-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    flex-basis: 100%;
    padding: 16px 20px;
    min-width: 0;
}
.rich-text .kg-bookmark-title { font-size: 16px; font-weight: 600; line-height: 22px; color: var(--color-heading); }
.rich-text .kg-bookmark-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 4px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-muted);
}
.rich-text .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 12px;
    font-size: 13px;
    line-height: 18px;
    color: var(--color-muted);
}
.rich-text .kg-bookmark-icon { width: 18px; height: 18px; margin-right: 8px; }
.rich-text .kg-bookmark-author { font-weight: 600; color: var(--color-text); }
.rich-text .kg-bookmark-author::after { content: "•"; margin: 0 6px; font-weight: 400; }
.rich-text .kg-bookmark-publisher { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rich-text .kg-bookmark-thumbnail { position: relative; flex-shrink: 0; min-width: 33%; max-height: 100%; }
.rich-text .kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) {
    .rich-text .kg-bookmark-container { flex-direction: column; }
    .rich-text .kg-bookmark-thumbnail { order: -1; min-height: 160px; }
}

.responsive-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.3em 0; }
.responsive-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Pagination ------------------------------------------------------------- */

.pager {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}
.pager-next { margin-left: auto; }

/* Comments --------------------------------------------------------------- */

.release-comments {
    max-width: 667px;
    margin: 0 0 80px auto;
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 80px 0 24px;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
}

.site-footer-inner,
.site-footer-bottom {
    max-width: calc(var(--content-width) + var(--side-gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--side-gutter);
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 48px;
}

.site-footer-brand { max-width: 333px; }
.site-footer-logo img { display: block; height: 30px; width: auto; }
.site-footer-tagline { margin-top: 16px; color: var(--color-muted); }

.site-footer-links .nav { flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; }
.site-footer-links .nav a { padding: 4px 8px; }

.site-footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 64px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-muted);
}
.site-footer-bottom a:hover { color: var(--color-text); }

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1100px) {
    :root { --side-gutter: 48px; }
}

@media (max-width: 860px) {
    :root { --side-gutter: 24px; }

    .hero { margin: 48px 0 56px; }
    .hero-title { font-size: 48px; line-height: 50px; }
    .hero-illustration img, .hero-illustration svg { width: 120px; }

    .release {
        grid-template-columns: 1fr;
        row-gap: 16px;
        padding-top: 32px;
        margin-bottom: 80px;
    }
    .release-meta { position: static; }
    .release-title { margin-bottom: 24px; font-size: 32px; line-height: 38px; }

    .site-footer { padding: 48px 0 24px; }
    .site-footer-inner { flex-direction: column; gap: 32px; }
    .site-footer-links .nav { justify-content: flex-start; }
    .site-footer-bottom { margin-top: 40px; flex-wrap: wrap; }
}

@media (max-width: 560px) {
    .site-header { padding: 14px 16px; }
    .site-logo img { height: 28px; }
    .site-header-actions .nav { display: none; }
    .btn { height: 34px; padding: 4px 12px; font-size: 15px; }

    .hero { flex-direction: column-reverse; align-items: flex-start; gap: 24px; margin: 40px 0 48px; }
    .hero-title { font-size: 40px; line-height: 42px; }
    .hero-subtitle { font-size: 18px; line-height: 26px; }
    .hero-illustration { display: none; }

    .release-title { font-size: 28px; line-height: 34px; }
    .rich-text { font-size: 17px; line-height: 27px; }
    .rich-text h2 { font-size: 26px; line-height: 32px; }
    .rich-text h3 { font-size: 22px; line-height: 28px; }

    .pager .btn { flex: 1; justify-content: center; }
}

/* Print ----------------------------------------------------------------- */

@media print {
    .site-header-wrap, .site-footer, .pager { display: none; }
    .release-meta { position: static; }
}
