.rich-text-content {
    max-width: 72ch;
    font-size: var(--fs-md);
    line-height: 1.65;
    color: var(--c-ink);
}
.rich-text-content > * + * {
    margin-top: var(--s-4);
}
.section--dark .rich-text-content {
    color: var(--c-cream);
}

/* ---------- nagłówki ---------- */
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4 {
    font-family: var(--f-display);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
}
.rich-text-content h2 {
    font-size: var(--fs-xl);
    margin-top: var(--s-7);
}
.rich-text-content h3 {
    font-size: var(--fs-lg);
    margin-top: var(--s-6);
}
.rich-text-content h4 {
    font-size: var(--fs-md);
    letter-spacing: 0.06em;
    margin-top: var(--s-5);
    color: var(--c-orange);
}
.rich-text-content h2:first-child,
.rich-text-content h3:first-child,
.rich-text-content h4:first-child {
    margin-top: 0;
}
.rich-text-content h2 + *,
.rich-text-content h3 + *,
.rich-text-content h4 + * {
    margin-top: var(--s-3);
}

/* ---------- akapity, wyróżnienia ---------- */
.rich-text-content p {
    text-wrap: pretty;
}
.rich-text-content .lead,
.rich-text-content p:first-child:has(+ h2) {
    font-size: var(--fs-lg);
}
.rich-text-content strong,
.rich-text-content b {
    font-weight: 700;
}
.rich-text-content em,
.rich-text-content i {
    font-style: italic;
}
.rich-text-content small {
    font-size: var(--fs-sm);
    color: var(--c-muted);
}
.rich-text-content mark {
    background: var(--c-orange-2);
    color: var(--c-ink);
    padding: 0 0.2em;
}
.rich-text-content sub,
.rich-text-content sup {
    font-size: 0.75em;
    line-height: 0;
}

/* ---------- linki ---------- */
.rich-text-content a {
    color: var(--c-orange-3);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: var(--c-orange-2);
    transition:
        color var(--ease),
        text-decoration-color var(--ease);
}
.rich-text-content a:hover {
    color: var(--c-orange);
    text-decoration-color: var(--c-orange);
}
.rich-text-content a:active {
    color: var(--c-magenta);
}
.section--dark .rich-text-content a {
    color: var(--c-orange-2);
}
.section--dark .rich-text-content a:hover {
    color: var(--c-cream);
}

/* ---------- listy ---------- */
.rich-text-content ul,
.rich-text-content ol {
    padding-left: var(--s-5);
}
.rich-text-content ul {
    list-style: none;
}
.rich-text-content ul > li {
    position: relative;
    padding-left: var(--s-4);
}
.rich-text-content ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 8px;
    height: 3px;
    background: var(--c-orange);
}
.rich-text-content ol {
    list-style: none;
    counter-reset: item;
}
.rich-text-content ol > li {
    position: relative;
    padding-left: var(--s-5);
    counter-increment: item;
}
.rich-text-content ol > li::before {
    content: counter(item) '.';
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--f-display);
    font-weight: 700;
    color: var(--c-orange);
}
.rich-text-content li + li {
    margin-top: var(--s-2);
}
.rich-text-content li > ul,
.rich-text-content li > ol {
    margin-top: var(--s-2);
}

/* ---------- cytaty ---------- */
.rich-text-content blockquote {
    position: relative;
    margin-block: var(--s-3);
    padding: var(--s-2) var(--s-5);
    border-left: 3px solid var(--c-orange);
    background: var(--c-cream-2);
    font-family: var(--f-display);
    font-weight: 600;
    font-size: var(--fs-lg);
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--c-ink);
}
.rich-text-content blockquote + p {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: var(--fs-lg);
}
.rich-text-content blockquote::after {
    content: '';
    position: absolute;
    left: -3px;
    right: auto;
    bottom: -5px;
    width: 40px;
    height: 2px;
    background: var(--c-magenta);
}
.rich-text-content blockquote p + p {
    margin-top: 0;
}
.rich-text-content blockquote cite,
.rich-text-content blockquote footer {
    display: block;
    margin-top: var(--s-3);
    font-family: var(--f-body);
    font-weight: 600;
    font-size: var(--fs-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-style: normal;
    color: var(--c-muted);
}
.rich-text-content blockquote cite::before,
.rich-text-content blockquote footer::before {
    content: '— ';
}
.section--dark .rich-text-content blockquote {
    background: var(--c-ink-2);
    color: var(--c-cream);
}
.section--dark .rich-text-content blockquote cite {
    color: var(--c-sand);
}
.rich-text-content q {
    quotes: '„' '”';
    font-style: italic;
}

/* ---------- media ---------- */
.rich-text-content img,
.rich-text-content video,
.rich-text-content iframe {
    width: 100%;
    border-radius: var(--r-md);
    margin-block: var(--s-6);
}
.rich-text-content iframe {
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}
.rich-text-content figure {
    margin-block: var(--s-6);
}
.rich-text-content figure img,
.rich-text-content figure video {
    margin-block: 0;
}
.rich-text-content figcaption {
    margin-top: var(--s-2);
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-muted);
}

/* ---------- tabela ---------- */
.rich-text-content table {
    margin-block: var(--s-6);
    font-size: var(--fs-sm);
    display: block;
    overflow-x: auto;
}
.rich-text-content thead th {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
    padding: var(--s-3) var(--s-4);
    color: var(--c-orange-3);
    border-bottom: 2px solid var(--c-orange);
    white-space: nowrap;
}
.rich-text-content td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-sand);
    vertical-align: top;
}
.rich-text-content tbody tr:hover td {
    background: rgba(232, 116, 30, 0.06);
}
.section--dark .rich-text-content td {
    border-bottom-color: var(--c-ink-4);
}

/* ---------- kod, separator, definicje ---------- */
.rich-text-content code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.9em;
    padding: 0.1em 0.4em;
    background: var(--c-cream-2);
    border: 1px solid var(--c-sand);
    border-radius: var(--r-sm);
}
.rich-text-content pre {
    padding: var(--s-4);
    overflow-x: auto;
    background: var(--c-ink);
    color: var(--c-cream);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.rich-text-content pre code {
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
}
.rich-text-content hr {
    border: 0;
    height: 3px;
    background: var(--c-orange);
    width: 48px;
    margin-block: var(--s-7);
    position: relative;
}
.rich-text-content hr::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--c-magenta);
}
.rich-text-content dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--s-2) var(--s-5);
}
.rich-text-content dt {
    font-family: var(--f-display);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--c-orange-3);
}
.rich-text-content dd {
    color: var(--c-muted);
}

/* ---------- osadzenie w sekcji ---------- */
.section.rich-text-content-section .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
}

/* ---------- responsywność ---------- */
@media (min-width: 768px) {
    .rich-text-content {
        font-size: 1.0625rem;
    }
    .rich-text-content h2 {
        font-size: var(--fs-2xl);
    }
    .rich-text-content h3 {
        font-size: var(--fs-xl);
    }
    .rich-text-content h4 {
        font-size: var(--fs-lg);
    }
    .rich-text-content blockquote {
        padding: var(--s-2) var(--s-6);
        font-size: var(--fs-xl);
    }
    .rich-text-content blockquote + p {
        margin-top: 0;
        padding: var(--s-2) var(--s-6) var(--s-2);
        font-size: var(--fs-xl);
    }
    .rich-text-content img.align-left,
    .rich-text-content figure.align-left {
        float: left;
        width: 45%;
        margin: var(--s-2) var(--s-6) var(--s-4) 0;
    }
    .rich-text-content img.align-right,
    .rich-text-content figure.align-right {
        float: right;
        width: 45%;
        margin: var(--s-2) 0 var(--s-4) var(--s-6);
    }
    .rich-text-content .clear,
    .rich-text-content h2,
    .rich-text-content h3 {
        clear: both;
    }
}
@media (min-width: 1024px) {
    .section.rich-text-content-section .container {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: var(--s-8);
        align-items: start;
    }
}
