/* ============================================================================
   TechSyntax — modern layer
   ----------------------------------------------------------------------------
   Loaded after styles.min.css. Everything here is written against tokens.css.
   Order: base type -> primitives -> chrome -> page patterns.
   ========================================================================== */

/* ==========================================================================
   1. BASE TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6,
.ts-display {
    font-family: var(--ts-font-display);
    color: var(--ts-text-strong);
    letter-spacing: var(--ts-tracking-tight);
    line-height: var(--ts-leading-tight);
    font-weight: var(--ts-weight-bold);
    text-wrap: balance;
}

.ts-display {
    font-size: var(--ts-text-display);
    font-weight: var(--ts-weight-black);
}

.ts-h1 { font-size: var(--ts-text-h1); }
.ts-h2 { font-size: var(--ts-text-h2); line-height: var(--ts-leading-snug); }
.ts-h3 { font-size: var(--ts-text-h3); line-height: var(--ts-leading-snug); }

.ts-body { font-size: var(--ts-text-body); line-height: var(--ts-leading-body); }
.ts-small { font-size: var(--ts-text-sm); line-height: 1.6; }

/* Metadata: dates, reading time, counts. Never competes with a title. */
.ts-meta {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    line-height: 1.4;
    color: var(--ts-text-muted);
    font-weight: var(--ts-weight-normal);
    letter-spacing: 0;
}

/* Labels: section eyebrows and overlines. */
.ts-label {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
    line-height: 1.3;
}

.ts-muted { color: var(--ts-text-muted); }

/* ---- Focus ---------------------------------------------------------------
   One visible focus treatment for the whole site. :focus-visible only, so a
   mouse click never paints a ring, but every keyboard path does. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--ts-focus);
    outline-offset: 2px;
    border-radius: var(--ts-radius-xs);
}

/* Bootstrap removes outlines on .btn:focus; put one back. */
.btn:focus-visible,
.btn:focus {
    outline: 2px solid var(--ts-focus);
    outline-offset: 2px;
    box-shadow: none;
}

.btn:focus:not(:focus-visible) { outline: none; }

/* Skip link: first tab stop on every page. */
.ts-skip-link {
    position: absolute;
    left: var(--ts-space-4);
    top: var(--ts-space-2);
    z-index: var(--ts-z-modal);
    transform: translateY(-200%);
    background: var(--ts-accent);
    color: var(--ts-accent-on);
    padding: var(--ts-space-2) var(--ts-space-4);
    border-radius: var(--ts-radius-md);
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    text-decoration: none;
    transition: transform var(--ts-dur) var(--ts-ease);
}

.ts-skip-link:focus {
    transform: translateY(0);
    color: var(--ts-accent-on);
}

.ts-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   2. LAYOUT
   ========================================================================== */

.blog-content {
    padding-top: var(--ts-space-8);
    padding-bottom: var(--ts-space-12);
}

.ts-section {
    margin-top: var(--ts-section-gap);
}

.ts-section:first-child { margin-top: 0; }

.ts-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--ts-space-4);
    flex-wrap: wrap;
    margin-bottom: var(--ts-space-5);
    padding-bottom: var(--ts-space-3);
    border-bottom: 1px solid var(--ts-border);
}

.ts-section-title {
    margin: 0;
    font-size: var(--ts-text-h2);
    line-height: var(--ts-leading-snug);
}

.ts-section-sub {
    margin: var(--ts-space-2) 0 0;
    font-size: var(--ts-text-sm);
    color: var(--ts-text-muted);
    max-width: 52ch;
}

.ts-section-link {
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-semi);
    color: var(--ts-accent);
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-1);
    min-height: var(--ts-tap);
}

.ts-section-link:hover { color: var(--ts-accent-hover); }
.ts-section-link .fa { font-size: .8em; transition: transform var(--ts-dur) var(--ts-ease); }
.ts-section-link:hover .fa { transform: translateX(2px); }

/* ==========================================================================
   3. PRIMITIVES
   ========================================================================== */

/* ---- Buttons ---- */
.btn,
.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ts-space-2);
    min-height: var(--ts-tap);
    padding: .5625rem var(--ts-space-4);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    line-height: 1.2;
    letter-spacing: 0;
    border-radius: var(--ts-radius-md);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--ts-dur) var(--ts-ease),
                border-color var(--ts-dur) var(--ts-ease),
                color var(--ts-dur) var(--ts-ease),
                transform var(--ts-dur-fast) var(--ts-ease);
    text-transform: none;
}

.btn:active,
.ts-btn:active { transform: translateY(1px); }

.ts-btn-primary,
.btn-primary {
    background: var(--ts-brand-600);
    border-color: var(--ts-brand-600);
    color: #fff;
}

.ts-btn-primary:hover,
.btn-primary:hover,
.btn-primary:focus {
    background: var(--ts-brand-700);
    border-color: var(--ts-brand-700);
    color: #fff;
}

.ts-btn-secondary,
.btn-outline-dark,
.btn-outline-primary {
    background: var(--ts-bg-raised);
    border-color: var(--ts-border-strong);
    color: var(--ts-text-strong);
}

.ts-btn-secondary:hover,
.btn-outline-dark:hover,
.btn-outline-primary:hover,
.btn-outline-dark:focus,
.btn-outline-primary:focus {
    background: var(--ts-bg-hover);
    border-color: var(--ts-accent);
    color: var(--ts-text-strong);
}

.ts-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ts-text-muted);
}

.ts-btn-ghost:hover {
    background: var(--ts-bg-hover);
    color: var(--ts-text-strong);
}

.ts-btn-sm {
    min-height: 2.25rem;
    padding: .3125rem var(--ts-space-3);
    font-size: var(--ts-text-meta);
}

.ts-btn-lg {
    min-height: 3rem;
    padding: .75rem var(--ts-space-6);
    font-size: var(--ts-text-body);
}

.ts-btn-block { width: 100%; }

/* ---- Card ---- */
.ts-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    transition: border-color var(--ts-dur) var(--ts-ease),
                box-shadow var(--ts-dur) var(--ts-ease),
                transform var(--ts-dur) var(--ts-ease);
}

.ts-card:hover {
    border-color: var(--ts-border-strong);
    box-shadow: var(--ts-shadow-md);
}

/* A whole-card link target. The <a> on the title stays the real, crawlable
   link; this pseudo-element only widens the hit area. */
.ts-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.ts-card:focus-within {
    border-color: var(--ts-accent);
    box-shadow: var(--ts-shadow-md);
}

/* Anything that must stay clickable above the card-wide target. */
.ts-card-above { position: relative; z-index: 1; }

/* ---- Badge / category pill ---- */
.ts-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-1);
    padding: .1875rem .5rem;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: .02em;
    line-height: 1.35;
    border-radius: var(--ts-radius-sm);
    background: var(--ts-accent-soft);
    color: var(--ts-accent-text);
    text-decoration: none;
    border: 1px solid transparent;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.ts-badge:hover {
    background: var(--ts-brand-100);
    color: var(--ts-accent-text);
}

:root[data-theme="dark"] a.ts-badge:hover { background: rgba(99, 102, 241, .26); }

.ts-badge-neutral {
    background: var(--ts-bg-inset);
    color: var(--ts-text-muted);
}

/* ---- Tag / chip ---- */
.ts-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: 2.25rem;
    padding: .375rem .75rem;
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-pill);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--ts-dur) var(--ts-ease),
                border-color var(--ts-dur) var(--ts-ease),
                color var(--ts-dur) var(--ts-ease);
    white-space: nowrap;
}

.ts-chip:hover {
    border-color: var(--ts-accent);
    color: var(--ts-text-strong);
    background: var(--ts-bg-hover);
}

.ts-chip[aria-pressed="true"],
.ts-chip.is-active {
    background: var(--ts-brand-600);
    border-color: var(--ts-brand-600);
    color: #fff;
}

.ts-chip[aria-pressed="true"]:hover,
.ts-chip.is-active:hover {
    background: var(--ts-brand-700);
    border-color: var(--ts-brand-700);
    color: #fff;
}

.ts-chip-count {
    font-size: var(--ts-text-label);
    font-variant-numeric: tabular-nums;
    color: var(--ts-text-muted);
    background: var(--ts-bg-inset);
    border-radius: var(--ts-radius-pill);
    padding: 0 .375rem;
    min-width: 1.375rem;
    text-align: center;
}

.ts-chip[aria-pressed="true"] .ts-chip-count,
.ts-chip.is-active .ts-chip-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.ts-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ts-space-2);
}

/* Horizontal scroll variant for filter rails on narrow screens. */
.ts-chip-rail {
    display: flex;
    gap: var(--ts-space-2);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--ts-space-1);
    margin-inline: calc(var(--ts-gutter) * -1);
    padding-inline: var(--ts-gutter);
}

.ts-chip-rail::-webkit-scrollbar { display: none; }
.ts-chip-rail > * { flex: 0 0 auto; }

@media (min-width: 48rem) {
    .ts-chip-rail {
        flex-wrap: wrap;
        overflow: visible;
        margin-inline: 0;
        padding-inline: 0;
    }
}

/* ---- Input / search field ---- */
.ts-field {
    position: relative;
    display: flex;
    align-items: center;
}

.ts-field .fa {
    position: absolute;
    left: var(--ts-space-3);
    color: var(--ts-text-subtle);
    pointer-events: none;
    font-size: .9375rem;
}

.ts-input,
.form-control {
    width: 100%;
    min-height: var(--ts-tap);
    padding: .5625rem var(--ts-space-3);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-body);
    color: var(--ts-text);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-md);
    transition: border-color var(--ts-dur) var(--ts-ease),
                box-shadow var(--ts-dur) var(--ts-ease);
    -webkit-appearance: none;
    appearance: none;
}

.ts-field .ts-input { padding-left: 2.375rem; }

.ts-input::placeholder { color: var(--ts-text-subtle); }

.ts-input:focus,
.form-control:focus {
    border-color: var(--ts-accent);
    box-shadow: 0 0 0 3px var(--ts-accent-soft);
    outline: none;
    background: var(--ts-bg-raised);
    color: var(--ts-text);
}

.ts-input-clear {
    position: absolute;
    right: .375rem;
    width: 2rem;
    height: 2rem;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--ts-text-subtle);
    border-radius: var(--ts-radius-pill);
    cursor: pointer;
}

.ts-input-clear:hover { color: var(--ts-text-strong); background: var(--ts-bg-hover); }
.ts-field.has-value .ts-input-clear { display: inline-flex; }

.ts-select {
    min-height: var(--ts-tap);
    padding: .5rem 2rem .5rem var(--ts-space-3);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    background-color: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.ts-select:hover { border-color: var(--ts-border-strong); }

.ts-label-inline {
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    white-space: nowrap;
}

/* ---- Progress ---- */
.ts-progress {
    height: .375rem;
    background: var(--ts-bg-inset);
    border-radius: var(--ts-radius-pill);
    overflow: hidden;
}

.ts-progress-bar {
    height: 100%;
    background: var(--ts-brand-600);
    border-radius: inherit;
    transition: width var(--ts-dur-slow) var(--ts-ease);
}

/* ---- Alert ---- */
.ts-alert {
    display: flex;
    gap: var(--ts-space-3);
    padding: var(--ts-space-3) var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-left: 3px solid var(--ts-info);
    border-radius: var(--ts-radius-md);
    background: var(--ts-bg-raised);
    font-size: var(--ts-text-sm);
    color: var(--ts-text);
}

.ts-alert-success { border-left-color: var(--ts-success); }
.ts-alert-danger  { border-left-color: var(--ts-danger); }
.ts-alert .fa { margin-top: .2rem; }

/* ---- Empty state ---- */
.ts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--ts-space-2);
    padding: var(--ts-space-12) var(--ts-space-4);
    border: 1px dashed var(--ts-border-strong);
    border-radius: var(--ts-radius-lg);
    color: var(--ts-text-muted);
}

.ts-empty-icon {
    font-size: 1.5rem;
    color: var(--ts-text-subtle);
    margin-bottom: var(--ts-space-1);
}

.ts-empty-title {
    font-family: var(--ts-font-display);
    font-size: var(--ts-text-h3);
    color: var(--ts-text-strong);
    margin: 0;
}

.ts-empty-body {
    margin: 0;
    font-size: var(--ts-text-sm);
    max-width: 44ch;
}

/* ---- Skeleton / loading ---- */
.ts-skeleton {
    background: linear-gradient(90deg, var(--ts-bg-inset) 25%, var(--ts-bg-hover) 37%, var(--ts-bg-inset) 63%);
    background-size: 400% 100%;
    animation: ts-shimmer 1.4s ease infinite;
    border-radius: var(--ts-radius-sm);
}

@keyframes ts-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---- Avatar ---- */
.ts-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--ts-radius-pill);
    background: var(--ts-accent-soft);
    color: var(--ts-accent-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-semi);
    flex: 0 0 auto;
    overflow: hidden;
}

.ts-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   4. HEADER + PRIMARY NAVIGATION
   ========================================================================== */

.blog-header {
    padding: 0;
    min-height: var(--ts-header-h);
    background: var(--ts-bg-header);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--ts-border);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: var(--ts-z-header);
    transition: box-shadow var(--ts-dur) var(--ts-ease);
}

/* The legacy sheet shrinks header padding on scroll; with a fixed-height bar
   there is nothing to shrink, so .scrolled only gains a separation shadow. */
.blog-header.scrolled {
    padding: 0;
    box-shadow: var(--ts-shadow-sm);
}

.ts-header-inner {
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: var(--ts-header-h);
}

.ts-logo {
    display: inline-flex;
    align-items: center;
    font-family: var(--ts-font-display);
    font-size: 1.0625rem;
    font-weight: var(--ts-weight-bold);
    letter-spacing: -.5px;
    color: var(--ts-text-strong);
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
    padding: var(--ts-space-2) 0;
    margin-right: var(--ts-space-2);
}

.ts-logo:hover { color: var(--ts-text-strong); opacity: .82; }
.ts-logo .ts-logo-bracket { opacity: .4; font-weight: var(--ts-weight-normal); }
.ts-logo .ts-logo-strong { font-weight: var(--ts-weight-black); }

@media (min-width: 22.5rem) {
    .ts-logo { font-size: 1.125rem; }
}

/* ---- Desktop nav ---- */
.ts-nav { display: none; }

.ts-nav-list {
    display: flex;
    align-items: center;
    gap: var(--ts-space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-nav-item { position: relative; }

.ts-nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-1);
    height: 2.25rem;
    padding: 0 var(--ts-space-3);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--ts-radius-md);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--ts-dur) var(--ts-ease), background-color var(--ts-dur) var(--ts-ease);
}

.ts-nav-link:hover,
.ts-nav-link[aria-expanded="true"] {
    color: var(--ts-text-strong);
    background: var(--ts-bg-hover);
}

.ts-nav-link[aria-current="page"] {
    color: var(--ts-text-strong);
    font-weight: var(--ts-weight-semi);
}

.ts-nav-link .ts-caret {
    font-size: .7em;
    opacity: .6;
    transition: transform var(--ts-dur) var(--ts-ease);
}

.ts-nav-link[aria-expanded="true"] .ts-caret { transform: rotate(180deg); }

/* ---- Topics menu ---- */
.ts-nav-menu {
    position: absolute;
    top: calc(100% + .5rem);
    left: 0;
    min-width: 22rem;
    max-width: min(34rem, calc(100vw - 2rem));
    padding: var(--ts-space-3);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    box-shadow: var(--ts-shadow-lg);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity var(--ts-dur) var(--ts-ease),
                transform var(--ts-dur) var(--ts-ease),
                visibility var(--ts-dur) var(--ts-ease);
}

.ts-nav-item.is-open .ts-nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ts-nav-menu-title {
    margin: 0 0 var(--ts-space-2);
    padding: 0 var(--ts-space-2);
}

.ts-nav-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-nav-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ts-space-2);
    padding: var(--ts-space-2);
    border-radius: var(--ts-radius-md);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    text-decoration: none;
    min-height: 2.25rem;
}

.ts-nav-menu-link:hover {
    background: var(--ts-bg-hover);
    color: var(--ts-text-strong);
}

.ts-nav-menu-link span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ts-nav-menu-count {
    font-size: var(--ts-text-label);
    font-variant-numeric: tabular-nums;
    color: var(--ts-text-muted);
    flex: 0 0 auto;
}

.ts-nav-menu-foot {
    margin-top: var(--ts-space-2);
    padding-top: var(--ts-space-2);
    border-top: 1px solid var(--ts-border);
}

/* ---- Header actions ---- */
.ts-header-actions {
    display: flex;
    align-items: center;
    gap: var(--ts-space-1);
    margin-left: auto;
    flex: 0 0 auto;
}

.ts-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ts-tap);
    height: var(--ts-tap);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ts-text-muted);
    border-radius: var(--ts-radius-md);
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: color var(--ts-dur) var(--ts-ease), background-color var(--ts-dur) var(--ts-ease);
}

.ts-icon-btn:hover {
    color: var(--ts-text-strong);
    background: var(--ts-bg-hover);
}

/* Search: a real affordance on desktop, an icon button on phones. */
.ts-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-2);
    height: var(--ts-tap);
    width: var(--ts-tap);
    justify-content: center;
    padding: 0;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--ts-radius-md);
    cursor: pointer;
    transition: color var(--ts-dur) var(--ts-ease), background-color var(--ts-dur) var(--ts-ease),
                border-color var(--ts-dur) var(--ts-ease);
}

.ts-search-trigger:hover { color: var(--ts-text-strong); background: var(--ts-bg-hover); }
.ts-search-trigger .ts-search-text,
.ts-search-trigger kbd { display: none; }

@media (min-width: 48rem) {
    .ts-search-trigger {
        width: auto;
        min-width: 15rem;
        justify-content: flex-start;
        padding: 0 var(--ts-space-2) 0 var(--ts-space-3);
        height: 2.25rem;
        background: var(--ts-bg-raised);
        border: 1px solid var(--ts-border);
    }

    .ts-search-trigger:hover { border-color: var(--ts-border-strong); background: var(--ts-bg-raised); }

    .ts-search-trigger .ts-search-text {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
        flex: 1;
    }

    .ts-search-trigger kbd {
        display: inline-block;
        font-family: var(--ts-font-mono);
        font-size: var(--ts-text-label);
        line-height: 1;
        padding: .25rem .3125rem;
        color: var(--ts-text-muted);
        background: var(--ts-bg-inset);
        border: 1px solid var(--ts-border);
        border-radius: var(--ts-radius-xs);
        flex: 0 0 auto;
    }
}

.ts-header-auth { display: none; }

/* The theme toggle shows the icon for the mode it switches TO. */
.ts-icon-btn .theme-icon-dark { display: none; }
:root[data-theme="dark"] .ts-icon-btn .theme-icon-dark { display: inline; }
:root[data-theme="dark"] .ts-icon-btn .theme-icon-light { display: none; }

/* ---- Menu button (drawer trigger) ---- */
.ts-menu-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: var(--ts-tap);
    height: var(--ts-tap);
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: var(--ts-radius-md);
    cursor: pointer;
}

.ts-menu-btn:hover { background: var(--ts-bg-hover); }

.ts-menu-btn span {
    display: block;
    width: 1.125rem;
    height: 2px;
    border-radius: 2px;
    background: var(--ts-text);
    transition: transform var(--ts-dur) var(--ts-ease), opacity var(--ts-dur) var(--ts-ease);
}

.ts-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ts-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ts-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Desktop: full nav, no drawer trigger. */
@media (min-width: 64rem) {
    .ts-nav { display: block; }
    .ts-menu-btn { display: none; }
    .ts-header-auth { display: inline-flex; }
}

/* ==========================================================================
   5. MOBILE DRAWER
   ========================================================================== */

.ts-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 92vw);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--ts-bg-raised);
    border-left: 1px solid var(--ts-border);
    box-shadow: var(--ts-shadow-lg);
    z-index: var(--ts-z-drawer);
    transform: translateX(102%);
    transition: transform var(--ts-dur-slow) var(--ts-ease), visibility var(--ts-dur-slow);
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.ts-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.ts-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ts-space-2);
    padding: var(--ts-space-3) var(--ts-space-4);
    border-bottom: 1px solid var(--ts-border);
    position: sticky;
    top: 0;
    background: var(--ts-bg-raised);
    z-index: 1;
}

.ts-drawer-body { padding: var(--ts-space-4) var(--ts-space-4) var(--ts-space-10); }

.ts-drawer-group + .ts-drawer-group {
    margin-top: var(--ts-space-5);
    padding-top: var(--ts-space-4);
    border-top: 1px solid var(--ts-border);
}

.ts-drawer-group-title { margin: 0 0 var(--ts-space-2); }

.ts-drawer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ts-drawer-link {
    display: flex;
    align-items: center;
    gap: var(--ts-space-3);
    min-height: var(--ts-tap);
    padding: var(--ts-space-2) var(--ts-space-2);
    margin-inline: calc(var(--ts-space-2) * -1);
    border-radius: var(--ts-radius-md);
    font-size: var(--ts-text-body);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    text-decoration: none;
}

.ts-drawer-link:hover,
.ts-drawer-link:focus { background: var(--ts-bg-hover); color: var(--ts-text-strong); }
.ts-drawer-link[aria-current="page"] { color: var(--ts-accent-text); font-weight: var(--ts-weight-semi); }

.ts-drawer-link .fa {
    width: 1.125rem;
    text-align: center;
    color: var(--ts-text-subtle);
    font-size: .9375rem;
    flex: 0 0 auto;
}

.ts-drawer-link-count {
    margin-left: auto;
    font-size: var(--ts-text-label);
    font-variant-numeric: tabular-nums;
    color: var(--ts-text-muted);
}

.ts-overlay {
    position: fixed;
    inset: 0;
    background: var(--ts-bg-overlay);
    z-index: var(--ts-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--ts-dur-slow) var(--ts-ease), visibility var(--ts-dur-slow);
}

.ts-overlay.is-open { opacity: 1; visibility: visible; }

body.ts-scroll-lock { overflow: hidden; }

/* The legacy off-canvas panel and its full-black overlay are replaced by the
   markup above; neutralise them so a stale cached script cannot reveal them. */
.blog-sidebar,
.overlay { display: none !important; }

/* ==========================================================================
   6. FOOTER
   ========================================================================== */

.container-footer { max-width: none; padding: 0; }

.blog-footer {
    margin-top: var(--ts-section-gap);
    padding: var(--ts-space-12) 0 var(--ts-space-8);
    background: var(--ts-bg-sunken);
    border-top: 1px solid var(--ts-border);
    color: var(--ts-text-muted);
    font-size: var(--ts-text-meta);
}

.ts-footer-inner {
    max-width: var(--ts-container);
    margin: 0 auto;
    padding-inline: var(--ts-gutter);
}

.ts-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-8);
}

.ts-footer-brand-text {
    margin: var(--ts-space-3) 0 0;
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    max-width: 34ch;
    line-height: 1.6;
}

.ts-footer-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ts-space-6) var(--ts-space-4);
}

.ts-footer-col-title { margin: 0 0 var(--ts-space-3); }

.ts-footer-list { list-style: none; margin: 0; padding: 0; }

.ts-footer-list a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    text-decoration: none;
}

.ts-footer-list a:hover { color: var(--ts-text-strong); }

.ts-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ts-space-3);
    margin-top: var(--ts-space-10);
    padding-top: var(--ts-space-5);
    border-top: 1px solid var(--ts-border);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
}

.ts-footer-bottom a { color: var(--ts-text-muted); text-decoration: none; }
.ts-footer-bottom a:hover { color: var(--ts-text-strong); }

@media (min-width: 48rem) {
    .ts-footer-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); gap: var(--ts-space-12); }
    .ts-footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ==========================================================================
   7. COOKIE CONSENT
   ========================================================================== */

.ts-cookie {
    position: fixed;
    left: var(--ts-gutter);
    right: var(--ts-gutter);
    bottom: var(--ts-gutter);
    z-index: var(--ts-z-cookie);
    max-width: 30rem;
    margin-left: auto;
    padding: var(--ts-space-4);
    background: var(--ts-bg-raised);
    color: var(--ts-text);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-lg);
    box-shadow: var(--ts-shadow-lg);
    font-size: var(--ts-text-meta);
    line-height: 1.55;
}

.ts-cookie[hidden] { display: none !important; }

.ts-cookie-title {
    margin: 0 0 var(--ts-space-1);
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    color: var(--ts-text-strong);
    font-family: var(--ts-font-sans);
    letter-spacing: 0;
}

.ts-cookie-body { margin: 0 0 var(--ts-space-4); color: var(--ts-text-muted); }
.ts-cookie-body a { color: var(--ts-accent); text-decoration: underline; }

.ts-cookie-actions {
    display: flex;
    gap: var(--ts-space-2);
}

.ts-cookie-actions .ts-btn { flex: 1; }

@media (min-width: 30rem) {
    .ts-cookie-actions .ts-btn { flex: 0 0 auto; }
    .ts-cookie-actions { justify-content: flex-end; }
}

/* ---- Back-to-top ---- */
.goup {
    position: fixed;
    right: var(--ts-gutter);
    bottom: var(--ts-gutter);
    width: var(--ts-tap);
    height: var(--ts-tap);
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--ts-bg-raised);
    color: var(--ts-text-muted);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-pill);
    box-shadow: var(--ts-shadow-sm);
    cursor: pointer;
    z-index: 90;
}

.goup:hover { color: var(--ts-text-strong); border-color: var(--ts-border-strong); }

/* Keep the cookie card clear of the back-to-top button. */
.ts-cookie ~ .goup { bottom: calc(var(--ts-gutter) + 1rem); }

/* ==========================================================================
   8. HOMEPAGE — HERO
   ========================================================================== */

.ts-hero {
    padding: var(--ts-space-4) 0 var(--ts-space-8);
    border-bottom: 1px solid var(--ts-border);
    margin-bottom: var(--ts-space-8);
}

@media (min-width: 48rem) {
    .ts-hero { padding-top: var(--ts-space-10); }
}

.ts-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-2);
    margin-bottom: var(--ts-space-4);
}

.ts-hero-eyebrow .fa { color: var(--ts-accent); }

.ts-hero-title {
    margin: 0;
    font-size: var(--ts-text-display);
    font-weight: var(--ts-weight-black);
    line-height: 1.06;
    letter-spacing: -.03em;
    max-width: 21ch;
}

.ts-hero-lede {
    margin: var(--ts-space-5) 0 0;
    font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
    line-height: 1.6;
    color: var(--ts-text-muted);
    max-width: 58ch;
}

.ts-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ts-space-3);
    margin-top: var(--ts-space-6);
}

.ts-hero-actions .ts-btn { flex: 1 1 auto; }

@media (min-width: 30rem) {
    .ts-hero-actions .ts-btn { flex: 0 0 auto; }
}

/* Topic rail directly under the hero: the fastest route into the taxonomy. */
.ts-hero-topics {
    display: flex;
    align-items: center;
    gap: var(--ts-space-3);
    margin-top: var(--ts-space-8);
    padding-top: var(--ts-space-5);
    border-top: 1px solid var(--ts-border);
    min-width: 0;
}

.ts-hero-topics-label { flex: 0 0 auto; display: none; }

@media (min-width: 48rem) {
    .ts-hero-topics-label { display: block; }
}

/* ==========================================================================
   9. POST CARDS
   ========================================================================== */

/* The legacy .posts flex row becomes a responsive grid: 1 / 2 / 3 columns. */
.posts,
.ts-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-5);
}

@media (min-width: 40rem) {
    .posts,
    .ts-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 90rem) {
    .ts-card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Reset the legacy card so the token version below is not fighting it. */
.post-home {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    float: none;
    background: none;
    border: 0;
    box-shadow: none;
}

.post-home,
.ts-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    overflow: hidden;
    transition: border-color var(--ts-dur) var(--ts-ease),
                box-shadow var(--ts-dur) var(--ts-ease),
                transform var(--ts-dur) var(--ts-ease);
}

.post-home:hover,
.ts-post-card:hover {
    border-color: var(--ts-border-strong);
    box-shadow: var(--ts-shadow-md);
    transform: translateY(-2px);
}

.post-home:focus-within,
.ts-post-card:focus-within {
    border-color: var(--ts-accent);
    box-shadow: var(--ts-shadow-md);
}

.post-home-inner,
.ts-post-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-2);
    padding: var(--ts-space-5);
    flex: 1 1 auto;
    min-width: 0;
}

.post-cover,
.ts-post-card-media {
    display: block;
    margin: 0;
    aspect-ratio: 16 / 9;
    background: var(--ts-bg-inset);
    overflow: hidden;
    border-bottom: 1px solid var(--ts-border);
    flex: 0 0 auto;
}

.post-cover img,
.ts-post-card-media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--ts-dur-slow) var(--ts-ease);
}

.post-home:hover .post-cover img,
.ts-post-card:hover .ts-post-card-media img { transform: scale(1.03); }

.post-home .post-header,
.ts-post-card-head {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-2);
    align-items: flex-start;
    margin: 0;
    padding: 0;
    border: 0;
}

.post-category-badge,
.post-home .post-category-badge,
.ts-featured .post-category-badge {
    /* Not uppercased: ".NET", "C#" and "AI" are proper names, and forcing caps
       on them costs legibility for no hierarchy gain. */
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-1);
    padding: .1875rem .5rem;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: .02em;
    line-height: 1.35;
    border-radius: var(--ts-radius-sm);
    background: var(--ts-accent-soft);
    color: var(--ts-accent-text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.post-category-badge a { color: inherit; text-decoration: none; }
.post-category-badge a:hover { text-decoration: underline; }
.post-category-badge .fa { font-size: .85em; opacity: .75; }

.post-home .post-title,
.ts-post-card-title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: var(--ts-weight-bold);
    line-height: 1.32;
    letter-spacing: -.015em;
}

.post-home .post-title a,
.ts-post-card-title a {
    color: var(--ts-text-strong);
    text-decoration: none;
    /* Whole-card hit area; the anchor itself stays the crawlable link. */
    display: block;
}

.post-home .post-title a::after,
.ts-post-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
}

.post-home:hover .post-title a,
.ts-post-card:hover .ts-post-card-title a { color: var(--ts-accent-text); }

.post-home .post-description,
.ts-post-card-excerpt {
    margin: 0;
    font-size: var(--ts-text-sm);
    line-height: 1.6;
    color: var(--ts-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-home .post-meta,
.ts-post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--ts-space-1) var(--ts-space-2);
    margin: auto 0 0;
    padding-top: var(--ts-space-3);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    line-height: 1.4;
}

.post-home .post-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.post-home .post-meta .fa { font-size: .8em; opacity: .7; }
.post-home .post-meta a { color: inherit; text-decoration: none; position: relative; z-index: 1; }
.post-home .post-meta a:hover { color: var(--ts-accent-text); }

.ts-meta-dot { opacity: .4; }

/* The "Read more" button is redundant once the whole card is clickable, and
   it was the main reason cards grew so tall. */
.post-home .post-more { display: none; }

/* ---- Featured card ---- */
.ts-featured {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    overflow: hidden;
    transition: border-color var(--ts-dur) var(--ts-ease), box-shadow var(--ts-dur) var(--ts-ease);
}

.ts-featured:hover { border-color: var(--ts-border-strong); box-shadow: var(--ts-shadow-md); }
.ts-featured:focus-within { border-color: var(--ts-accent); box-shadow: var(--ts-shadow-md); }

.ts-featured-media {
    aspect-ratio: 16 / 9;
    background: var(--ts-bg-inset);
    overflow: hidden;
    border-bottom: 1px solid var(--ts-border);
}

.ts-featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ts-featured-body {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-3);
    align-items: flex-start;
    padding: var(--ts-space-6);
    min-width: 0;
}

.ts-featured-title {
    margin: 0;
    font-size: clamp(1.25rem, 1.05rem + .9vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: -.022em;
}

.ts-featured-title a {
    color: var(--ts-text-strong);
    text-decoration: none;
}

.ts-featured-title a::after { content: ""; position: absolute; inset: 0; }
.ts-featured:hover .ts-featured-title a { color: var(--ts-accent-text); }

.ts-featured-excerpt {
    margin: 0;
    font-size: var(--ts-text-body);
    line-height: 1.65;
    color: var(--ts-text-muted);
    max-width: 60ch;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ts-featured-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ts-space-1) var(--ts-space-2);
}

.ts-featured-cta { position: relative; z-index: 1; margin-top: var(--ts-space-1); }

@media (min-width: 56rem) {
    .ts-featured.has-media { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .ts-featured.has-media .ts-featured-media { aspect-ratio: auto; height: 100%; min-height: 17rem; border-bottom: 0; border-right: 1px solid var(--ts-border); }
    .ts-featured-body { padding: var(--ts-space-8); justify-content: center; }
}

/* ==========================================================================
   10. HOMEPAGE LAYOUT / DISCOVER RAIL
   ========================================================================== */

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-section-gap);
    align-items: start;
}

.home-main { min-width: 0; }

.home-sidebar-left {
    min-width: 0;
    width: auto;
    max-width: none;
    position: static;
}

@media (min-width: 64rem) {
    .home-layout {
        grid-template-columns: minmax(0, 1fr) 18.5rem;
        gap: var(--ts-space-10);
    }

    /* Discovery is secondary to the article stream, so it sits on the right
       on desktop while still coming after it in the DOM on phones. */
    .home-main { grid-column: 1; grid-row: 1; }
    .home-sidebar-left { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--ts-header-h) + var(--ts-space-4)); }
}

.trending-sidebar { display: flex; flex-direction: column; gap: var(--ts-space-6); }

.trending-group {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.trending-group-title {
    margin: 0 0 var(--ts-space-3);
    padding: 0;
    border: 0;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
}

.trending-group-title .fa { color: var(--ts-text-subtle); font-size: .9em; }

.trending-cards { display: flex; flex-direction: column; gap: 2px; }

.trending-card {
    display: flex;
    gap: var(--ts-space-3);
    align-items: center;
    padding: var(--ts-space-2);
    margin-inline: calc(var(--ts-space-2) * -1);
    border-radius: var(--ts-radius-md);
    text-decoration: none;
    background: none;
    border: 0;
    box-shadow: none;
    transition: background-color var(--ts-dur) var(--ts-ease);
    min-height: var(--ts-tap);
}

.trending-card:hover { background: var(--ts-bg-hover); }

.trending-card-img {
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border-radius: var(--ts-radius-md);
    overflow: hidden;
    background: var(--ts-bg-inset);
}

.trending-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.trending-card-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }

.trending-card-title {
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-semi);
    line-height: 1.35;
    color: var(--ts-text-strong);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-card-date {
    font-size: var(--ts-text-label);
    color: var(--ts-text-muted);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.trending-categories { display: flex; flex-wrap: wrap; gap: var(--ts-space-2); }

.trending-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: 2.125rem;
    padding: .3125rem .625rem;
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-pill);
    text-decoration: none;
    box-shadow: none;
}

.trending-cat-chip:hover { border-color: var(--ts-accent); color: var(--ts-text-strong); background: var(--ts-bg-hover); }

.trending-cat-count {
    font-size: var(--ts-text-label);
    font-variant-numeric: tabular-nums;
    color: var(--ts-text-muted);
    background: var(--ts-bg-inset);
    border-radius: var(--ts-radius-pill);
    padding: 0 .375rem;
    min-width: 1.25rem;
    text-align: center;
}

/* ==========================================================================
   11. NEWSLETTER
   ========================================================================== */

.ts-newsletter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-5);
    padding: var(--ts-space-8);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
}

.ts-newsletter-title { margin: 0; font-size: var(--ts-text-h2); }

.ts-newsletter-body {
    margin: var(--ts-space-2) 0 0;
    font-size: var(--ts-text-sm);
    color: var(--ts-text-muted);
    max-width: 48ch;
}

.ts-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-2);
}

.ts-newsletter-row { display: flex; flex-direction: column; gap: var(--ts-space-2); }

.ts-newsletter-note {
    margin: 0;
    font-size: var(--ts-text-label);
    color: var(--ts-text-muted);
}

.ts-newsletter-status { margin: 0; font-size: var(--ts-text-meta); }
.ts-newsletter-status[data-state="error"] { color: var(--ts-danger); }
.ts-newsletter-status[data-state="ok"] { color: var(--ts-success); }

@media (min-width: 40rem) {
    .ts-newsletter-row { flex-direction: row; }
    .ts-newsletter-row .ts-field { flex: 1 1 auto; }
    .ts-newsletter-row .ts-btn { flex: 0 0 auto; }
}

@media (min-width: 56rem) {
    .ts-newsletter { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: center; gap: var(--ts-space-10); }
}

/* ==========================================================================
   12. ARTICLE — LAYOUT
   ========================================================================== */

.post-single {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0 0 var(--ts-space-10);
    max-width: none;
}

.post-breadcrumb { color: var(--ts-text-muted); }
.post-breadcrumb a { color: inherit; }

.post-single .post-header {
    margin: 0 0 var(--ts-space-6);
    padding: 0 0 var(--ts-space-5);
    border-bottom: 1px solid var(--ts-border);
    max-width: var(--ts-measure);
}

.post-single .post-title {
    margin: 0 0 var(--ts-space-4);
    font-size: var(--ts-text-h1);
    line-height: 1.14;
    letter-spacing: -.028em;
    font-weight: var(--ts-weight-black);
}

.post-single .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ts-space-2) var(--ts-space-4);
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    line-height: 1.4;
    margin: 0;
    padding: 0;
    border: 0;
}

.post-single .post-meta > span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.post-single .post-meta .fa { font-size: .85em; opacity: .65; }
.post-single .post-meta a { color: var(--ts-text); text-decoration: none; }
.post-single .post-meta a:hover { color: var(--ts-accent-text); text-decoration: underline; }

.post-single .post-share { margin-left: auto; float: none !important; }

.post-single .post-share .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: 2.25rem;
    padding: 0 var(--ts-space-3);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text);
    background: var(--ts-bg-raised);
    text-decoration: none;
}

.post-single .post-share .dropdown-toggle:hover { border-color: var(--ts-border-strong); color: var(--ts-text-strong); }

.post-single .post-share .dropdown-menu {
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    box-shadow: var(--ts-shadow-lg);
    padding: var(--ts-space-1);
    min-width: 11rem;
}

.post-single .post-share .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: 2.25rem;
    padding: var(--ts-space-1) var(--ts-space-2);
    border-radius: var(--ts-radius-sm);
    font-size: var(--ts-text-meta);
    color: var(--ts-text);
}

.post-single .post-share .dropdown-item:hover { background: var(--ts-bg-hover); color: var(--ts-text-strong); }

.post-single-hero {
    margin: 0 0 var(--ts-space-6);
    border-radius: var(--ts-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ts-border);
    background: var(--ts-bg-inset);
    aspect-ratio: 16 / 9;
}

.post-single-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Two-column reading layout ---- */
.ts-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-6);
    align-items: start;
}

.ts-article-main { min-width: 0; }

@media (min-width: 75rem) {
    .ts-article-grid {
        grid-template-columns: 15rem minmax(0, 1fr);
        gap: var(--ts-space-10);
    }

    .ts-toc-col {
        position: sticky;
        top: calc(var(--ts-header-h) + var(--ts-space-4));
        max-height: calc(100vh - var(--ts-header-h) - var(--ts-space-8));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* ---- Table of contents ---- */
.post-toc {
    margin: 0 0 var(--ts-space-4);
    padding: 0;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-raised);
    font-family: var(--ts-font-sans);
}

.post-toc > summary {
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
    min-height: var(--ts-tap);
    padding: var(--ts-space-2) var(--ts-space-4);
    cursor: pointer;
    list-style: none;
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
}

.post-toc > summary::-webkit-details-marker { display: none; }

.post-toc > summary .ts-caret {
    margin-left: auto;
    transition: transform var(--ts-dur) var(--ts-ease);
    font-size: .9em;
}

.post-toc[open] > summary .ts-caret { transform: rotate(180deg); }

.post-toc-title {
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    margin: 0 !important;
    font-family: inherit;
}

.post-toc-list {
    list-style: none;
    margin: 0;
    padding: 0 var(--ts-space-2) var(--ts-space-3);
    font-size: var(--ts-text-meta);
    counter-reset: ts-toc;
}

.post-toc-list li { margin: 0; }

.post-toc-list a {
    display: block;
    padding: var(--ts-space-2);
    border-left: 2px solid transparent;
    border-radius: 0 var(--ts-radius-sm) var(--ts-radius-sm) 0;
    color: var(--ts-text-muted);
    text-decoration: none;
    line-height: 1.4;
    transition: color var(--ts-dur) var(--ts-ease), border-color var(--ts-dur) var(--ts-ease),
                background-color var(--ts-dur) var(--ts-ease);
}

.post-toc-list a:hover { color: var(--ts-text-strong); background: var(--ts-bg-hover); text-decoration: none; }

.post-toc-list a.is-current {
    color: var(--ts-accent-text);
    border-left-color: var(--ts-accent);
    font-weight: var(--ts-weight-semi);
}

@media (min-width: 75rem) {
    .post-toc { border: 0; background: none; border-radius: 0; margin-bottom: 0; }
    .post-toc > summary { display: none; }
    .post-toc-list { padding: 0; border-left: 1px solid var(--ts-border); }
    .post-toc-list a { padding-left: var(--ts-space-3); margin-left: -1px; }
}

/* ==========================================================================
   13. ARTICLE — PROSE
   ========================================================================== */

.post-single .post-body {
    max-width: var(--ts-measure);
    font-size: var(--ts-text-body-lg);
    line-height: var(--ts-leading-loose);
    color: var(--ts-text);
}

/* Decorative gradient rules under the hero and the article body. */
.post-single .post-body::after,
.post-single-hero::after { content: none; display: none; }

.post-single .post-body > * { margin-top: 0; }

.post-single .post-body p,
.post-single .post-body ul,
.post-single .post-body ol,
.post-single .post-body dl {
    margin: 0 0 var(--ts-space-6);
}

.post-single .post-body h2 {
    margin: var(--ts-space-12) 0 var(--ts-space-4);
    font-size: var(--ts-text-h2);
    line-height: 1.22;
    letter-spacing: -.022em;
    scroll-margin-top: calc(var(--ts-header-h) + var(--ts-space-4));
    padding-top: var(--ts-space-1);
}

.post-single .post-body h3 {
    margin: var(--ts-space-8) 0 var(--ts-space-3);
    font-size: var(--ts-text-h3);
    line-height: 1.3;
    scroll-margin-top: calc(var(--ts-header-h) + var(--ts-space-4));
}

.post-single .post-body h4 {
    margin: var(--ts-space-6) 0 var(--ts-space-2);
    font-size: var(--ts-text-h4);
    font-weight: var(--ts-weight-semi);
    scroll-margin-top: calc(var(--ts-header-h) + var(--ts-space-4));
}

.post-single .post-body > *:first-child { margin-top: 0; }

/* Anchor affordance on hover, without shifting the heading. */
.post-single .post-body :is(h2, h3) { position: relative; }

.post-single .post-body :is(h2, h3) > .ts-anchor {
    position: absolute;
    left: -1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    font-size: .75em;
    color: var(--ts-text-subtle);
    text-decoration: none;
    opacity: 0;
    transition: opacity var(--ts-dur) var(--ts-ease);
    line-height: 1;
}

.post-single .post-body :is(h2, h3):hover > .ts-anchor,
.post-single .post-body .ts-anchor:focus-visible { opacity: 1; }

@media (max-width: 79.99rem) {
    .post-single .post-body :is(h2, h3) > .ts-anchor { display: none; }
}

.post-single .post-body a {
    color: var(--ts-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
}

.post-single .post-body a:hover { color: var(--ts-accent-hover); }

.post-single .post-body li { margin-bottom: var(--ts-space-2); }
.post-single .post-body li > ul,
.post-single .post-body li > ol { margin-top: var(--ts-space-2); margin-bottom: 0; }

.post-single .post-body blockquote {
    margin: var(--ts-space-8) 0;
    padding: var(--ts-space-1) 0 var(--ts-space-1) var(--ts-space-5);
    border-left: 3px solid var(--ts-accent);
    background: none;
    color: var(--ts-text-muted);
    font-style: normal;
    font-size: var(--ts-text-body);
}

.post-single .post-body blockquote p:last-child { margin-bottom: 0; }

.post-single .post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ts-radius-md);
    border: 1px solid var(--ts-border);
    display: block;
    margin: var(--ts-space-8) auto;
}

.post-single .post-body figure { margin: var(--ts-space-8) 0; }
.post-single .post-body figure img { margin: 0; }

.post-single .post-body figcaption,
.post-single .post-body img + em {
    display: block;
    margin-top: var(--ts-space-2);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    text-align: center;
    font-style: normal;
}

.post-single .post-body hr {
    margin: var(--ts-space-12) 0;
    border: 0;
    border-top: 1px solid var(--ts-border);
}

/* ---- Tables: readable, and scrollable instead of overflowing ---- */
.post-single .post-body .ts-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--ts-space-8) 0;
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
}

.post-single .post-body table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: var(--ts-text-sm);
    background: var(--ts-bg-raised);
}

.post-single .post-body :not(.ts-table-wrap) > table { margin: var(--ts-space-8) 0; }

.post-single .post-body th,
.post-single .post-body td {
    padding: var(--ts-space-3) var(--ts-space-4);
    border-bottom: 1px solid var(--ts-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
}

.post-single .post-body th {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-semi);
    color: var(--ts-text-strong);
    background: var(--ts-bg-inset);
    white-space: nowrap;
}

.post-single .post-body tbody tr:last-child td { border-bottom: 0; }

/* ---- Inline code ---- */
.post-single .post-body :not(pre) > code {
    font-family: var(--ts-font-mono);
    font-size: .875em;
    padding: .125em .375em;
    border-radius: var(--ts-radius-xs);
    background: var(--ts-code-inline-bg);
    color: var(--ts-code-inline-text);
    word-break: break-word;
    border: 0;
}

/* ---- Code blocks ---- */
.content-stlye pre,
.post-single .post-body pre {
    font-family: var(--ts-font-mono);
    font-size: var(--ts-text-code);
    line-height: 1.65;
    background: var(--ts-code-bg);
    color: var(--ts-code-text);
    border: 1px solid var(--ts-code-border);
    border-radius: var(--ts-radius-md);
    padding: var(--ts-space-4);
    margin: var(--ts-space-6) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    tab-size: 4;
}

.content-stlye .syntaxhighlighter {
    border-radius: var(--ts-radius-md) !important;
    border: 1px solid var(--ts-code-border) !important;
    margin: var(--ts-space-6) 0 !important;
    font-size: var(--ts-text-code) !important;
    box-shadow: none !important;
}

.code-lang-label {
    font-family: var(--ts-font-mono);
    font-size: .6875rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ts-text-subtle);
    background: var(--ts-bg-inset);
    border: 1px solid var(--ts-border);
    border-bottom: 0;
    border-radius: var(--ts-radius-md) var(--ts-radius-md) 0 0;
    padding: .25rem .625rem;
}

.code-copy-btn {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-medium);
    min-height: 1.875rem;
    padding: .25rem .5rem;
    border-radius: var(--ts-radius-sm);
}

/* ---- Reading progress ---- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--ts-accent);
    z-index: calc(var(--ts-z-header) + 1);
    width: 0;
    transition: width 60ms linear;
}

/* ---- Post footer / tags ---- */
.post-footer {
    max-width: var(--ts-measure);
    margin-top: var(--ts-space-10);
    padding-top: var(--ts-space-5);
    border-top: 1px solid var(--ts-border);
}

.post-tags { display: flex; flex-wrap: wrap; gap: var(--ts-space-2); align-items: center; }

.post-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: .25rem .625rem;
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    background: var(--ts-bg-inset);
    border: 1px solid transparent;
    border-radius: var(--ts-radius-pill);
    text-decoration: none;
}

.post-tags a:hover { color: var(--ts-text-strong); border-color: var(--ts-border-strong); }

/* ---- Related posts ---- */
#relatedPosts.well-global {
    background: none;
    border: 0;
    border-top: 1px solid var(--ts-border);
    border-radius: 0;
    box-shadow: none;
    padding: var(--ts-space-8) 0 0;
    margin: var(--ts-space-10) 0 0;
}

#relatedPosts .well-global-title {
    margin: 0 0 var(--ts-space-5);
    font-size: var(--ts-text-h3);
}

.related-posts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-4);
}

@media (min-width: 48rem) {
    .related-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.related-posts-item {
    padding: var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-raised);
    transition: border-color var(--ts-dur) var(--ts-ease), box-shadow var(--ts-dur) var(--ts-ease);
    margin: 0;
}

.related-posts-item:hover { border-color: var(--ts-border-strong); box-shadow: var(--ts-shadow-sm); }

.related-posts-item > a {
    display: block;
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    line-height: 1.4;
    color: var(--ts-text-strong);
    text-decoration: none;
}

.related-posts-item > a:hover { color: var(--ts-accent-text); }

.related-posts-item p {
    margin: var(--ts-space-2) 0 0;
    font-size: var(--ts-text-meta);
    line-height: 1.55;
    color: var(--ts-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Previous / next ---- */
.navigation-posts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-3);
    margin: var(--ts-space-10) 0 0;
    padding: 0;
    border: 0;
}

@media (min-width: 40rem) {
    .navigation-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.navigation-posts .prev-post,
.navigation-posts .next-post { min-width: 0; text-align: left !important; }

.navigation-posts a {
    display: block;
    height: 100%;
    padding: var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-raised);
    text-decoration: none;
    transition: border-color var(--ts-dur) var(--ts-ease), box-shadow var(--ts-dur) var(--ts-ease);
}

.navigation-posts a:hover { border-color: var(--ts-border-strong); box-shadow: var(--ts-shadow-sm); }

.navigation-posts .nav-label {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
    margin-bottom: var(--ts-space-1);
}

.navigation-posts .nav-title {
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    color: var(--ts-text-strong);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 40rem) {
    .navigation-posts .next-post { text-align: right !important; }
}

/* ==========================================================================
   14. PAGE HEADERS (archive, search, category, tag, author, static pages)
   ========================================================================== */

.page-global {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.ts-page-head,
.list-header {
    margin: 0 0 var(--ts-space-6);
    padding: 0 0 var(--ts-space-5);
    border-bottom: 1px solid var(--ts-border);
}

.page-global-title,
.list-header .list-title {
    margin: 0;
    font-size: var(--ts-text-h1);
    line-height: 1.15;
    letter-spacing: -.026em;
    font-weight: var(--ts-weight-black);
}

.ts-page-lede,
.list-header .list-intro {
    margin: var(--ts-space-3) 0 0;
    font-size: var(--ts-text-sm);
    line-height: 1.6;
    color: var(--ts-text-muted);
    max-width: 62ch;
    opacity: 1;
}

/* ==========================================================================
   15. TOOLBAR (search + sort + view)
   ========================================================================== */

.ts-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-3);
    margin-bottom: var(--ts-space-4);
}

.ts-toolbar-search { flex: 1 1 auto; min-width: 0; }

.ts-toolbar-controls {
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
    flex-wrap: wrap;
}

.ts-toolbar-controls .ts-select { flex: 1 1 auto; min-width: 0; }

@media (min-width: 48rem) {
    .ts-toolbar { flex-direction: row; align-items: center; }
    .ts-toolbar-controls { flex: 0 0 auto; }
    .ts-toolbar-controls .ts-select { flex: 0 0 auto; }
}

.ts-view-toggle {
    display: none;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--ts-bg-inset);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
}

@media (min-width: 48rem) { .ts-view-toggle { display: inline-flex; } }

.ts-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border: 0;
    background: transparent;
    color: var(--ts-text-muted);
    border-radius: var(--ts-radius-sm);
    cursor: pointer;
}

.ts-view-btn:hover { color: var(--ts-text-strong); }

.ts-view-btn[aria-pressed="true"] {
    background: var(--ts-bg-raised);
    color: var(--ts-text-strong);
    box-shadow: var(--ts-shadow-xs);
}

.ts-filter-bar { margin-bottom: var(--ts-space-4); }

.ts-result-count {
    margin: 0 0 var(--ts-space-5);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   16. ARCHIVE
   ========================================================================== */

.archive-page { max-width: none; }

.archive-page-menu { display: none; }

.ts-archive-group { margin: 0 0 var(--ts-space-10); }
.ts-archive-group[hidden] { display: none; }

.ts-archive-group-head {
    display: flex;
    align-items: center;
    gap: var(--ts-space-3);
    margin: 0 0 var(--ts-space-4);
    padding-bottom: var(--ts-space-2);
    border-bottom: 1px solid var(--ts-border);
}

.ts-archive-group-title {
    margin: 0;
    font-size: var(--ts-text-h3);
    line-height: 1.25;
}

.ts-archive-group-title a { color: inherit; text-decoration: none; }
.ts-archive-group-title a:hover { color: var(--ts-accent-text); }

.ts-archive-group-count {
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    font-variant-numeric: tabular-nums;
}

.ts-archive-feed {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--ts-radius-sm);
    color: var(--ts-text-subtle);
    text-decoration: none;
}

.ts-archive-feed:hover { color: #f97316; background: var(--ts-bg-hover); }

.ts-archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ts-space-3);
}

@media (min-width: 56rem) {
    .ts-archive-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ts-archive-item { margin: 0; min-width: 0; }
.ts-archive-item[hidden] { display: none; }

.ts-archive-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-2);
    height: 100%;
    padding: var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-raised);
    transition: border-color var(--ts-dur) var(--ts-ease), box-shadow var(--ts-dur) var(--ts-ease);
}

.ts-archive-card:hover { border-color: var(--ts-border-strong); box-shadow: var(--ts-shadow-sm); }
.ts-archive-card:focus-within { border-color: var(--ts-accent); }

.ts-archive-title {
    margin: 0;
    font-size: var(--ts-text-sm);
    font-weight: var(--ts-weight-semi);
    line-height: 1.42;
}

.ts-archive-title a { color: var(--ts-text-strong); text-decoration: none; }
.ts-archive-title a::after { content: ""; position: absolute; inset: 0; }
.ts-archive-card:hover .ts-archive-title a { color: var(--ts-accent-text); }

.ts-archive-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ts-space-1) var(--ts-space-2);
    margin-top: auto;
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Compact (table-like) view keeps the old scannability for power users. */
.ts-archive.is-compact .ts-archive-list { grid-template-columns: minmax(0, 1fr); gap: 0; }

.ts-archive.is-compact .ts-archive-card {
    flex-direction: row;
    align-items: baseline;
    gap: var(--ts-space-4);
    padding: var(--ts-space-2) var(--ts-space-2);
    border: 0;
    border-bottom: 1px solid var(--ts-border);
    border-radius: 0;
    background: none;
    min-height: var(--ts-tap);
}

.ts-archive.is-compact .ts-archive-card:hover { background: var(--ts-bg-hover); box-shadow: none; }
.ts-archive.is-compact .ts-archive-title { flex: 1 1 auto; }
.ts-archive.is-compact .ts-archive-meta { margin-top: 0; flex: 0 0 auto; }

.archive-page-total {
    margin-top: var(--ts-space-10);
    padding-top: var(--ts-space-5);
    border-top: 1px solid var(--ts-border);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
}

.archive-page-total h3 {
    font-size: var(--ts-text-label);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
    font-family: var(--ts-font-sans);
    margin: 0 0 var(--ts-space-2);
}

/* ==========================================================================
   17. SEARCH RESULTS PAGE
   ========================================================================== */

.search-page-searchbox {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-3);
    margin: 0 0 var(--ts-space-6);
}

.search-page-searchbox .ts-field { flex: 1 1 auto; min-width: 0; }

.search-page-searchbox input[type="text"] {
    width: 100%;
    min-height: var(--ts-tap);
    padding: .5625rem var(--ts-space-3) .5625rem 2.375rem;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-body);
    color: var(--ts-text);
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border-strong);
    border-radius: var(--ts-radius-md);
}

.search-page-searchbox input[type="text"]:focus {
    border-color: var(--ts-accent);
    box-shadow: 0 0 0 3px var(--ts-accent-soft);
    outline: none;
}

.ts-search-options {
    display: flex;
    align-items: center;
    gap: var(--ts-space-2);
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    min-height: var(--ts-tap);
}

.ts-search-options input[type="checkbox"] { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; }

/* The label extends the checkbox's hit area to a full-height target. */
.ts-search-options label {
    display: inline-flex;
    align-items: center;
    min-height: var(--ts-tap);
    margin: 0;
    cursor: pointer;
}

@media (min-width: 40rem) {
    .search-page-searchbox { flex-direction: row; align-items: center; }
    .search-page-searchbox .ts-btn { flex: 0 0 auto; }
}

.ts-search-results { display: flex; flex-direction: column; gap: var(--ts-space-3); }

.searchresult {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-2);
    padding: var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-bg-raised);
    transition: border-color var(--ts-dur) var(--ts-ease), box-shadow var(--ts-dur) var(--ts-ease);
}

.searchresult:hover { border-color: var(--ts-border-strong); box-shadow: var(--ts-shadow-sm); }

.searchresult > a {
    font-size: var(--ts-text-body);
    font-weight: var(--ts-weight-semi);
    line-height: 1.4;
    color: var(--ts-text-strong);
    text-decoration: none;
}

.searchresult > a::after { content: ""; position: absolute; inset: 0; }
.searchresult:hover > a { color: var(--ts-accent-text); }

.searchresult .text {
    font-size: var(--ts-text-sm);
    line-height: 1.6;
    color: var(--ts-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.searchresult .type,
.searchresult .url {
    font-size: var(--ts-text-label);
    color: var(--ts-text-muted);
    word-break: break-all;
}

.searchresult .type:empty { display: none; }

/* ==========================================================================
   18. COMMENTS, WIDGETS, PAGINATION, MISC
   ========================================================================== */

.well-global {
    background: var(--ts-bg-raised);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-lg);
    box-shadow: none;
    padding: var(--ts-space-6);
    margin-top: var(--ts-space-8);
}

.well-global-title {
    margin: 0 0 var(--ts-space-4);
    font-size: var(--ts-text-h3);
}

.blog-sidebar .widget,
.widget {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
}

#postPaging a,
.pager a {
    display: inline-flex;
    align-items: center;
    min-height: var(--ts-tap);
    padding: .5rem var(--ts-space-4);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    background: var(--ts-bg-raised);
    color: var(--ts-text);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    text-decoration: none;
}

#postPaging a:hover { border-color: var(--ts-accent); color: var(--ts-text-strong); }

/* Scroll-reveal is gone (see custom.js); neutralise the legacy rules so a
   cached copy of the old stylesheet cannot leave content at opacity 0. */
.reveal,
.reveal-scale { opacity: 1 !important; transform: none !important; }

/* The ripple was purely decorative and fought the focus ring. */
.btn .ripple { display: none !important; }

/* ---- Command palette refinements ---- */
.cmd-palette {
    border-radius: var(--ts-radius-lg);
    border: 1px solid var(--ts-border);
    background: var(--ts-bg-raised);
    box-shadow: var(--ts-shadow-lg);
}

.cmd-palette-input {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-body);
    color: var(--ts-text);
    background: transparent;
}

.cmd-palette-input::placeholder { color: var(--ts-text-subtle); }

.cmd-palette-item { min-height: var(--ts-tap); }

.cmd-palette-item.active,
.cmd-palette-item:hover { background: var(--ts-bg-hover); }

.cmd-palette-section-title {
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
}

/* ---- Global guards against horizontal overflow ---- */
img, svg, video, iframe, table { max-width: 100%; }

.post-single .post-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--ts-radius-md);
    margin: var(--ts-space-8) 0;
}

.post-single .post-body :is(p, li, h1, h2, h3, h4) { overflow-wrap: break-word; }

/* ---- Result paging ---- */
ul.paging {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ts-space-1);
    list-style: none;
    margin: var(--ts-space-8) 0 0;
    padding: 0;
}

ul.paging li a,
ul.paging li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--ts-tap);
    min-height: var(--ts-tap);
    padding: 0 var(--ts-space-2);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    background: var(--ts-bg-raised);
    color: var(--ts-text);
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-medium);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

ul.paging li a:hover { border-color: var(--ts-accent); color: var(--ts-text-strong); }

ul.paging li span {
    background: var(--ts-brand-600);
    border-color: var(--ts-brand-600);
    color: #fff;
}

/* ---- Comment form / lists ---- */
.comment-form .form-control,
#comment .form-control { margin-bottom: var(--ts-space-3); }

.comment-form label,
#comment label {
    font-size: var(--ts-text-meta);
    font-weight: var(--ts-weight-semi);
    color: var(--ts-text);
}

/* ---- Static theme pages (About / Privacy / Terms / Disclaimer) ---- */
.page-global .content-stlye,
main.content-stlye > .page-global {
    max-width: var(--ts-measure);
}

main.content-stlye h2 {
    margin: var(--ts-space-10) 0 var(--ts-space-3);
    font-size: var(--ts-text-h2);
}

main.content-stlye h3 {
    margin: var(--ts-space-6) 0 var(--ts-space-2);
    font-size: var(--ts-text-h3);
}

main.content-stlye p,
main.content-stlye ul,
main.content-stlye ol { margin-bottom: var(--ts-space-5); }

/* ---- Contact / form pages ---- */
.contact-page .form-group { margin-bottom: var(--ts-space-4); }

/* ==========================================================================
   19. LEGIBILITY AND TARGET-SIZE CORRECTIONS
   --------------------------------------------------------------------------
   The legacy sheet dropped several UI strings to 9.6-10.8px and left some
   controls under the minimum target size. These are the corrections; they live
   together so the next person can see the rule being applied rather than
   hunting for scattered overrides.
   ========================================================================== */

.cmd-palette-section-title { font-size: var(--ts-text-label); }
.cmd-palette-section-title i { font-size: .75em; }
.cmd-palette-item-desc { font-size: var(--ts-text-meta); }
.cmd-palette-item-meta { font-size: var(--ts-text-label); }
.cmd-palette-chip { font-size: var(--ts-text-meta); min-height: 2rem; }
.cmd-palette-chip i { font-size: .8em; }
.cmd-palette-chip-count { font-size: var(--ts-text-label); }
.cmd-palette-footer,
.cmd-palette-footer kbd { font-size: var(--ts-text-label); }
.cmd-palette-empty-hint { font-size: var(--ts-text-meta); }

.content-stlye .syntaxhighlighter .toolbar a { font-size: var(--ts-text-label) !important; }

.trending-cat-chip,
.trending-card-date { font-size: var(--ts-text-meta); }

/* Metadata links sit in a row of short standalone links; 24px of height plus
   the row gap keeps them above the WCAG 2.2 minimum target size. */
.post-single .post-meta a,
.ts-footer-bottom a,
.post-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding-block: .125rem;
}

/* The real listing pager is #PostPager (the #postPaging div in PostList.ascx
   is inert, kept hidden by its own inline style). */
#PostPager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ts-space-1);
    margin: var(--ts-space-10) 0 0;
    text-transform: none;
    font-size: var(--ts-text-meta);
}

#PostPager li { margin: 0 !important; }

#PostPager li a,
#PostPager .PagerLinkCurrent,
#PostPager .PagerLinkDisabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--ts-tap);
    min-height: var(--ts-tap);
    padding: 0 var(--ts-space-3);
    border: 1px solid var(--ts-border);
    border-radius: var(--ts-radius-md);
    background: var(--ts-bg-raised);
    color: var(--ts-text);
    font-weight: var(--ts-weight-medium);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

#PostPager li a:hover {
    background: var(--ts-bg-hover);
    border-color: var(--ts-accent);
    color: var(--ts-text-strong);
}

#PostPager .PagerLinkCurrent {
    background: var(--ts-brand-600);
    border-color: var(--ts-brand-600);
    color: #fff;
}

#PostPager .PagerLinkDisabled { color: var(--ts-text-muted); }
#PostPager .PagerEllipses { display: inline-flex; align-items: center; padding: 0 var(--ts-space-1); color: var(--ts-text-muted); }

/* ==========================================================================
   20. LEGACY DECORATION REMOVED
   --------------------------------------------------------------------------
   Rules the old sheet applies that the new hierarchy does not want: heading
   rails, decorative quote glyphs, shouty uppercase on titles, and list styling
   that was previously cancelled by page-level <style> blocks.
   ========================================================================== */

.post-breadcrumb { margin: 0 0 var(--ts-space-4); font-size: var(--ts-text-meta); line-height: 1.4; }

.post-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.post-breadcrumb li { display: flex; align-items: center; min-width: 0; }
.post-breadcrumb li + li::before { content: "/"; margin: 0 var(--ts-space-2); opacity: .45; }
.post-breadcrumb a { text-decoration: none; color: var(--ts-text-muted); }
.post-breadcrumb a:hover { color: var(--ts-text-strong); text-decoration: underline; }

.post-breadcrumb .current {
    color: var(--ts-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 22rem;
}

@media (max-width: 36rem) {
    .post-breadcrumb .current { max-width: 11rem; }
}

/* Headings carry hierarchy through size and space, not a coloured rail. */
.post-single .post-body :is(h2, h3, h4),
.content-stlye :is(h2, h3, h4) {
    border-left: 0;
    padding-left: 0;
    background: none;
}

.post-single .post-body blockquote::before,
.content-stlye blockquote::before { content: none; }

.post-single .post-footer .post-tags a {
    background: var(--ts-bg-inset);
    color: var(--ts-text-muted);
    border: 1px solid transparent;
    text-transform: none;
}

.post-single .post-footer .post-tags a:hover {
    color: var(--ts-text-strong);
    border-color: var(--ts-border-strong);
    background: var(--ts-bg-hover);
}

.navigation-posts .nav-title,
.well-global-title,
#relatedPosts .well-global-title,
.related-posts-item > a { text-transform: none; }

.related-posts .related-posts-item {
    display: flex;
    flex-direction: column;
    list-style: none;
}

/* ---- Archive list: the legacy sheet floated list items at 33% width ---- */
.ts-archive-list .ts-archive-item {
    display: block;
    float: none;
    width: auto;
    list-style: none;
}

.ts-archive-list::after { content: none; }

.archive-page .ts-archive-group-title,
.ts-archive .ts-archive-group-title {
    font-size: var(--ts-text-h3);
    height: auto;
    line-height: var(--ts-leading-snug);
    margin: 0;
}

/* The decorative gradient rule above the footer. */
.blog-footer::before { content: none; }

/* The search result "type / categories / tags" block is emitted by the page's
   code-behind with <strong> labels and <br> breaks. Keep the information, tone
   it down so the title stays the loudest thing in the card. */
.searchresult .type {
    font-size: var(--ts-text-meta);
    line-height: 1.5;
    color: var(--ts-text-muted);
}

.searchresult .type strong {
    font-weight: var(--ts-weight-medium);
    color: var(--ts-text-muted);
}

/* ==========================================================================
   21. ERROR PAGE
   ========================================================================== */

.ts-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ts-space-3);
    margin-bottom: var(--ts-space-8);
}

.ts-error-block {
    padding-top: var(--ts-space-6);
    margin-top: var(--ts-space-6);
    border-top: 1px solid var(--ts-border);
    max-width: var(--ts-measure);
}

.ts-error-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.ts-error-block-title {
    margin: 0 0 var(--ts-space-3);
    font-size: var(--ts-text-h3);
}

.ts-error-links { list-style: none; margin: 0; padding: 0; }

.ts-error-links li { margin: 0; }

.ts-error-links a {
    display: block;
    min-height: var(--ts-tap);
    padding: var(--ts-space-2) 0;
    font-weight: var(--ts-weight-medium);
}

.error404 .searchresults a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
}

/* The suggestion list is filled by the code-behind and can come back empty;
   don't leave a heading standing over nothing. */
.ts-error-links:empty { display: none; }
.ts-error-block:has(.ts-error-links:empty) .ts-error-block-title { display: none; }

/* ==========================================================================
   22. WIDE-SCREEN ARTICLE ALIGNMENT
   --------------------------------------------------------------------------
   Once the contents list moves into its own left column, the title, breadcrumb
   and hero would keep the page's left edge while the prose starts one column
   in, so nothing lines up. Indent them by exactly the column width instead:
   one left edge for everything the reader reads, with the sticky contents list
   in the gutter beside it.
   ========================================================================== */

@media (min-width: 75rem) {
    .post-breadcrumb.has-toc,
    .post-single.has-toc .post-header,
    .post-single.has-toc .post-single-hero {
        margin-left: calc(15rem + var(--ts-space-10));
    }

    .post-single.has-toc .post-single-hero { max-width: var(--ts-measure); }
}

/* ==========================================================================
   23. RAZOR-ONLY COMPONENTS
   --------------------------------------------------------------------------
   Logout is a POST with an antiforgery token, so it is a <button> inside a
   form rather than a link. It has to read as a drawer row regardless.
   ========================================================================== */

.ts-drawer-logout { margin: 0; }

button.ts-drawer-link {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* The search placeholder in the palette trigger can overflow a narrow header. */
.ts-search-trigger .ts-search-text { min-width: 0; }

/* ---- Homepage sidebar widgets (Razor) ---- */
.ts-grid-full { grid-column: 1 / -1; }

.home-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-6);
}

.home-sidebar .sidebar-widget { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }

.home-sidebar .sidebar-widget-title {
    margin: 0 0 var(--ts-space-3);
    padding: 0;
    border: 0;
    font-family: var(--ts-font-sans);
    font-size: var(--ts-text-label);
    font-weight: var(--ts-weight-semi);
    letter-spacing: var(--ts-tracking-label);
    text-transform: uppercase;
    color: var(--ts-text-muted);
    display: flex;
    align-items: center;
}

.home-sidebar .sidebar-widget ul { list-style: none; margin: 0; padding: 0; }
.home-sidebar .sidebar-widget ul li { border-bottom: 1px solid var(--ts-border); font-size: var(--ts-text-meta); padding: 0; }
.home-sidebar .sidebar-widget ul li:last-child { border-bottom: 0; }

.home-sidebar .sidebar-widget ul li a {
    display: block;
    padding: var(--ts-space-2) 0;
    min-height: var(--ts-tap);
    color: var(--ts-text);
    text-decoration: none;
    line-height: 1.45;
}

.home-sidebar .sidebar-widget ul li a:hover { color: var(--ts-accent-text); }

.home-sidebar .tag-cloud { display: flex; flex-wrap: wrap; gap: var(--ts-space-2); }

.home-sidebar .tag-cloud a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: .25rem .625rem;
    font-size: var(--ts-text-meta);
    color: var(--ts-text-muted);
    background: var(--ts-bg-inset);
    border: 1px solid transparent;
    border-radius: var(--ts-radius-pill);
    text-decoration: none;
}

.home-sidebar .tag-cloud a:hover { color: var(--ts-text-strong); border-color: var(--ts-border-strong); }

/* The Razor pager uses .paging with an .active list item. */
ul.paging li.active a {
    background: var(--ts-brand-600);
    border-color: var(--ts-brand-600);
    color: #fff;
}

/* ==========================================================================
   24. RAZOR POST PAGE
   --------------------------------------------------------------------------
   Post.cshtml already ships a full reading experience of its own: a sticky
   sidebar with reading progress, font-size controls, in-page search, a built
   TOC and a mobile TOC drawer. That is not rebuilt here. What this layer adds
   is the prose typography — heading rhythm, measure, inline code, blockquotes,
   anchors — while leaving that page's own layout, tables and code blocks alone.
   ========================================================================== */

/* The page sets its own column width (.post-main, 900px); don't fight it. */
.post-single.post-main .post-body { max-width: none; }

/* The content wrapper was renamed from the legacy ".content-stlye" typo to
   ".content-style" during the migration; both spellings are in the tree. */
.content-style pre,
.post-single .post-body pre {
    font-family: var(--ts-font-mono);
    font-size: var(--ts-text-code);
}

.content-style .syntaxhighlighter {
    border-radius: var(--ts-radius-md) !important;
    box-shadow: none !important;
}

.content-style :not(pre) > code {
    font-family: var(--ts-font-mono);
    font-size: .875em;
    border-radius: var(--ts-radius-xs);
    word-break: break-word;
}

main.content-style :is(h2, h3, h4),
.content-style :is(h2, h3, h4) {
    border-left: 0;
    padding-left: 0;
    background: none;
}

.content-style blockquote::before { content: none; }
