/* ==========================================================================
   Kontur — SamaDesign
   Swiss-style blog: one 12-column grid, sharp corners (radius 0), one accent.
   1. Tokens   2. Base   3. Layout   4. Header   5. Buttons & forms
   6. Cards & Posters   7. Home   8. Archives   9. Article
   10. Content (Koenig)   11. Newsletter   12. Footer   13. Misc
   ========================================================================== */

/* 1. Tokens
   ========================================================================== */

:root {
    --kt-accent: var(--ghost-accent-color, #e3241b);
    /* Accent used as a text colour: pulled towards the text colour so light accents stay readable */
    --kt-accent-text: color-mix(in srgb, var(--kt-accent) 82%, var(--kt-text));
    --kt-on-accent: #ffffff; /* main.js picks dark or light from the accent luminance */

    --kt-bg: #f5f5f3;
    --kt-surface: #ececea;
    --kt-chip: #e2e2de;
    --kt-text: #141414;
    --kt-muted: #5b5b58;
    --kt-border: #d4d4d0;
    --kt-rule: #141414;

    --kt-font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --kt-stretch: normal;
    --kt-font-heading: var(--gh-font-heading, var(--kt-font));
    --kt-font-body: var(--gh-font-body, var(--kt-font));

    --kt-radius: 0px;
    --kt-radius-lg: 0px;
    --kt-pad: 16px;
    --kt-gutter: 16px;
    --kt-container: 1400px;
    --kt-content: 720px;
    --kt-wide: 1040px;
    --kt-header-h: 60px;
    --kt-shadow: none;
    --kt-ease: cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: light;
}

[data-typeface="archivo"] { --kt-font: "Archivo", system-ui, sans-serif; --kt-stretch: 112%; }
[data-typeface="host"] { --kt-font: "Host Grotesk", system-ui, sans-serif; }

:root[data-scheme="dark"] {
    --kt-bg: #121212;
    --kt-surface: #1c1c1c;
    --kt-chip: #262625;
    --kt-text: #ededea;
    --kt-muted: #a3a39f;
    --kt-border: #333331;
    --kt-rule: #ededea;

    color-scheme: dark;
}

@media (min-width: 640px) {
    :root { --kt-pad: 24px; --kt-gutter: 20px; }
}

@media (min-width: 1024px) {
    :root { --kt-pad: 40px; --kt-gutter: 24px; --kt-header-h: 72px; }
}

/* 2. Base
   ========================================================================== */

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

[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--kt-header-h) + 16px);
}

@media (min-width: 960px) {
    html { scroll-padding-top: 24px; }
}

body {
    margin: 0;
    background: var(--kt-bg);
    color: var(--kt-text);
    font-family: var(--kt-font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--kt-font-heading);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

p, figure, dl, dd { margin: 0; }

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

img, svg, video { display: block; max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--kt-accent); outline-offset: 3px; }

::selection { background: var(--kt-accent); color: var(--kt-on-accent); }

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

.kt-skip {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--kt-text);
    color: var(--kt-bg);
    font-weight: 600;
}

.kt-skip:focus { top: 16px; }

.kt-icon { width: 20px; height: 20px; flex-shrink: 0; }

.kt-muted { color: var(--kt-muted); }

/* 3. Layout
   ========================================================================== */

.kt-site { display: flex; flex-direction: column; min-height: 100vh; }
.kt-main { flex-grow: 1; }

.kt-container {
    width: 100%;
    max-width: calc(var(--kt-container) + 2 * var(--kt-pad));
    margin-inline: auto;
    padding-inline: var(--kt-pad);
}

.kt-narrow,
.kt-wide,
.kt-full {
    width: 100%;
    margin-inline: auto;
    padding-inline: var(--kt-pad);
}

.kt-narrow { max-width: calc(var(--kt-content) + 2 * var(--kt-pad)); }
.kt-wide { max-width: calc(var(--kt-container) + 2 * var(--kt-pad)); }
.kt-full { padding-inline: 0; }

.kt-section { padding-block: 48px; }

@media (min-width: 1024px) {
    .kt-section { padding-block: 72px; }
}

/* Section heads: big type on a heavy rule, no eyebrow */
.kt-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-top: 18px;
    border-top: 2px solid var(--kt-rule);
}

.kt-section-title {
    font-size: clamp(2.25rem, 4.4vw, 4rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.04em;
    font-stretch: var(--kt-stretch);
}

.kt-section-note { color: var(--kt-muted); font-size: 0.95rem; }

.kt-label {
    display: block;
    color: var(--kt-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* 4. Header
   ========================================================================== */

.kt-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--kt-bg);
    border-bottom: 1px solid var(--kt-rule);
}

@media (min-width: 960px) {
    .kt-header { position: relative; }
}

.kt-header-inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    align-items: center;
    height: var(--kt-header-h);
}

/* The site name sits in a solid accent block flush with the left edge */
.kt-brand {
    grid-column: 1 / 7;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    height: 100%;
    margin-left: calc(-1 * var(--kt-pad));
    padding: 0 var(--kt-pad);
    background: var(--kt-accent);
    color: var(--kt-on-accent);
    transition: opacity 0.2s;
}

.kt-brand:hover { opacity: 0.92; }

.kt-brand-title {
    font-family: var(--kt-font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.045em;
    font-stretch: var(--kt-stretch);
    white-space: nowrap;
}

/* With an uploaded logo: no block, the image alone */
.kt-brand-image { margin-left: 0; padding: 0; background: none; }
.kt-logo { max-height: 40px; width: auto; }
.kt-logo-dark { display: none; }
[data-scheme="dark"] .kt-logo-light { display: none; }
[data-scheme="dark"] .kt-logo-dark { display: block; }

@media (min-width: 1024px) {
    .kt-brand { grid-column: 1 / 4; }
    .kt-brand-title { font-size: 1.75rem; }
}

.kt-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kt-menu > li { position: relative; }

.kt-menu a,
.kt-sub-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    border: 0;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

/* Underline that draws in from the left */
.kt-menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--kt-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--kt-ease);
}

.kt-menu > li > a:hover::after,
.kt-menu > .is-current > a::after { transform: scaleX(1); }

.kt-sub-toggle { gap: 6px; }

.kt-sub-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.kt-sub-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }

.kt-submenu { margin: 0; padding: 8px 0; list-style: none; }
.kt-submenu a { display: block; padding: 8px 18px; }
.kt-submenu a::after { content: none; }

.kt-nav-members { display: none; }

.kt-actions {
    grid-column: 7 / 13;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.kt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s;
}

.kt-icon-btn:hover { background: var(--kt-chip); }

.kt-icon-sun { display: none; }
[data-scheme="dark"] .kt-icon-sun { display: block; }
[data-scheme="dark"] .kt-icon-moon { display: none; }

.kt-text-link { padding: 8px 10px; font-size: 0.95rem; font-weight: 500; }
.kt-text-link:hover { color: var(--kt-accent-text); }

.kt-burger { display: none; flex-direction: column; gap: 6px; }

.kt-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.kt-burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.kt-burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (min-width: 960px) {
    .kt-brand { grid-column: 1 / 4; }
    .kt-nav { grid-column: 4 / 10; }
    .kt-actions { grid-column: 10 / 13; }

    .kt-submenu {
        position: absolute;
        top: calc(100% + 10px);
        left: -18px;
        min-width: 220px;
        border: 1px solid var(--kt-rule);
        background: var(--kt-bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    }

    .kt-submenu.is-open { opacity: 1; visibility: visible; transform: none; }
    .kt-submenu a:hover { background: var(--kt-accent); color: var(--kt-on-accent); }
}

@media (max-width: 959px) {
    .kt-burger { display: inline-flex; }
    .kt-actions .kt-hide-sm { display: none; } /* beats .kt-btn display, declared later */

    .kt-nav {
        position: fixed;
        inset: var(--kt-header-h) 0 0 0;
        z-index: 49;
        padding: 8px var(--kt-pad) 32px;
        overflow-y: auto;
        background: var(--kt-bg);
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.2s ease, visibility 0.2s;
    }

    .kt-nav.is-open { visibility: visible; opacity: 1; }

    .kt-menu { flex-direction: column; align-items: stretch; gap: 0; }
    .kt-menu > li { border-bottom: 1px solid var(--kt-border); }
    .kt-menu > li > a::after { content: none; }

    .kt-menu a,
    .kt-sub-toggle {
        width: 100%;
        padding: 14px 0;
        justify-content: space-between;
        font-family: var(--kt-font-heading);
        font-size: 1.9rem;
        font-weight: 700;
        letter-spacing: -0.035em;
    }

    .kt-menu .is-current > a { color: var(--kt-accent-text); }

    .kt-submenu { display: none; padding: 0 0 12px 12px; }
    .kt-submenu.is-open { display: block; }
    .kt-submenu a { padding: 8px 0; font-size: 1.15rem; font-weight: 500; }

    .kt-nav-members { display: flex; gap: 10px; margin-top: 24px; }
    .kt-nav-members .kt-btn { flex: 1; }

    body.kt-nav-open { overflow: hidden; }
}

/* 5. Buttons & forms
   ========================================================================== */

.kt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.kt-btn:active { transform: translateY(1px); }

.kt-btn-primary,
.kt-btn-dark { background: var(--kt-text); color: var(--kt-bg); }
.kt-btn-primary:hover { background: var(--kt-accent); color: var(--kt-on-accent); }

.kt-btn-ghost { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.kt-btn-ghost:hover { background: var(--kt-text); color: var(--kt-bg); }

.kt-underline-link {
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--kt-accent);
    font-weight: 600;
}

.kt-underline-link:hover { color: var(--kt-accent-text); }

.kt-form-label { display: block; margin-bottom: 8px; font-size: 0.95rem; font-weight: 600; }

.kt-form-row { display: flex; }

.kt-form-row input {
    flex-grow: 1;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    border: 0;
    background: var(--kt-bg);
    color: var(--kt-text);
}

.kt-form-row input::placeholder { color: var(--kt-muted); }
.kt-form-row input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--kt-text); }
.kt-form-row .kt-btn { min-height: 52px; }

.kt-form-note { margin-top: 10px; font-size: 0.9rem; }

.kt-form-loading,
.kt-form-success,
.kt-form-error { display: none; }

.kt-form .kt-btn { position: relative; }
.kt-form.loading .kt-form-label-text { visibility: hidden; }

.kt-form.loading .kt-form-loading {
    display: block;
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: kt-spin 0.7s linear infinite;
}

.kt-form.success .kt-form-row,
.kt-form.success .kt-form-label,
.kt-form.success .kt-form-note { display: none; }
.kt-form.success .kt-form-success { display: block; font-weight: 600; }
.kt-form.error .kt-form-error { display: block; margin-top: 10px; font-size: 0.9rem; font-weight: 600; }

@keyframes kt-spin { to { transform: rotate(360deg); } }

/* 6. Cards & Posters
   ========================================================================== */

.kt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kt-card-media {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--kt-surface);
}

.kt-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--kt-ease);
}

.kt-card:hover .kt-card-media img { transform: scale(1.05); }

.kt-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 10px;
    padding-top: 16px;
}

.kt-card-title {
    font-size: clamp(1.35rem, 2.1vw, 1.9rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-stretch: var(--kt-stretch);
}

/* Whole card clickable through the title link */
.kt-card-title a::after { content: ""; position: absolute; inset: 0; }

/* Accent underline that draws under the title on hover */
.kt-card-title span {
    background: linear-gradient(var(--kt-accent), var(--kt-accent)) left bottom / 0 3px no-repeat;
    transition: background-size 0.45s var(--kt-ease);
}

.kt-card:hover .kt-card-title span,
.kt-card-title a:focus-visible span { background-size: 100% 3px; }

.kt-card-excerpt {
    display: none;
    max-width: 52ch;
    font-size: 1rem;
    line-height: 1.5;
}

.kt-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    color: var(--kt-muted);
    font-size: 0.875rem;
}

.kt-card-tag {
    position: relative;
    z-index: 1;
    color: var(--kt-text);
    font-weight: 600;
}

.kt-card-tag:hover { color: var(--kt-accent-text); }

.kt-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.kt-badge .kt-icon { width: 14px; height: 14px; }

/* A post without image, anywhere: a type-only poster */
.kt-card-noimg .kt-card-body {
    justify-content: space-between;
    min-height: 260px;
    padding: 28px;
    background: var(--kt-surface);
}

.kt-card-noimg .kt-card-excerpt { display: block; color: var(--kt-muted); }

/* Plain feeds (related stories, 404) */
.kt-feed { display: grid; grid-template-columns: 1fr; gap: 40px var(--kt-gutter); }

@media (min-width: 640px) {
    .kt-feed-plain { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
    .kt-feed-plain { grid-template-columns: repeat(3, 1fr); }
}

/* Posters: a modular wall on the 12-column grid, pattern of 7 cells.
   nth-child keeps the pattern going when "Load more" appends cards. */
.kt-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px var(--kt-gutter); }
.kt-posters > .kt-card { grid-column: span 1; }
.kt-posters > .kt-card:nth-child(7n + 1),
.kt-posters > .kt-card:nth-child(7n + 3),
.kt-posters > .kt-card:nth-child(7n + 6) { grid-column: 1 / -1; }

/* Colour block (3rd) and type-only (6th) posters */
.kt-posters > .kt-card:nth-child(7n + 3) .kt-card-body {
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    background: var(--kt-accent);
    color: var(--kt-on-accent);
}

.kt-posters > .kt-card:nth-child(7n + 6) .kt-card-body {
    justify-content: space-between;
    gap: 24px;
    min-height: 280px;
    padding: 28px;
    background: var(--kt-text);
    color: var(--kt-bg);
}

.kt-posters > .kt-card:nth-child(7n + 6) .kt-card-media { display: none; }

.kt-posters > .kt-card:is(:nth-child(7n + 3), :nth-child(7n + 6)) .kt-card-excerpt { display: block; }
.kt-posters > .kt-card:is(:nth-child(7n + 3), :nth-child(7n + 6)) .kt-card-meta,
.kt-posters > .kt-card:is(:nth-child(7n + 3), :nth-child(7n + 6)) .kt-card-tag { color: inherit; }
.kt-posters > .kt-card:is(:nth-child(7n + 3), :nth-child(7n + 6)) .kt-card-title { font-size: clamp(2rem, 4.4vw, 4.25rem); line-height: 0.96; letter-spacing: -0.045em; }
.kt-posters > .kt-card:nth-child(7n + 3) .kt-card-title span { background-image: linear-gradient(currentColor, currentColor); }

@media (max-width: 639px) {
    .kt-posters { grid-template-columns: 1fr; }
    .kt-posters > .kt-card { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
    .kt-posters { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 64px var(--kt-gutter); }

    .kt-posters > .kt-card:nth-child(7n + 1) { grid-column: 1 / 9; }
    .kt-posters > .kt-card:nth-child(7n + 1) .kt-card-media { aspect-ratio: 16 / 10; }
    .kt-posters > .kt-card:nth-child(7n + 1) .kt-card-title { font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1; letter-spacing: -0.04em; }

    .kt-posters > .kt-card:nth-child(7n + 2) { grid-column: 9 / 13; }
    .kt-posters > .kt-card:nth-child(7n + 2) .kt-card-media { aspect-ratio: 4 / 5; }

    /* Colour block beside its photo */
    .kt-posters > .kt-card:nth-child(7n + 3) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        column-gap: var(--kt-gutter);
    }

    .kt-posters > .kt-card:nth-child(7n + 3) .kt-card-media { grid-column: 6 / 13; grid-row: 1; aspect-ratio: 16 / 9; }
    .kt-posters > .kt-card:nth-child(7n + 3) .kt-card-body { grid-column: 1 / 6; grid-row: 1; padding: 36px; }
    .kt-posters > .kt-card.kt-card-noimg:nth-child(7n + 3) .kt-card-body { grid-column: 1 / -1; min-height: 320px; }

    .kt-posters > .kt-card:nth-child(7n + 4) { grid-column: 1 / 6; }
    .kt-posters > .kt-card:nth-child(7n + 4) .kt-card-media { aspect-ratio: 4 / 5; }

    .kt-posters > .kt-card:nth-child(7n + 5) { grid-column: 6 / 13; align-self: end; }
    .kt-posters > .kt-card:nth-child(7n + 5) .kt-card-media { aspect-ratio: 16 / 10; }

    .kt-posters > .kt-card:nth-child(7n + 6) { grid-column: 1 / 8; }
    .kt-posters > .kt-card:nth-child(7n + 6) .kt-card-body { min-height: 380px; padding: 36px; }

    .kt-posters > .kt-card:nth-child(7n + 7) { grid-column: 8 / 13; }
    .kt-posters > .kt-card:nth-child(7n + 7) .kt-card-media { aspect-ratio: 1; }
}

/* Cards rise into place as they enter the viewport (class added by main.js) */
@media (prefers-reduced-motion: no-preference) {
    .kt-reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--kt-ease), transform 0.8s var(--kt-ease); }
    .kt-reveal.is-in { opacity: 1; transform: none; }
}

/* Pagination & load more */
.kt-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 18px;
    border-top: 1px solid var(--kt-border);
}

.kt-page-number { color: var(--kt-muted); font-size: 0.9rem; }

.kt-load-more-wrap { margin-top: 48px; }
.kt-load-more { background: transparent; color: var(--kt-text); box-shadow: inset 0 0 0 1.5px var(--kt-text); }
.kt-load-more:hover { background: var(--kt-text); color: var(--kt-bg); }
.kt-load-more.is-loading { opacity: 0.6; pointer-events: none; }

.kt-empty { grid-column: 1 / -1; color: var(--kt-muted); }

/* 7. Home
   ========================================================================== */

/* Lead story: big title on the left, photo bleeding off the right edge */
.kt-lead { padding-block: 28px 48px; overflow: hidden; }

.kt-lead-inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    row-gap: 24px;
    align-items: end;
}

.kt-lead-text { grid-column: 1 / -1; }
.kt-lead-media { grid-column: 1 / -1; grid-row: 1; margin-inline: calc(-1 * var(--kt-pad)); display: block; overflow: hidden; }
.kt-lead-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.kt-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    color: var(--kt-muted);
    font-size: 0.9rem;
}

.kt-meta-tag { color: var(--kt-accent-text); font-weight: 600; }
.kt-meta-tag:hover { text-decoration: underline; text-underline-offset: 3px; }

.kt-lead-title {
    margin: 16px 0 18px;
    font-size: clamp(2.5rem, 6.2vw, 5.75rem);
    font-weight: 750;
    line-height: 0.95;
    letter-spacing: -0.045em;
    font-stretch: var(--kt-stretch);
    text-wrap: balance;
}

.kt-lead-title a:hover { color: var(--kt-accent-text); }

.kt-lead-excerpt {
    max-width: 36ch;
    color: var(--kt-muted);
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.45;
}

.kt-byline-mini {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    font-size: 0.95rem;
    font-weight: 600;
}

.kt-byline-mini img { width: 36px; height: 36px; object-fit: cover; filter: grayscale(1); }
.kt-byline-mini:hover span { color: var(--kt-accent-text); }

@media (min-width: 960px) {
    .kt-lead { padding-block: 56px 72px; }
    .kt-lead-text { grid-column: 1 / 8; grid-row: 1; }
    .kt-lead-media { grid-column: 8 / 13; margin: 0 calc(-1 * var(--kt-pad)) 0 0; }
    .kt-lead-media img { aspect-ratio: 4 / 5; }
    .kt-lead-noimg .kt-lead-text { grid-column: 1 / 11; }
    .kt-lead-noimg .kt-lead-title { font-size: clamp(3rem, 7.5vw, 7rem); }
}

/* Load-in: the lead photo uncovers from the left, the title rises; once */
@media (prefers-reduced-motion: no-preference) {
    .kt-lead-media img { animation: kt-uncover 1.1s var(--kt-ease) both; }
    .kt-lead-title { animation: kt-rise 0.9s var(--kt-ease) both; }
}

@keyframes kt-uncover { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes kt-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Pan: a swipeable row by default (no JS, phones, reduced motion);
   main.js adds .is-pinned on large screens: the section pins and vertical scroll pans the row */
.kt-latest-pan { padding-block: 0; }
.kt-pan-sticky { padding-block: 48px; }

.kt-pan-track {
    display: flex;
    gap: var(--kt-gutter);
    padding-inline: var(--kt-pad);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--kt-pad);
    scrollbar-width: none;
}

.kt-pan-track::-webkit-scrollbar { display: none; }

.kt-pan-card,
.kt-pan-intro,
.kt-pan-more { flex: 0 0 78vw; scroll-snap-align: start; }

.kt-pan-card { position: relative; }
.kt-pan-media { display: block; overflow: hidden; aspect-ratio: 4 / 5; background: var(--kt-surface); }
.kt-pan-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--kt-ease); }
.kt-pan-card:hover .kt-pan-media img { transform: scale(1.05); }

.kt-pan-noimg {
    display: flex;
    align-items: flex-end;
    height: 100%;
    padding: 24px;
    background: var(--kt-text);
    color: var(--kt-bg);
    font-family: var(--kt-font-heading);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.04em;
}

.kt-pan-card-title {
    margin: 16px 0 8px;
    font-size: clamp(1.4rem, 2.4vw, 2.25rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-stretch: var(--kt-stretch);
}

.kt-pan-card-title a::after { content: ""; position: absolute; inset: 0; }
.kt-pan-card:hover .kt-pan-card-title { color: var(--kt-accent-text); }

.kt-pan-intro { display: flex; flex-direction: column; justify-content: flex-end; flex-basis: 70vw; }

.kt-pan-title {
    font-size: clamp(4rem, 9vw, 9.5rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.06em;
    font-stretch: var(--kt-stretch);
}

.kt-pan-desc { max-width: 26ch; margin-top: 20px; color: var(--kt-muted); }

.kt-pan-more {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 16px;
    flex-basis: 60vw;
    padding: 28px;
    background: var(--kt-accent);
    color: var(--kt-on-accent);
    font-family: var(--kt-font-heading);
    font-size: clamp(1.8rem, 3.4vw, 3.2rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -0.045em;
}

.kt-pan-more .kt-icon { width: 40px; height: 40px; transition: transform 0.3s var(--kt-ease); }
.kt-pan-more:hover .kt-icon { transform: translateX(8px); }

.kt-pan-bar { display: none; margin: 28px var(--kt-pad) 0; height: 3px; background: var(--kt-border); }
.kt-pan-bar span { display: block; height: 100%; background: var(--kt-accent); transform: scaleX(0); transform-origin: left; }

@media (min-width: 960px) {
    .kt-pan-card { flex-basis: min(560px, 40vw); }
    .kt-pan-intro { flex-basis: min(520px, 34vw); }
    .kt-pan-more { flex-basis: min(400px, 28vw); }
    .kt-pan-sticky { padding-block: 72px; }

    .kt-pan.is-pinned .kt-pan-sticky {
        position: sticky;
        top: 0;
        height: 100vh;
        padding-block: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .kt-pan.is-pinned .kt-pan-track { overflow: visible; scroll-snap-type: none; will-change: transform; }
    .kt-pan.is-pinned .kt-pan-bar { display: block; }
}

/* Selected: one large cell, the others beside it; the grid adapts to 1-5 posts */
.kt-sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--kt-gutter); }
.kt-sel-item { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kt-sel-item:first-child { grid-column: 1 / -1; }
.kt-sel-item:nth-child(4):last-child,
.kt-sel-item:nth-child(2):last-child { grid-column: 1 / -1; }

.kt-sel-media { display: block; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 8px; background: var(--kt-surface); }
.kt-sel-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--kt-ease); }
.kt-sel-item:hover .kt-sel-media img { transform: scale(1.04); }

.kt-sel-title { font-size: 1.3rem; line-height: 1.12; letter-spacing: -0.025em; }
.kt-sel-title a::after { content: ""; position: absolute; inset: 0; }
.kt-sel-item:hover .kt-sel-title { color: var(--kt-accent-text); }
.kt-sel-item .kt-card-tag { color: var(--kt-muted); font-size: 0.875rem; font-weight: 500; }

@media (min-width: 960px) {
    .kt-sel { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px var(--kt-gutter); }
    .kt-sel-item:not(:first-child) { grid-column: span 3; }
    .kt-sel-item:first-child { grid-column: 1 / 7; grid-row: span 2; }
    .kt-sel-item:first-child .kt-sel-media { flex-grow: 1; aspect-ratio: auto; min-height: 320px; }
    .kt-sel-item:first-child .kt-sel-title { font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1.02; letter-spacing: -0.035em; }
    /* 1 post: full width. 2: side by side. 3: two stacked beside the large one. 4: last one spans the right half */
    .kt-sel-item:only-child { grid-column: 1 / -1; grid-row: auto; }
    .kt-sel-item:only-child .kt-sel-media { aspect-ratio: 21 / 9; flex-grow: 0; }
    .kt-sel-item:first-child:nth-last-child(2) { grid-row: auto; }
    .kt-sel-item:first-child:nth-last-child(2) .kt-sel-media { aspect-ratio: 4 / 3; flex-grow: 0; }
    .kt-sel-item:nth-child(2):last-child { grid-column: 7 / 13; }
    .kt-sel:has(> :nth-child(3):last-child) .kt-sel-item:not(:first-child) { grid-column: 7 / 13; }
    .kt-sel:has(> :nth-child(3):last-child) .kt-sel-item:not(:first-child) .kt-sel-media { aspect-ratio: 16 / 9; }
    .kt-sel-item:nth-child(4):last-child { grid-column: 7 / 13; }
    .kt-sel-item:nth-child(4):last-child .kt-sel-media { aspect-ratio: 16 / 7; }
}

/* About */
.kt-about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--kt-gutter); row-gap: 28px; align-items: start; }
.kt-about-media { grid-column: 1 / 9; overflow: hidden; }
.kt-about-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.6s ease; }
.kt-about-media:hover img { filter: none; }
.kt-about-text { grid-column: 1 / -1; }

.kt-about-lead {
    max-width: 30ch;
    margin-bottom: 26px;
    font-family: var(--kt-font-heading);
    font-size: clamp(1.6rem, 2.8vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

@media (min-width: 960px) {
    .kt-about-media { grid-column: 1 / 5; }
    .kt-about-text { grid-column: 6 / 12; }
    .kt-about-noimg .kt-about-text { grid-column: 1 / 10; }
}

/* Topics set like a poster */
.kt-topic-wall { display: flex; flex-wrap: wrap; gap: 0 clamp(18px, 2.5vw, 36px); }

.kt-topic-big {
    font-family: var(--kt-font-heading);
    font-size: clamp(2.6rem, 6.4vw, 6.5rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.05em;
    font-stretch: var(--kt-stretch);
    transition: color 0.2s;
}

.kt-topic-big sup {
    position: relative;
    top: 0.9em;
    margin-left: 6px;
    color: var(--kt-muted);
    font-family: var(--kt-font-body);
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0;
    vertical-align: top;
}

.kt-topic-big:hover { color: var(--kt-accent-text); }

/* 8. Archives (tag & author)
   ========================================================================== */

.kt-cover { padding-top: 32px; }

/* A solid accent block with the name set large, the image beside it */
.kt-cover-inner {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    overflow: hidden;
}

.kt-cover-body {
    position: relative;
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    min-height: 320px;
    padding: 28px;
    background: var(--kt-accent);
    color: var(--kt-on-accent);
    overflow: hidden;
}

.kt-cover-image { grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.kt-cover-kicker { font-size: 0.9rem; font-weight: 600; }

.kt-cover-title {
    font-size: clamp(3rem, 8vw, 7.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.055em;
    font-stretch: var(--kt-stretch);
    overflow-wrap: break-word;
    text-wrap: balance;
}

.kt-cover-desc { max-width: 46ch; font-size: 1.05rem; line-height: 1.5; }

.kt-cover-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9rem; }
.kt-cover-pill { font-weight: 700; }
.kt-cover-link { text-decoration: underline; text-underline-offset: 3px; }

/* No image: the name repeated as a giant watermark on the accent */
.kt-cover-watermark {
    position: absolute;
    right: -0.05em;
    bottom: -0.2em;
    z-index: 1;
    color: var(--kt-on-accent);
    font-family: var(--kt-font-heading);
    font-size: clamp(8rem, 26vw, 24rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    white-space: nowrap;
    opacity: 0.1;
    pointer-events: none;
}

.kt-cover-inner:not(.has-image) .kt-cover-body { min-height: 380px; background: transparent; }
.kt-cover-inner:not(.has-image) { background: var(--kt-accent); color: var(--kt-on-accent); }
.kt-cover-inner:not(.has-image) .kt-cover-body > * { position: relative; z-index: 2; }

.kt-cover-avatar { width: 88px; height: 88px; border: 0; }
.kt-cover-avatar img { filter: grayscale(1); }

.kt-cover-social { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-cover-social:empty { display: none; }
.kt-cover-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; box-shadow: inset 0 0 0 1.5px currentColor; }
.kt-cover-social .kt-icon { width: 16px; height: 16px; }

@media (min-width: 960px) {
    .kt-cover { padding-top: 48px; }
    .kt-cover-inner.has-image .kt-cover-body { grid-column: 1 / 6; grid-row: 1; min-height: 480px; padding: 40px; }
    /* Beside the image the block is five columns wide: a smaller size keeps long names whole */
    .kt-cover-inner.has-image .kt-cover-title { font-size: clamp(2.5rem, 4.4vw, 5rem); }
    .kt-cover-inner.has-image .kt-cover-image { grid-column: 6 / 13; grid-row: 1; height: 100%; aspect-ratio: auto; }
    .kt-cover-inner:not(.has-image) .kt-cover-body { padding: 48px; min-height: 440px; }
}

/* Topic / author switcher */
.kt-topics {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.kt-topics::-webkit-scrollbar { display: none; }

.kt-topic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 8px 14px;
    box-shadow: inset 0 0 0 1.5px var(--kt-text);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.kt-topic:hover,
.kt-topic.nav-current { background: var(--kt-text); color: var(--kt-bg); }
.kt-topic-count { opacity: 0.6; font-weight: 500; }
.kt-topic-avatar { width: 24px; height: 24px; border: 0; font-size: 0.7rem; }

/* Avatars & social links (square, like everything else) */
.kt-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    overflow: hidden;
    background: var(--kt-surface);
    font-weight: 700;
}

.kt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kt-avatar span { width: 1ch; overflow: hidden; white-space: nowrap; }
.kt-avatar-lg { width: 72px; height: 72px; }

.kt-social { display: flex; flex-wrap: wrap; gap: 6px; }

.kt-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    box-shadow: inset 0 0 0 1.5px var(--kt-text);
    transition: background-color 0.15s, color 0.15s;
}

.kt-social a:hover { background: var(--kt-accent); color: var(--kt-on-accent); box-shadow: none; }
.kt-social .kt-icon { width: 16px; height: 16px; }
.kt-social-sm a { width: 32px; height: 32px; }
.kt-social-sm .kt-icon { width: 14px; height: 14px; }
.kt-social-fallback { font-size: 0.65rem; font-weight: 700; }

/* 9. Article
   ========================================================================== */

.kt-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: 3px;
    pointer-events: none;
}

.kt-progress-bar {
    display: block;
    height: 100%;
    background: var(--kt-accent);
    transform: scaleX(0);
    transform-origin: left;
}

.kt-article-head {
    padding-top: 48px;
    padding-bottom: 32px;
}

@media (min-width: 1024px) {
    .kt-article-head { padding-top: 72px; }
}

.kt-article-head .kt-tag { display: inline-block; margin-bottom: 18px; }

.kt-article-title {
    font-size: clamp(2.1rem, 5.5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.kt-article-excerpt {
    margin-top: 18px;
    color: var(--kt-muted);
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    line-height: 1.5;
}

.kt-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.kt-avatars { display: flex; }
.kt-avatars .kt-avatar + .kt-avatar { margin-left: -12px; }

.kt-byline-names { font-weight: 600; }
.kt-byline-names a:hover { color: var(--kt-accent-text); }
.kt-byline .kt-meta { margin-top: 2px; }
.kt-meta-comments:hover { color: var(--kt-accent-text); }
/* The count is filled by Ghost JS and stays empty at 0: only show the separator when it has text */
.kt-meta > .kt-meta-comments::before { content: none; }
.kt-count:not(:empty)::before { content: "·"; margin-inline: 8px; }

.kt-article-image { margin: 0 auto 8px; }

.kt-article-image img {
    width: 100%;
    border-radius: var(--kt-radius-lg);
}

.kt-full.kt-article-image img { border-radius: 0; }

.kt-article-image figcaption,
.kt-content figcaption {
    margin-top: 12px;
    padding-inline: var(--kt-gutter);
    color: var(--kt-muted);
    font-size: 0.85rem;
    text-align: center;
}

.kt-article-image figcaption a,
.kt-content figcaption a { text-decoration: underline; }

.kt-article-body {
    position: relative;
    padding-top: 40px;
}

/* Table of contents: collapsible box, moved to the left margin on large screens */
.kt-toc {
    width: 100%;
    max-width: calc(var(--kt-content) + 2 * var(--kt-gutter));
    margin: 0 auto 32px;
    padding-inline: var(--kt-gutter);
}

.kt-toc-box {
    border: 1px solid var(--kt-border);
    border-radius: var(--kt-radius);
    background: var(--kt-surface);
}

.kt-toc-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.kt-toc-summary::-webkit-details-marker { display: none; }

/* Chevron */
.kt-toc-summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--kt-muted);
    border-bottom: 2px solid var(--kt-muted);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.kt-toc-box[open] .kt-toc-summary::after { transform: translateY(2px) rotate(-135deg); }

.kt-toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.kt-toc-count {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--kt-chip);
    color: var(--kt-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kt-toc-box nav { padding: 0 20px 16px; }

/* Each entry sits on a vertical rail: read sections and the current one are colored */
.kt-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.kt-toc-list li { counter-increment: toc; }

.kt-toc-list a {
    display: flex;
    gap: 10px;
    padding: 7px 0 7px 14px;
    border-left: 2px solid var(--kt-border);
    color: var(--kt-muted);
    font-size: 0.92rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.2s ease;
}

.kt-toc-list a::before {
    content: counter(toc, decimal-leading-zero);
    flex-shrink: 0;
    color: var(--kt-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.6;
}

.kt-toc-list a:hover { color: var(--kt-text); }

.kt-toc-list a.is-read { border-left-color: color-mix(in srgb, var(--kt-accent) 35%, transparent); }
.kt-toc-list a.is-read::before { color: var(--kt-accent-text); }

.kt-toc-list a.is-active {
    border-left-color: var(--kt-accent);
    color: var(--kt-text);
    font-weight: 600;
}

.kt-toc-list a.is-active::before { color: var(--kt-accent-text); }

@media (min-width: 1500px) {
    .kt-toc {
        position: absolute;
        top: 40px;
        bottom: 0;
        left: calc(50% - var(--kt-content) / 2 - 120px - 240px);
        width: 210px;
        margin: 0;
        padding: 0;
    }

    /* In the margin the box is always open and follows the reader */
    .kt-toc-box {
        position: sticky;
        top: calc(var(--kt-header-h) + 32px);
        border: 0;
        background: none;
    }

    .kt-toc-summary { padding: 0 0 14px; cursor: default; pointer-events: none; }
    .kt-toc-summary::after { display: none; }
    .kt-toc-box nav { padding: 0; }
}

.kt-article-foot {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 40px;
    padding-bottom: 24px;
}

.kt-article-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.kt-share {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-block: 16px;
    border-block: 1px solid var(--kt-border);
}

.kt-share .kt-label { margin: 0 8px 0 0; }
.kt-share .kt-icon { width: 18px; height: 18px; }
.kt-copy.is-copied { background: var(--kt-accent); color: var(--kt-on-accent); }

.kt-author-card {
    display: flex;
    gap: 18px;
    padding: 22px;
    border-radius: var(--kt-radius);
    background: var(--kt-surface);
}

.kt-author-card-body { display: flex; flex-direction: column; gap: 8px; }
.kt-author-card-name { font-family: var(--kt-font-heading); font-size: 1.15rem; font-weight: 700; }
.kt-author-card-name a:hover { color: var(--kt-accent-text); }
.kt-author-card-bio { color: var(--kt-muted); font-size: 0.95rem; }

.kt-comments { padding-block: 32px; }

.kt-related { border-top: 1px solid var(--kt-border); margin-top: 32px; }

/* 10. Content (Koenig editor)
   ========================================================================== */

.kt-content {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--kt-gutter), 1fr)
        [wide-start] minmax(0, 120px)
        [main-start] min(var(--kt-content), calc(100% - 2 * var(--kt-gutter)))
        [main-end] minmax(0, 120px)
        [wide-end] minmax(var(--kt-gutter), 1fr)
        [full-end];
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.kt-content-wide {
    grid-template-columns:
        [full-start] minmax(var(--kt-gutter), 1fr)
        [wide-start main-start] min(calc(var(--kt-wide) + 240px), calc(100% - 2 * var(--kt-gutter)))
        [main-end wide-end] minmax(var(--kt-gutter), 1fr)
        [full-end];
}

.kt-content > * { grid-column: main; }
.kt-content > .kg-width-wide { grid-column: wide; }
.kt-content > .kg-width-full { grid-column: full; }
/* Ghost's toggle card icon is 20px: give it a 24px hit area */
.kt-content .kg-toggle-card-icon { min-width: 24px; min-height: 24px; }

.kt-content > * + * { margin-top: 1.5em; margin-bottom: 0; }
.kt-content > :first-child { margin-top: 0; }

.kt-content > h2 { margin-top: 2em; font-size: 1.85rem; }
.kt-content > h3 { margin-top: 1.75em; font-size: 1.45rem; }
.kt-content > h4 { margin-top: 1.5em; font-size: 1.2rem; }
.kt-content > h2 + *,
.kt-content > h3 + *,
.kt-content > h4 + * { margin-top: 0.75em; }

.kt-content a {
    color: var(--kt-accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.kt-content a:hover { text-decoration-thickness: 2px; }

.kt-content strong { font-weight: 700; }

.kt-content ul,
.kt-content ol { padding-left: 1.4em; }
.kt-content li + li { margin-top: 0.4em; }
.kt-content li::marker { color: var(--kt-accent-text); }

.kt-content blockquote:not([class]) {
    margin-inline: 0;
    padding-left: 24px;
    border-left: 3px solid var(--kt-accent);
    font-size: 1.2rem;
    font-style: italic;
}

.kt-content blockquote.kg-blockquote-alt {
    margin-inline: 0;
    padding: 0.5em 1em;
    font-family: var(--kt-font-heading);
    font-size: 1.6rem;
    font-style: normal;
    line-height: 1.35;
    text-align: center;
}

.kt-content hr {
    width: 80px;
    height: 0;
    margin-block: 3em;
    border: 0;
    border-top: 2px solid var(--kt-border);
    justify-self: center;
}

.kt-content code:not(pre code) {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: var(--kt-chip);
    font-size: 0.88em;
}

.kt-content pre {
    overflow-x: auto;
    padding: 20px;
    border-radius: var(--kt-radius);
    background: #0f172a;
    color: #e6eaf2;
    font-size: 0.9rem;
    line-height: 1.6;
}

.kt-content table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.kt-content th,
.kt-content td { padding: 10px 14px; border-bottom: 1px solid var(--kt-border); text-align: left; }
.kt-content th { font-weight: 700; }

.kt-content figure { margin-inline: 0; }
.kt-content .kg-image-card img { border-radius: 12px; }
.kt-content .kg-width-full img { border-radius: 0; }
.kt-content .kg-gallery-image img { border-radius: 10px; }

.kt-content .kg-callout-card,
.kt-content .kg-toggle-card,
.kt-content .kg-product-card-container { border-radius: var(--kt-radius); }

.kt-content .kg-bookmark-container { border-radius: var(--kt-radius); color: var(--kt-text); text-decoration: none; }

/* Members-only CTA injected by {{content}} */
.kt-content .gh-post-upgrade-cta-content { border-radius: var(--kt-radius-lg); }

/* Full-width card spacing (see @page docs) */
.kt-content > .kg-width-full + .kg-width-full:not(.kg-card-hascaption + .kg-width-full) { margin-top: 0; }
.kt-page .kt-content > .kg-width-full:first-child { margin-top: calc(-1 * 40px); }
.kt-page:not(:has(.kt-article-head)) .kt-content > .kg-width-full:first-child { margin-top: 0; }
.kt-page .kt-content > .kg-width-full:last-child:not(.kg-card-hascaption) { margin-bottom: -64px; }

.kt-page .kt-content { padding-bottom: 64px; }
.kt-page .kt-article-image { margin-bottom: 40px; }


/* 9b. Article, Swiss head and flat images (overrides of the shared article styles above)
   ========================================================================== */

.kt-article-head {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    row-gap: 28px;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Title first on small screens, the facts below it */
.kt-article-heading { grid-column: 1 / -1; grid-row: 1; }

.kt-article-title {
    font-size: clamp(2.5rem, 6vw, 6rem);
    font-weight: 750;
    line-height: 0.95;
    letter-spacing: -0.045em;
    font-stretch: var(--kt-stretch);
    text-wrap: balance;
}

.kt-article-excerpt {
    max-width: 40ch;
    margin-top: 22px;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
}

/* Facts column: topic, date, reading time, author */
.kt-article-facts {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    font-size: 0.95rem;
}

.kt-article-facts > div { padding-block: 10px; border-top: 1px solid var(--kt-border); }
.kt-article-facts dt { color: var(--kt-muted); font-size: 0.8rem; }
.kt-article-facts dd { font-weight: 600; }
.kt-article-facts dd a:hover { color: var(--kt-accent-text); }
.kt-article-facts .kt-count::before { content: none; }

@media (min-width: 960px) {
    .kt-article-head { padding-top: 64px; padding-bottom: 56px; }
    .kt-article-facts { grid-column: 1 / 4; grid-row: 1; grid-template-columns: 1fr; align-self: end; }
    .kt-article-heading { grid-column: 4 / 13; }
    .kt-page .kt-article-heading { grid-column: 1 / 11; }
}

.kt-article-image { margin-bottom: 8px; }
.kt-article-image img,
.kt-content .kg-image-card img,
.kt-content .kg-gallery-image img { border-radius: 0; }

.kt-article-foot { border-top: 2px solid var(--kt-rule); padding-top: 28px; }

.kt-tag-soft {
    display: inline-flex;
    padding: 6px 12px;
    box-shadow: inset 0 0 0 1.5px var(--kt-text);
    font-size: 0.85rem;
    font-weight: 600;
}

.kt-tag-soft:hover { background: var(--kt-text); color: var(--kt-bg); }

.kt-share .kt-icon-btn { box-shadow: inset 0 0 0 1.5px var(--kt-text); }
.kt-share .kt-icon-btn:hover { background: var(--kt-text); color: var(--kt-bg); }

.kt-author-card { border: 0; border-top: 1px solid var(--kt-border); border-radius: 0; background: none; padding: 24px 0 0; }
.kt-author-card .kt-avatar img { filter: grayscale(1); }

.kt-toc-box,
.kt-content .kg-callout-card,
.kt-content .kg-toggle-card,
.kt-content .kg-bookmark-container,
.kt-content .kg-product-card-container,
.kt-content .gh-post-upgrade-cta-content { border-radius: 0; }

.kt-content > h2 { font-size: clamp(1.75rem, 3vw, 2.4rem); letter-spacing: -0.035em; }
.kt-content blockquote:not([class]) { border-left-color: var(--kt-accent); }

.kt-related .kt-section-head { margin-bottom: 28px; }

/* 11. Newsletter: the accent as a poster block
   ========================================================================== */

.kt-newsletter {
    margin-top: 48px;
    background: var(--kt-accent);
    color: var(--kt-on-accent);
}

.kt-newsletter-inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    row-gap: 28px;
    align-items: end;
    padding-block: 48px 56px;
}

.kt-newsletter-title {
    grid-column: 1 / -1;
    font-size: clamp(2.5rem, 6vw, 6rem);
    font-weight: 750;
    line-height: 0.95;
    letter-spacing: -0.045em;
    font-stretch: var(--kt-stretch);
}

.kt-newsletter .kt-form { grid-column: 1 / -1; }

@media (min-width: 960px) {
    .kt-newsletter-inner { padding-block: 72px 80px; }
    .kt-newsletter-title { grid-column: 1 / 8; }
    .kt-newsletter .kt-form { grid-column: 8 / 13; }
}

/* 12. Footer
   ========================================================================== */

.kt-footer { padding-block: 56px 32px; }

.kt-footer-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--kt-gutter);
    row-gap: 32px;
}

.kt-footer-about { grid-column: 1 / -1; }

.kt-brand-small { height: auto; margin-left: 0; padding: 10px 14px; }
.kt-brand-small .kt-brand-title { font-size: 1.4rem; }
.kt-brand-small.kt-brand-image { padding: 0; }

.kt-footer-text { max-width: 34ch; margin-top: 14px; color: var(--kt-muted); font-size: 0.95rem; }

.kt-footer-heading { margin-bottom: 12px; font-family: var(--kt-font-body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0; }

.kt-footer-menu { margin: 0; padding: 0; list-style: none; }
.kt-footer-menu li + li { margin-top: 6px; }
.kt-footer-menu a { color: var(--kt-muted); font-size: 0.95rem; }
.kt-footer-menu a:hover { color: var(--kt-accent-text); }

.kt-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 24px;
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px solid var(--kt-rule);
    color: var(--kt-muted);
    font-size: 0.875rem;
}

.kt-footer-bottom a { text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 960px) {
    .kt-footer-top { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .kt-footer-about { grid-column: 1 / 5; }
    .kt-footer-col { grid-column: span 2; }
    .kt-footer-about + .kt-footer-col { grid-column: 7 / 9; }
}

/* 13. Misc
   ========================================================================== */

.kt-error {
    padding-block: 80px 40px;
    text-align: center;
}

.kt-error-code {
    color: var(--kt-accent-text);
    font-family: var(--kt-font-heading);
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
}

.kt-error-title { margin: 16px 0 12px; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.kt-error .kt-btn { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.kt-pagination[hidden] { display: none; }
