/* Tapaj editorial components v0.9.8. Local assets only; article scope. */
.gh-content {
    --tp-accent: #ff6500;
    --tp-accent-bg: #fff4eb;
    --tp-navy: #142b4a;
    --tp-heading: #142b4a;
    --tp-soft: #f4f7fb;
    --tp-surface: var(--background-color, #fff);
    --tp-line: #dce3ed;
    --tp-text: var(--color-primary-text, #242428);
    --tp-muted: #526176;
    --tp-shadow: 0 6px 24px rgb(20 43 74 / .05);
}
html[data-theme="dark"] .gh-content {
    --tp-accent-bg: #30251f;
    --tp-heading: #e1eafa;
    --tp-soft: #1b2636;
    --tp-line: #344154;
    --tp-muted: #b0bfd3;
    --tp-shadow: none;
}
.gh-content :is(ul, ol):not([class]) { padding-inline-start: 2.6rem; }
/* Native editor highlights: inline, wrapping safely across Persian lines. */
.gh-content mark {
    background: #ffead6; color: #142b4a; padding: .08em .22em;
    border-radius: .3em; box-shadow: inset 0 -.12em 0 #ff6500;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html[data-theme="dark"] .gh-content mark { background: #49301f; color: #ffe5ce; }
.gh-content :is(ul, ol):not([class]) > li { padding-inline-start: .4rem; margin-block: .7rem; }
.gh-content :is(ul, ol):not([class]) > li::marker { color: var(--tp-accent); font-weight: 700; }
.gh-content ol:not([class]) { list-style-type: persian; }
/* A real h2 belongs in the HTML card, not in a native Callout text field. */
.gh-content :is(.tapaj-summary, .post-summary, .tapaj-note) {
    position: relative; padding: 2.4rem 2.8rem; border: 1px solid var(--tp-line);
    border-inline-start: 4px solid var(--tp-accent); border-radius: 16px;
    background: var(--tp-soft); color: var(--tp-text); box-shadow: var(--tp-shadow);
    font-size: 1.6rem; line-height: 2.1; overflow-wrap: anywhere;
}
.gh-content :is(.tapaj-summary, .post-summary) > :is(h2, h3, strong):first-child {
    display: flex; align-items: center; gap: 1rem; margin: 0 0 1.4rem;
    padding-block-end: 1.2rem; border-block-end: 1px solid var(--tp-line);
    color: var(--tp-heading); font-size: 2.1rem; line-height: 1.8; font-weight: 800;
}
.gh-content :is(.tapaj-summary, .post-summary) > :is(h2, h3, strong):first-child::before {
    content: ""; width: .7rem; height: 2.2rem; border-radius: 4px;
    background: var(--tp-accent); flex-shrink: 0;
}
.gh-content :is(.tapaj-summary, .post-summary, .tapaj-note) > :first-child { margin-block-start: 0; }
.gh-content :is(.tapaj-summary, .post-summary, .tapaj-note) > :last-child { margin-block-end: 0; }
.gh-content .tapaj-note { background: var(--tp-accent-bg); }
.gh-content .tapaj-note > :is(strong, h2, h3):first-child { display: block; margin: 0 0 .8rem; color: var(--tp-heading); font-size: 1.8rem; font-weight: 800; }
/* Brand colors, explicit labels and different symbols distinguish the two lists. */
.gh-content .tapaj-pros-cons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; }
/* A lone box fills the article, including when its sibling was removed. */
.gh-content .tapaj-pros-cons > :is(.tapaj-pros, .tapaj-cons):only-child { grid-column: 1 / -1; }
.gh-content > :is(.tapaj-pros, .tapaj-cons) { width: 100%; }
.gh-content :is(.tapaj-pros, .tapaj-cons) {
    --tp-status: var(--tp-navy); min-width: 0; border: 1px solid var(--tp-line);
    border-radius: 16px; background: var(--tp-surface); color: var(--tp-text);
    box-shadow: var(--tp-shadow); overflow: hidden; overflow-wrap: anywhere;
}
.gh-content .tapaj-cons { --tp-status: var(--tp-accent); }
.gh-content :is(.tapaj-pros, .tapaj-cons) > :is(h2, h3, h4, strong):first-child {
    display: block; padding: 1.6rem 2rem; margin: 0; background: var(--tp-navy);
    border-block-start: 3px solid var(--tp-accent); color: #fff; font-size: 1.8rem; line-height: 1.8;
}
.gh-content .tapaj-cons > :is(h2, h3, h4, strong):first-child { background: var(--tp-accent-bg); color: var(--tp-heading); }
.gh-content :is(.tapaj-pros, .tapaj-cons) > ul { list-style: none; padding: .8rem 2rem 1.2rem; margin: 0; }
.gh-content :is(.tapaj-pros, .tapaj-cons) > ul > li {
    position: relative; padding: 1rem 0; padding-inline-start: 3.5rem;
    margin: 0; border-block-end: 1px solid var(--tp-line); font-size: 1.55rem; line-height: 2;
}
.gh-content :is(.tapaj-pros, .tapaj-cons) > ul > li:last-child { border-block-end: 0; }
.gh-content :is(.tapaj-pros, .tapaj-cons) > ul > li::before {
    content: "+"; position: absolute; inset-inline-start: 0; inset-block-start: 1.4rem;
    display: grid; place-items: center; width: 2.2rem; height: 2.2rem;
    border-radius: 7px; background: var(--tp-navy); color: #fff; font-size: 1.6rem; line-height: 1; font-weight: 800;
}
.gh-content .tapaj-cons > ul > li::before { content: "\2212"; background: var(--tp-accent); color: var(--tp-navy); }
/* Native Ghost state and click handler are retained; only the icon's visual changes. */
.gh-content .kg-toggle-card {
    padding: 0; overflow: hidden; border: 1px solid var(--tp-line); border-radius: 14px;
    box-shadow: var(--tp-shadow); background: var(--tp-soft); color: var(--tp-text);
}
.gh-content .kg-toggle-card[data-kg-toggle-state="open"] { border-color: var(--tp-accent); }
.gh-content .kg-toggle-card .kg-toggle-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 1.6rem;
    padding: 1.8rem 2rem; margin: 0; background: var(--tp-navy); border-inline-start: 4px solid var(--tp-accent);
}
.gh-content .kg-toggle-card .kg-toggle-heading-text {
    flex: 1; min-width: 0; margin: 0; padding: 0; color: #fff;
    font-family: inherit; font-size: 1.7rem; font-weight: 700; line-height: 1.9; overflow-wrap: anywhere;
}
.gh-content .kg-toggle-card .kg-toggle-card-icon {
    position: relative; display: grid; place-items: center; flex: 0 0 3.6rem;
    width: 3.6rem; height: 3.6rem; margin: 0; padding: 0; border: 1px solid var(--tp-accent);
    border-radius: 10px; background: var(--tp-accent); color: var(--tp-navy);
    transform: none; cursor: pointer;
}
.gh-content .kg-toggle-card .kg-toggle-card-icon svg { display: none; }
.gh-content .kg-toggle-card .kg-toggle-card-icon::before,
.gh-content .kg-toggle-card .kg-toggle-card-icon::after {
    content: ""; position: absolute; width: 14px; height: 2px; background: currentColor; border-radius: 2px;
    top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
}
.gh-content .kg-toggle-card .kg-toggle-card-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.gh-content .kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon { transform: none; }
.gh-content .kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon::after { opacity: 0; }
.gh-content .kg-toggle-card .kg-toggle-card-icon:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.gh-content .kg-toggle-card .kg-toggle-content { background: var(--tp-soft); padding: 0 2rem; }
.gh-content .kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-content { padding: 1.8rem 2rem; }
.gh-content .kg-toggle-card .kg-toggle-content > :first-child { margin-block-start: 0; }
.gh-content .kg-toggle-card .kg-toggle-content > :last-child { margin-block-end: 0; }
.gh-content .kg-callout-card-white { background: var(--tp-soft); border: 1px solid var(--tp-line); border-inline-start: 4px solid var(--tp-accent); border-radius: 14px; }
.gh-content :is(.tapaj-faq, .faq-container) { display: grid; gap: 1.2rem; }
.gh-content :is(.tapaj-faq, .faq-container) > details {
    border: 1px solid var(--tp-line); border-radius: 14px; background: var(--tp-surface);
    color: var(--tp-text); box-shadow: var(--tp-shadow); overflow-wrap: anywhere;
}
.gh-content :is(.tapaj-faq, .faq-container) > details[open] { border-color: var(--tp-accent); }
.gh-content :is(.tapaj-faq, .faq-container) > details > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 1.6rem;
    padding: 1.8rem 2rem; cursor: pointer; list-style: none; color: #fff;
    background: var(--tp-navy); border-inline-start: 4px solid var(--tp-accent); border-radius: 13px;
    font-size: 1.6rem; line-height: 1.9; font-weight: 700;
}
.gh-content :is(.tapaj-faq, .faq-container) > details[open] > summary { border-radius: 13px 13px 0 0; }
.gh-content :is(.tapaj-faq, .faq-container) summary::-webkit-details-marker { display: none; }
.gh-content :is(.tapaj-faq, .faq-container) > details > summary::after {
    content: "+"; display: grid; place-items: center; width: 2.8rem; height: 2.8rem;
    border-radius: 8px; background: var(--tp-accent-bg); flex-shrink: 0;
    font-size: 2rem; line-height: 1; color: var(--tp-heading); border: 1px solid var(--tp-accent);
}
.gh-content :is(.tapaj-faq, .faq-container) > details[open] > summary::after { content: "\2212"; }
.gh-content :is(.tapaj-faq, .faq-container) summary:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: -4px; border-radius: 12px; }
.gh-content :is(.tapaj-faq-answer, .faq-content) { padding: 1.6rem 2rem; background: var(--tp-soft); border-block-start: 1px solid var(--tp-line); border-radius: 0 0 14px 14px; font-size: 1.6rem; line-height: 2; }
.gh-content :is(.tapaj-faq-answer, .faq-content) > :first-child { margin-block-start: 0; }
.gh-content :is(.tapaj-faq-answer, .faq-content) > :last-child { margin-block-end: 0; }
/* Simple tables become labeled cards; complex tables retain local scrolling. */
.gh-content :is(.tapaj-table-wrap, .gh-table) { overflow-x: auto; max-width: 100%; border: 1px solid var(--tp-line); border-radius: 16px; box-shadow: var(--tp-shadow); }
.gh-content .tapaj-table-wrap:focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 3px; }
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) {
    display: table; width: 100%; margin: 0; border-collapse: collapse;
    background: var(--tp-surface); color: var(--tp-text); font-size: 1.5rem;
}
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) caption {
    padding: 1.5rem 1.8rem; text-align: start; font-weight: 800; color: var(--tp-heading);
    background: var(--tp-soft); border-block-end: 3px solid var(--tp-accent); font-size: 1.65rem; line-height: 1.9;
}
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) :is(th, td) { padding: 1.4rem 1.8rem; border-block-end: 1px solid var(--tp-line); text-align: start; line-height: 1.9; }
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) thead th { background: var(--tp-navy); color: #fff; font-weight: 700; }
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) tbody tr:nth-child(even) { background: var(--tp-soft); }
.gh-content :is(.tapaj-table, .custom-table, .gh-table :where(table)) tbody tr:last-child > * { border-block-end: 0; }
@media (max-width: 600px) {
    .gh-content .tapaj-pros-cons { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .gh-content :is(.tapaj-summary, .post-summary, .tapaj-note) { padding: 1.8rem; border-radius: 12px; }
    .gh-content :is(.tapaj-summary, .post-summary) > :is(h2, h3, strong):first-child { font-size: 1.9rem; }
    .gh-content .tapaj-table--cards { display: block; width: 100%; background: var(--tp-soft); }
    .gh-content .tapaj-table--cards caption { display: block; width: 100%; }
    /* Visually hidden, not display:none: preserve column headings for AT. */
    .gh-content .tapaj-table--cards thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .gh-content .tapaj-table--cards tbody { display: block; padding: 1.2rem; width: 100%; }
    .gh-content .tapaj-table--cards tbody tr {
        display: block; width: 100%; margin: 0 0 1.2rem; padding: .4rem 1.4rem;
        border: 1px solid var(--tp-line); border-inline-start: 3px solid var(--tp-accent);
        border-radius: 12px; background: var(--tp-surface); box-shadow: var(--tp-shadow);
    }
    .gh-content .tapaj-table--cards tbody tr:nth-child(even) { background: var(--tp-surface); }
    .gh-content .tapaj-table--cards tbody tr:last-child { margin-block-end: 0; }
    .gh-content .tapaj-table--cards tbody :is(th, td) {
        display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr);
        align-items: baseline; gap: 1.2rem; width: 100%; padding: 1.2rem 0;
        border-block-end: 1px solid var(--tp-line); text-align: end; overflow-wrap: anywhere;
        white-space: normal; font-size: 1.45rem; line-height: 2;
    }
    .gh-content .tapaj-table--cards tbody :is(th, td)::before { content: attr(data-label); text-align: start; color: var(--tp-heading); font-weight: 700; }
    .gh-content .tapaj-table--cards tbody tr > :first-child { color: var(--tp-heading); font-weight: 800; }
    .gh-content .tapaj-table--cards tbody tr > :last-child { border-block-end: 0; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    .gh-content :is(.tapaj-faq, .faq-container) > details > summary { transition: background-color .15s ease; }
    .gh-content :is(.tapaj-faq, .faq-container) > details > summary:hover { background: #1d3c63; }
}
