/* ====================================================================
   chinoiserie — Custom Styles
   Loads AFTER tufte.css. Overrides layout/chrome with new editorial
   design; preserves Tufte typography inside .tufte-content.
   ==================================================================== */

/* --- CSS Variables -------------------------------------------------- */
:root {
    --bg-color: #E2E0D6;
    --ink-color: #0c0c0c;
    --line-weight: 1px;
    --spacing-unit: 24px;
    --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
}

/* --- Global Resets (override tufte.css) ------------------------------ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--ink-color);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.4;
    font-size: 16px;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    font-style: normal;
}

h1 {
    font-weight: 400;
    font-size: 2rem;
    margin: 0;
    line-height: 1.2;
}

h2 {
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.2;
    font-style: normal;
}

h3 {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    line-height: 1.2;
    font-style: normal;
}

p, dl, ol, ul {
    font-size: inherit;
    line-height: inherit;
    width: auto;
}

p {
    margin: 0;
    padding: 0;
    vertical-align: baseline;
}

section {
    padding: 0;
}

article {
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

a:link, a:visited {
    color: inherit;
    text-decoration: none;
    text-underline-offset: initial;
    text-decoration-thickness: initial;
}

hr {
    width: 100%;
}

blockquote {
    font-size: inherit;
    margin: 0;
    border: none;
}

blockquote p {
    width: auto;
    margin-right: 0;
}

blockquote footer {
    width: auto;
}

section > p,
section > footer,
section > table {
    width: auto;
}

section > dl,
section > ol,
section > ul {
    width: auto;
    -webkit-padding-start: 0;
}

figure {
    max-width: 100%;
}

pre > code {
    width: auto;
    margin-left: 0;
}

/* --- Noise Overlay -------------------------------------------------- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Layout --------------------------------------------------------- */
.layout-container {
    width: 100%;
    max-width: 1440px;
    padding: 60px 40px;
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 60px;
    position: relative;
}

.layout-two-col {
    grid-template-columns: 280px 1fr;
}

/* --- Typography Classes --------------------------------------------- */
.text-uppercase {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.text-body-large {
    font-size: 26px;
    line-height: 1.35;
    font-weight: 400;
    margin-bottom: 40px;
}

.text-body-standard {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 680px;
}

.text-body-small {
    font-size: 14px;
    line-height: 1.5;
}

/* --- Borders -------------------------------------------------------- */
.border-top {
    border-top: var(--line-weight) solid var(--ink-color);
    padding-top: 8px;
    display: block;
    width: 100%;
}

/* --- Sidebar -------------------------------------------------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 60px;
    position: sticky;
    top: 60px;
    height: fit-content;
}

.meta-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: var(--line-weight) solid var(--ink-color);
    padding-bottom: 8px;
}

.sidebar-brand {
    font-family: var(--font-main);
    font-weight: 900;
    font-size: 2rem;
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--line-weight) solid var(--ink-color);
    padding: 10px 0;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.nav-item:first-child {
    border-top: var(--line-weight) solid var(--ink-color);
}

.nav-item:hover {
    opacity: 0.6;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: block;
}

/* --- Navigation ----------------------------------------------------- */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.hover-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- Post Authors --------------------------------------------------- */
.post-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 1.2rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    object-fit: cover;
    filter: grayscale(100%) sepia(30%) contrast(1.1);
}

.post-author-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* --- Other Posts (after article) ------------------------------------- */
.other-posts-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: var(--line-weight) solid var(--ink-color);
}

/* --- Main Article --------------------------------------------------- */
.main-article {
    overflow: visible;
}

.main-content {
    max-width: 720px;
}

/* --- Pull Quote ----------------------------------------------------- */
.pull-quote {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 60px 0;
    padding: 40px 0;
    border-top: var(--line-weight) solid var(--ink-color);
    border-bottom: var(--line-weight) solid var(--ink-color);
}

/* --- Section Break -------------------------------------------------- */
.section-break {
    margin: 80px 0 40px 0;
}

/* --- Drop Cap ------------------------------------------------------- */
.drop-cap {
    float: left;
    font-size: 72px;
    line-height: 0.8;
    padding-top: 4px;
    padding-right: 12px;
    font-weight: 500;
}

/* --- Annotation Column ---------------------------------------------- */
.annotation-column {
    display: flex;
    flex-direction: column;
    gap: 120px;
    padding-top: 240px;
}

.annotation {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.7;
    position: relative;
    padding-left: 20px;
}

.annotation::before {
    content: "\221F";
    position: absolute;
    left: 0;
    top: 0;
}

/* --- Essay List (index pages) --------------------------------------- */
.essay-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.essay-list li {
    border-bottom: var(--line-weight) solid var(--ink-color);
    padding: 12px 0;
}

.essay-list li:first-child {
    border-top: var(--line-weight) solid var(--ink-color);
}

.essay-list .essay-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--ink-color);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.essay-list .essay-title:hover {
    opacity: 0.6;
}

.essay-list .essay-date {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-top: 2px;
}

.essay-list .essay-description {
    font-size: 14px;
    opacity: 0.6;
    margin-top: 2px;
}

/* ====================================================================
   Tufte Content — preserves Tufte typography within essay bodies.
   Paragraphs use 55% width so sidenotes can float into the right margin.
   ==================================================================== */
.tufte-content {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    counter-reset: sidenote-counter;
}

.tufte-content p,
.tufte-content footer,
.tufte-content table {
    width: 55%;
}

.tufte-content p,
.tufte-content dl,
.tufte-content ol,
.tufte-content ul {
    font-size: 1.2rem;
    line-height: 1.8rem;
}

.tufte-content dl,
.tufte-content ol,
.tufte-content ul {
    width: 50%;
    -webkit-padding-start: 5%;
}

.tufte-content p {
    margin-top: 1.4rem;
    margin-bottom: 1.4rem;
    padding-right: 0;
    vertical-align: baseline;
}

.tufte-content h2 {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    margin-top: 2.1rem;
    margin-bottom: 1.4rem;
    font-size: 2.2rem;
    line-height: 1;
}

.tufte-content h3 {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.7rem;
    margin-top: 2rem;
    margin-bottom: 1.4rem;
    line-height: 1;
}

.tufte-content blockquote {
    font-size: 1.4rem;
    border-left: 3px solid var(--ink-color);
    padding-left: 1.25rem;
    margin: 1.4rem 0;
    width: 55%;
}

.tufte-content blockquote p {
    width: auto;
}

.tufte-content blockquote footer {
    width: auto;
    font-size: 1.1rem;
    text-align: right;
}

.tufte-content a:link,
.tufte-content a:visited {
    color: inherit;
    text-underline-offset: 0.1em;
    text-decoration-thickness: 0.05em;
    text-decoration: underline;
}

.tufte-content code,
.tufte-content pre > code {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 1.0rem;
    line-height: 1.42;
}

.tufte-content pre > code {
    font-size: 0.9rem;
    width: 52.5%;
    margin-left: 2.5%;
    overflow-x: auto;
    display: block;
}

.tufte-content span.newthought {
    font-variant: small-caps;
    font-size: 1.2em;
}

/* --- Sidenotes & Margin Notes (new design aesthetic) ---------------- */
.tufte-content .sidenote,
.tufte-content .marginnote {
    float: right;
    clear: right;
    margin-right: -60%;
    width: 50%;
    margin-top: 0.3rem;
    margin-bottom: 0;
    vertical-align: baseline;
    position: relative;
    /* New design styling */
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-size: 15px;
    line-height: 1.4;
    opacity: 0.7;
    padding-left: 16px;
}

.tufte-content .sidenote p,
.tufte-content .marginnote p {
    font-size: inherit;
    line-height: inherit;
    width: auto;
    margin: 0.5em 0;
}

.tufte-content .sidenote p:first-child,
.tufte-content .marginnote p:first-child {
    margin-top: 0;
}

.tufte-content .sidenote p:last-child,
.tufte-content .marginnote p:last-child {
    margin-bottom: 0;
}

.tufte-content .sidenote::after,
.tufte-content .marginnote::after {
    content: "";
    display: block;
    border-bottom: var(--line-weight) solid var(--ink-color);
    margin-top: 8px;
    opacity: 0.4;
}

.tufte-content .sidenote-number {
    counter-increment: sidenote-counter;
}

.tufte-content .sidenote-number:after {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    position: relative;
    vertical-align: baseline;
    content: counter(sidenote-counter);
    top: -0.5rem;
    left: 0.1rem;
}

.tufte-content .sidenote:before {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    position: absolute;
    left: 0;
    top: 0;
    vertical-align: baseline;
    content: counter(sidenote-counter);
}

.tufte-content .marginnote:before {
    font-family: var(--font-mono);
    font-size: 12px;
    position: absolute;
    left: 0;
    top: 0;
    content: "\221F";
}

.tufte-content blockquote .sidenote,
.tufte-content blockquote .marginnote {
    margin-right: -82%;
    min-width: 59%;
    text-align: left;
}

.tufte-content input.margin-toggle {
    display: none;
}

.tufte-content label.sidenote-number {
    display: inline-block;
    max-height: 2rem;
}

.tufte-content label.margin-toggle:not(.sidenote-number) {
    display: none;
}

.tufte-content div.epigraph {
    margin: 3em 0;
}

.tufte-content div.epigraph > blockquote {
    margin-top: 2em;
    margin-bottom: 2em;
    border-left: none;
    padding-left: 0;
}

.tufte-content div.epigraph > blockquote,
.tufte-content div.epigraph > blockquote > p {
    font-style: italic;
}

.tufte-content div.epigraph > blockquote > footer {
    font-style: normal;
}

.tufte-content div.epigraph > blockquote > footer > cite {
    font-style: italic;
}

.tufte-content figure {
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    max-width: 55%;
    margin: 0 0 3em 0;
}

.tufte-content figcaption {
    float: right;
    clear: right;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    vertical-align: baseline;
    position: relative;
    max-width: 40%;
}

.tufte-content figure.fullwidth figcaption {
    margin-right: 24%;
}

.tufte-content figure.fullwidth {
    max-width: 90%;
    clear: both;
}

.tufte-content div.fullwidth,
.tufte-content table.fullwidth {
    width: 100%;
}

.tufte-content hr {
    display: block;
    height: 1px;
    width: 55%;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

.tufte-content dt:not(:first-child),
.tufte-content li:not(:first-child) {
    margin-top: 0.25rem;
}

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 1200px) {
    .layout-container,
    .layout-two-col {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 760px) {
    .layout-container,
    .layout-two-col {
        grid-template-columns: 1fr;
        padding: 30px 20px;
        gap: 30px;
    }

    .sidebar {
        position: static;
        gap: 30px;
        display: contents;
    }

    .sidebar .meta-group {
        order: -1;
    }

    .other-posts-section {
        margin-top: 30px;
        padding-top: 30px;
    }

    .text-body-large {
        font-size: 22px;
    }

    .pull-quote {
        font-size: 24px;
    }

    .tufte-content p,
    .tufte-content footer,
    .tufte-content table,
    .tufte-content hr {
        width: 100%;
    }

    .tufte-content dl,
    .tufte-content ol,
    .tufte-content ul {
        width: 90%;
    }

    .tufte-content pre > code {
        width: 97%;
    }

    .tufte-content figure {
        max-width: 90%;
    }

    .tufte-content figcaption,
    .tufte-content figure.fullwidth figcaption {
        margin-right: 0%;
        max-width: none;
    }

    .tufte-content blockquote {
        width: auto;
        margin-left: 1.5em;
        margin-right: 0em;
    }

    .tufte-content .sidenote,
    .tufte-content .marginnote {
        display: none;
    }

    .tufte-content label.margin-toggle:not(.sidenote-number) {
        display: inline;
    }

    .tufte-content .margin-toggle:checked + .sidenote,
    .tufte-content .margin-toggle:checked + .marginnote {
        display: block;
        float: left;
        left: 1rem;
        clear: both;
        width: 95%;
        margin: 1rem 2.5%;
        vertical-align: baseline;
        position: relative;
        padding-left: 16px;
    }

    .tufte-content label {
        cursor: pointer;
    }

    .tufte-content div.table-wrapper,
    .tufte-content table {
        width: 85%;
    }

    .tufte-content img {
        width: 100%;
    }
}

/* --- Site Footer ---------------------------------------------------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.site-footer {
    width: 100%;
    padding: 20px 40px;
    border-top: var(--line-weight) solid var(--ink-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-footer nav {
    display: flex;
    gap: 24px;
}

.site-footer a {
    transition: opacity 0.15s ease;
}

.site-footer a:hover {
    opacity: 0.6;
}

@media (max-width: 760px) {
    .site-footer {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* --- Ghost Card Styles (required by gscan) -------------------------- */
.kg-width-wide {
    max-width: 85%;
}

.kg-width-full {
    max-width: 100%;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-wide img,
.kg-width-full img {
    max-width: 100%;
}

/* Gallery */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    margin: 1.4rem 0;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-row:not(:first-of-type) {
    margin-top: 4px;
}

.kg-gallery-image {
    flex: 1 1 0%;
    margin: 0 2px;
}

.kg-gallery-image:first-child {
    margin-left: 0;
}

.kg-gallery-image:last-child {
    margin-right: 0;
}

.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bookmark card */
.kg-bookmark-card {
    width: 55%;
    margin: 1.4rem 0;
}

.kg-bookmark-container {
    display: flex;
    border: var(--line-weight) solid var(--ink-color);
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-content {
    flex-grow: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kg-bookmark-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.kg-bookmark-description {
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.7;
    margin-top: 8px;
    overflow: hidden;
    max-height: 3em;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.kg-bookmark-author::after {
    content: " · ";
}

.kg-bookmark-publisher {
    opacity: 0.7;
}

.kg-bookmark-thumbnail {
    flex-basis: 200px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Tufte Content: Additional Text Styles ----------------------------- */

/* Headings h4–h6 */
.tufte-content h4 {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1.4rem;
    line-height: 1;
}

.tufte-content h5 {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tufte-content h6 {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Inline formatting */
.tufte-content mark {
    background-color: rgba(12, 12, 12, 0.1);
    padding: 0.1em 0.2em;
}

.tufte-content del {
    opacity: 0.5;
}

.tufte-content abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

.tufte-content kbd {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85em;
    padding: 0.15em 0.4em;
    border: var(--line-weight) solid var(--ink-color);
    border-radius: 3px;
}

/* Definition lists */
.tufte-content dt {
    font-weight: 700;
}

.tufte-content dd {
    margin-left: 1.5em;
    margin-bottom: 0.5rem;
}

/* Tables */
.tufte-content table {
    border-collapse: collapse;
}

.tufte-content th,
.tufte-content td {
    padding: 0.5em 1em;
    text-align: left;
    border-bottom: var(--line-weight) solid var(--ink-color);
}

.tufte-content th {
    font-weight: 700;
    border-bottom-width: 2px;
}

/* --- Ghost Card Styles: Image ------------------------------------------ */
.kg-image-card {
    margin: 1.4rem 0;
}

.kg-image-card img {
    height: auto;
}

.kg-image-card figcaption {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.7;
    margin-top: 0.5em;
}

/* --- Ghost Card Styles: Callout ---------------------------------------- */
.kg-callout-card {
    margin: 1.4rem 0;
    padding: 1.2em 1.4em;
    border: var(--line-weight) solid var(--ink-color);
    display: flex;
    gap: 0.8em;
    align-items: flex-start;
}

.kg-callout-emoji {
    font-size: 1.2em;
    flex-shrink: 0;
}

.kg-callout-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- Ghost Card Styles: Toggle/Accordion ------------------------------- */
.kg-toggle-card {
    margin: 1.4rem 0;
    border-top: var(--line-weight) solid var(--ink-color);
    border-bottom: var(--line-weight) solid var(--ink-color);
    padding: 1em 0;
}

.kg-toggle-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
}

.kg-toggle-card-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon {
    transform: rotate(180deg);
}

.kg-toggle-content {
    margin-top: 1em;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* --- Ghost Card Styles: Button ----------------------------------------- */
.kg-button-card {
    margin: 1.4rem 0;
}

.kg-button-card.kg-align-center {
    text-align: center;
}

.kg-btn {
    display: inline-block;
    padding: 0.7em 1.8em;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: var(--line-weight) solid var(--ink-color);
    color: inherit;
    transition: opacity 0.15s ease;
}

.kg-btn:hover {
    opacity: 0.6;
}

.kg-btn-accent {
    background: var(--ink-color);
    color: var(--bg-color);
    border-color: var(--ink-color);
}

/* --- Ghost Card Styles: Audio & Video ---------------------------------- */
.kg-audio-card,
.kg-video-card {
    margin: 1.4rem 0;
}

.kg-video-card video {
    max-width: 100%;
    height: auto;
}

/* --- Ghost Card Styles: File ------------------------------------------- */
.kg-file-card {
    margin: 1.4rem 0;
}

.kg-file-card-container {
    display: flex;
    align-items: center;
    border: var(--line-weight) solid var(--ink-color);
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
}

.kg-file-card-contents {
    flex-grow: 1;
    margin-right: 1em;
}

.kg-file-card-title {
    font-weight: 700;
    font-size: 1rem;
}

.kg-file-card-caption {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 2px;
}

.kg-file-card-metadata {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 4px;
}

.kg-file-card-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* --- Ghost Card Styles: Embed ------------------------------------------ */
.kg-embed-card {
    margin: 1.4rem 0;
}

.kg-embed-card iframe {
    width: 100%;
}

/* --- Ghost Card Styles: Blockquote Alt --------------------------------- */
.kg-blockquote-alt {
    font-size: 1.6rem;
    line-height: 1.4;
    font-style: italic;
    border-left: none;
    padding: 1.4rem 0;
    margin: 2rem 0;
    border-top: var(--line-weight) solid var(--ink-color);
    border-bottom: var(--line-weight) solid var(--ink-color);
}

/* --- Ghost Card Styles: Header ----------------------------------------- */
.kg-header-card {
    margin: 1.4rem 0;
    padding: 4em 2em;
    text-align: center;
}

.kg-header-card.kg-style-dark {
    background: var(--ink-color);
    color: var(--bg-color);
}

.kg-header-card.kg-style-light {
    background: var(--bg-color);
    border: var(--line-weight) solid var(--ink-color);
}

.kg-header-card.kg-style-image {
    background-size: cover;
    background-position: center;
    color: #fff;
}

.kg-header-card.kg-size-small { padding: 2em 1.5em; }
.kg-header-card.kg-size-large { padding: 6em 2em; }

.kg-header-card-header {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.kg-header-card-subheader {
    font-size: 1.2rem;
    line-height: 1.5;
    opacity: 0.8;
}

.kg-header-card-button {
    display: inline-block;
    margin-top: 1.5em;
    padding: 0.7em 1.8em;
    font-weight: 700;
    border: var(--line-weight) solid currentColor;
    text-decoration: none;
    color: inherit;
}

/* --- Ghost Card Styles: Product ---------------------------------------- */
.kg-product-card {
    margin: 1.4rem 0;
    border: var(--line-weight) solid var(--ink-color);
    padding: 1.5em;
}

.kg-product-card-container {
    display: flex;
    flex-direction: column;
}

/* --- Ghost Card Styles: Signup ----------------------------------------- */
.kg-signup-card {
    margin: 1.4rem 0;
    padding: 3em 2em;
    text-align: center;
    border: var(--line-weight) solid var(--ink-color);
}

.kg-signup-card.kg-layout-split {
    display: flex;
    text-align: left;
}

.kg-signup-card-content {
    flex: 1;
}

.kg-signup-card-image {
    flex: 1;
}

.kg-signup-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-signup-card-heading {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.kg-signup-card-subheading {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 1.5em;
}

.kg-signup-card-form {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 1em;
}

.kg-signup-card.kg-layout-split .kg-signup-card-form {
    justify-content: flex-start;
}

.kg-signup-card-input {
    padding: 0.6em 1em;
    font-size: 1rem;
    border: var(--line-weight) solid var(--ink-color);
    background: transparent;
    font-family: inherit;
}

.kg-signup-card-button {
    padding: 0.6em 1.5em;
    font-size: 1rem;
    font-weight: 700;
    background: var(--ink-color);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
}

.kg-signup-card-disclaimer {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 0.8em;
}

/* --- Responsive: Ghost Cards ------------------------------------------- */
@media (max-width: 760px) {
    .kg-signup-card.kg-layout-split {
        flex-direction: column;
    }
}

/* Override tufte dark mode to keep consistent design */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-color);
        color: var(--ink-color);
    }
}
