﻿/* ==========================================================
   FILE 1: content-prose.css
   Typematter rendering layer (.tm-*)
   Extracted from original content.css
========================================================== */


/* ===========================================
   Core design token consumers
=========================================== */

.tm-section {
    width: 100%;
    position: relative;
}

.tm-pad-sm {
    padding: var(--tm-pad-sm) 0;
}

.tm-pad-md {
    padding: var(--tm-pad-md) 0;
}

.tm-pad-lg {
    padding: var(--tm-pad-lg) 0;
}

.tm-pad-xl {
    padding: var(--tm-pad-xl) 0;
}

.tm-tone-light {
    background: var(--tm-bg-light);
    color: var(--tm-text-light);
}

.tm-tone-muted {
    background: var(--tm-bg-muted);
    color: var(--tm-text-light);
}

.tm-tone-dark {
    background: var(--tm-bg-dark);
    color: var(--tm-text-dark);
}

/* ===========================================
   Card
=========================================== */

.tm-card {
    background: var(--tm-bg-light);
    border-radius: var(--tm-radius-md);
    padding: 20px;
    box-shadow: var(--tm-shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    will-change: transform, box-shadow;
}

    .tm-card:hover {
        transform: translateY(-8px) scale(1.01);
        box-shadow: 0 18px 40px rgba(0,0,0,0.14);
    }

.tm-tone-dark .tm-card {
    background: rgba(255,255,255,0.06);
    box-shadow: none;
}

    .tm-tone-dark .tm-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 28px rgba(0,0,0,0.24);
    }

/* ===========================================
   Panel
=========================================== */

.tm-panel {
    border-radius: var(--tm-radius-md);
}

.tm-panel-pad-sm {
    padding: 16px;
}

.tm-panel-pad-md {
    padding: 24px;
}

.tm-panel-pad-lg {
    padding: 36px;
}

.tm-panel-muted {
    background: var(--tm-bg-muted);
}

.tm-panel-dark {
    background: #0f172a;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

    .tm-panel-dark .tm-text,
    .tm-panel-dark .tm-text p,
    .tm-panel-dark .tm-text li,
    .tm-panel-dark .tm-text ul,
    .tm-panel-dark .tm-text ol {
        color: inherit;
    }

        .tm-panel-dark .tm-text h1,
        .tm-panel-dark .tm-text h2,
        .tm-panel-dark .tm-text h3,
        .tm-panel-dark .tm-text h4,
        .tm-panel-dark .tm-text h5,
        .tm-panel-dark .tm-text h6 {
            color: #f9fafb;
        }

        .tm-panel-dark .tm-text a {
            color: #93c5fd;
        }

            .tm-panel-dark .tm-text a:hover {
                color: #bfdbfe;
            }

.tm-tone-dark .tm-panel-dark {
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 14px 28px rgba(0,0,0,0.24);
}

.tm-panel-elevated {
    background: var(--tm-bg-light);
    box-shadow: var(--tm-shadow-md);
}

/* ===========================================
   Badges (Markdown UL)
=========================================== */

.tm-badges ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tm-badges li {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--tm-badge-bg);
}

.tm-tone-dark .tm-badges li {
    background: var(--tm-badge-bg-dark);
}

/* ===========================================
   CTA Buttons
=========================================== */

.tm-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    border-radius: var(--tm-radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}

.tm-btn-primary {
    background: var(--tm-primary);
    color: #ffffff;
}

    .tm-btn-primary:hover {
        background: var(--tm-primary-hover);
    }

.tm-btn-outline {
    border: 1px solid currentColor;
    background: transparent;
}

/* ===========================================
   Code (base)
=========================================== */

.tm-code pre {
    margin: 0;
    padding: 18px;
    border-radius: var(--tm-radius-md);
    overflow-x: auto;
    background: var(--tm-code-bg);
    color: var(--tm-code-text);
}

.tm-code code {
    font-family: Consolas, Monaco, monospace;
}

/* ===========================================
   CODE WINDOW (panel variant="code")
=========================================== */

.tm-panel-code {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1rem;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

    .tm-panel-code .tm-code-label {
        font-size: .7rem;
        text-transform: uppercase;
        letter-spacing: .14em;
        color: #9ca3af;
        margin-bottom: .5rem;
    }

    .tm-panel-code .tm-code-file {
        position: relative;
        font-size: .8rem;
        color: #cbd5e1;
        margin-bottom: .75rem;
        padding-left: 3.25rem;
    }

        .tm-panel-code .tm-code-file::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0.1rem;
            width: .5rem;
            height: .5rem;
            border-radius: 999px;
            background: #f97373;
            box-shadow: .75rem 0 0 #fbbf24, 1.5rem 0 0 #34d399;
        }

    .tm-panel-code .tm-code pre {
        padding: 1rem;
        border-radius: .75rem;
        background: #020617;
        border: 1px solid rgba(75, 85, 99, 0.9);
        color: #f9fafb;
    }

    .tm-panel-code .tm-code code {
        font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    }

/* ===========================================
   HERO (section variant="hero")
=========================================== */

.tm-section-hero {
    position: relative;
    color: var(--tm-hero-text, #f9fafb);
    overflow: hidden;
}

    .tm-section-hero .tm-text-kicker {
        text-transform: uppercase;
        letter-spacing: .16em;
        font-size: .75rem;
        color: var(--tm-hero-kicker, #93c5fd);
        margin-bottom: .5rem;
    }

        .tm-section-hero .tm-text-kicker p {
            margin: 0;
        }

    .tm-section-hero .tm-text h1 {
        font-size: 2.6rem;
        font-weight: 700;
        line-height: 1.15;
        margin-bottom: 1rem;
        color: var(--tm-hero-heading, #f9fafb);
    }

    .tm-section-hero .tm-text-subtitle {
        font-size: 1.05rem;
        color: var(--tm-hero-body, #e5e7eb);
        max-width: 32rem;
        margin-bottom: 1.5rem;
    }

        .tm-section-hero .tm-text-subtitle p {
            margin: 0;
        }

    .tm-section-hero .tm-text p {
        color: var(--tm-hero-body, #e5e7eb);
    }

    .tm-section-hero .tm-badges li {
        background: var(--tm-hero-badge-bg, rgba(255,255,255,0.15));
    }

    .tm-section-hero .tm-right {
        position: relative;
        min-height: 360px;
    }

    .tm-section-hero .tm-text-bg {
        position: absolute;
        top: -20px;
        right: -140px;
        width: 520px;
        opacity: 0.4;
        pointer-events: none;
        user-select: none;
        z-index: 0;
    }

        .tm-section-hero .tm-text-bg p {
            margin: 0;
        }

        .tm-section-hero .tm-text-bg img {
            width: 100%;
            height: auto;
            display: block;
        }

    .tm-section-hero .tm-panel,
    .tm-section-hero .tm-code {
        position: relative;
        z-index: 1;
    }
    /* Ambient hero visual: shared behavior */
    .tm-section-hero .tm-text-ambient {
        position: absolute;
        top: 50%;
        width: min(640px, 50vw);
        opacity: 0.5;
        pointer-events: none;
        user-select: none;
        z-index: 0;
        filter: blur(0.75px);
        mix-blend-mode: screen;
        transform: translateY(-50%);
    }

        .tm-section-hero .tm-text-ambient p {
            margin: 0;
        }

        .tm-section-hero .tm-text-ambient img {
            width: 100%;
            height: auto;
            display: block;
            mask-image: radial-gradient(circle at 55% 50%, black 0%, black 45%, transparent 72%);
            -webkit-mask-image: radial-gradient(circle at 55% 50%, black 0%, black 45%, transparent 72%);
        }

    /* Ambient visual inside right column */
    .tm-section-hero .tm-right .tm-text-ambient {
        right: -10vw;
    }

    /* Ambient visual inside left column, only if ever needed */
    .tm-section-hero .tm-left .tm-text-ambient {
        left: -10vw;
    }



@media (max-width: 768px) {
    .tm-section-hero .tm-text-bg,
    .tm-section-hero .tm-text-ambient {
        display: none;
    }
}
@media (max-width: 767.98px) {
    .tm-section-hero .tm-text h1 {
        font-size: 2.1rem;
    }
}
/* ===========================================
   GALLERY (section variant="gallery")
=========================================== */

.tm-section-gallery .tm-grid > .row > [class*="col-"] {
    display: flex;
}

.tm-section-gallery .tm-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: var(--tm-radius-md);
}

.tm-section-gallery .tm-text {
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .tm-section-gallery .tm-text h3 {
        padding: 18px 18px 0 18px;
        margin: 0 0 12px 0;
        font-size: 1rem;
        line-height: 1.35;
        min-height: 3.2rem;
    }

    .tm-section-gallery .tm-text p {
        margin: 0;
    }

        .tm-section-gallery .tm-text p img {
            display: block;
            width: 100%;
            height: 320px;
            object-fit: contain;
            background: #fff;
            padding: 12px;
        }

/* ==========================================
   Typematter layout utilities
========================================== */

.tm-container {
    width: 100%;
    position: relative;
}

.tm-align-left {
    text-align: left;
}

.tm-align-center {
    text-align: center;
}

.tm-align-right {
    text-align: right;
}

.tm-split,
.tm-grid {
    width: 100%;
}

.tm-gap-sm > .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.tm-gap-md > .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.tm-gap-lg > .row {
    --bs-gutter-x: 2rem;
    --bs-gutter-y: 2rem;
}

.tm-gap-xl > .row {
    --bs-gutter-x: 3rem;
    --bs-gutter-y: 3rem;
}

.tm-grid > .row,
.tm-split > .row {
    margin-left: 0;
    margin-right: 0;
}

.tm-grid-numbered .tm-step-wrap {
    position: relative;
    height: 100%;
    padding-left: 3.25rem;
}

.tm-step-index {
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    background: var(--tm-primary);
    color: #ffffff;
    box-shadow: var(--tm-shadow-sm);
}

.tm-grid-numbered .tm-card,
.tm-grid-numbered .tm-panel,
.tm-grid-numbered .tm-leaf {
    min-height: 100%;
}

.tm-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.tm-cta-left {
    justify-content: flex-start;
}

.tm-cta-center {
    justify-content: center;
}

.tm-cta-right {
    justify-content: flex-end;
}

.tm-text > *:last-child,
.tm-text-subtitle > *:last-child,
.tm-text-kicker > *:last-child,
.tm-text-bg > *:last-child,
.tm-text-ambient > *:last-child,
.tm-leaf > *:last-child {
    margin-bottom: 0;
}

.tm-text-kicker {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 700;
}

.tm-text-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.92;
}

.tm-text-bg {
    pointer-events: none;
    user-select: none;
}

    .tm-text-bg img {
        display: block;
        max-width: 100%;
        height: auto;
    }

.tm-code-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #6b7280;
    margin-bottom: .5rem;
}

.tm-code-file {
    position: relative;
    font-size: .85rem;
    margin-bottom: .75rem;
    color: #475569;
}

.tm-col-5 {
    width: 20%;
}

@media (max-width: 991.98px) {
    .tm-col-5 {
        width: 50%;
    }
}

@media (max-width: 767.98px) {
    .tm-col-5 {
        width: 100%;
    }

    .tm-grid-numbered .tm-step-wrap {
        padding-left: 2.75rem;
    }

    .tm-step-index {
        width: 2rem;
        height: 2rem;
    }
}

/* ===========================================
   Default prose inside tm-text
=========================================== */

.tm-text h1,
.tm-text h2,
.tm-text h3,
.tm-text h4,
.tm-text h5,
.tm-text h6 {
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.9rem;
}

.tm-text h2 {
    font-size: 2rem;
}

.tm-text h3 {
    font-size: 1.35rem;
}

.tm-text p {
    margin-top: 0;
    margin-bottom: 1rem;
}

.tm-text ul,
.tm-text ol {
    margin: 0 0 1.25rem 1.25rem;
    padding: 0;
}

.tm-text li {
    margin-bottom: 0.45rem;
}

.tm-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem 0;
    font-size: 0.96rem;
}

.tm-text thead th {
    text-align: left;
    font-weight: 700;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.12);
}

.tm-text tbody td {
    padding: 0.8rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.tm-text tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

.tm-tone-dark .tm-text thead th {
    border-bottom-color: rgba(255,255,255,0.18);
}

.tm-tone-dark .tm-text tbody td {
    border-bottom-color: rgba(255,255,255,0.08);
}

.tm-tone-dark .tm-text tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

/* ===========================================
   COMPARE (section variant="compare")
=========================================== */

.tm-section-compare .tm-text {
    max-width: 900px;
}

    .tm-section-compare .tm-text table {
        background: var(--tm-bg-light);
        border-radius: var(--tm-radius-md);
        overflow: hidden;
        box-shadow: var(--tm-shadow-sm);
    }

    .tm-section-compare .tm-text thead th {
        background: rgba(0,0,0,0.03);
    }

    .tm-section-compare .tm-text tbody td {
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    .tm-section-compare .tm-text tbody tr:last-child td {
        border-bottom: none;
    }

    .tm-section-compare .tm-text h2 + ul {
        margin-top: 0.75rem;
        padding: 1rem 1.2rem;
        background: rgba(0,0,0,0.04);
        border-radius: var(--tm-radius-sm);
        border-left: 4px solid var(--tm-primary);
    }

    .tm-section-compare .tm-text p:last-child {
        margin-top: 24px;
        font-weight: 600;
    }

.tm-tone-dark.tm-section-compare .tm-text table {
    background: rgba(255,255,255,0.04);
    box-shadow: none;
}

.tm-tone-dark.tm-section-compare .tm-text thead th {
    background: rgba(255,255,255,0.06);
}

.tm-tone-dark.tm-section-compare .tm-text h2 + ul {
    background: rgba(255,255,255,0.06);
    border-left: 4px solid var(--tm-primary);
}
#footer-links .tm-card img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

#footer-links .tm-card p:has(img) {
    display: inline-block;
    margin-right: 12px;
}