/*
 * Ryjik blog post styling — long-form article readability.
 * Loaded only on single-post pages via ryjik-blog-post.php
 * Brand accent: #f97316 (CSS var fallback included).
 */

:root {
    --ryjik-accent: #f97316;
    --ryjik-accent-soft: #fff4ec;
    --ryjik-accent-line: #fed7aa;
    --ryjik-text: #1f2937;
    --ryjik-muted: #6b7280;
    --ryjik-border: #e5e7eb;
    --ryjik-bg-soft: #f9fafb;
    --ryjik-pros: #16a34a;
    --ryjik-pros-soft: #f0fdf4;
    --ryjik-pros-line: #bbf7d0;
    --ryjik-cons: #dc2626;
    --ryjik-cons-soft: #fef2f2;
    --ryjik-cons-line: #fecaca;
}

/* ─── Layout: cap reading column for long-form ─── */
.single-post .post-content {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    color: var(--ryjik-text);
    font-size: 17px;
    line-height: 1.75;
}

@media (max-width: 767px) {
    .single-post .post-content { font-size: 16px; }
}

/* ─── Paragraphs ─── */
.single-post .post-content p {
    margin: 0 0 1.1em;
}

/* Lead paragraph (first paragraph after title) */
.single-post .post-content .ryjik-lead {
    font-size: 1.15em;
    line-height: 1.65;
    color: #111827;
    padding: 1.1em 1.3em;
    background: var(--ryjik-accent-soft);
    border-left: 4px solid var(--ryjik-accent);
    border-radius: 4px;
    margin-bottom: 1.5em;
}

/* ─── Headings ─── */
.single-post .post-content h2 {
    font-size: 1.6em;
    line-height: 1.3;
    margin: 2.2em 0 0.7em;
    padding-bottom: 0.4em;
    border-bottom: 2px solid var(--ryjik-accent-line);
    color: #111827;
    font-weight: 700;
}

.single-post .post-content h2:first-child {
    margin-top: 0;
}

.single-post .post-content h3 {
    font-size: 1.25em;
    line-height: 1.35;
    margin: 1.8em 0 0.6em;
    color: #111827;
    font-weight: 700;
}

.single-post .post-content h4 {
    font-size: 1.08em;
    line-height: 1.4;
    margin: 1.4em 0 0.5em;
    color: #111827;
    font-weight: 700;
}

/* ─── Lists ─── */
.single-post .post-content ul,
.single-post .post-content ol {
    margin: 0 0 1.3em;
    padding-left: 1.6em;
}

.single-post .post-content ul li,
.single-post .post-content ol li {
    margin-bottom: 0.45em;
    padding-left: 0.2em;
}

.single-post .post-content ul li::marker {
    color: var(--ryjik-accent);
    font-size: 1.1em;
}

.single-post .post-content ol li::marker {
    color: var(--ryjik-accent);
    font-weight: 700;
}

/* ─── Criteria list (numbered, after lead) ─── */
.single-post .post-content .ryjik-criteria {
    counter-reset: ryjik-step;
    list-style: none;
    padding-left: 0;
    margin: 1.5em 0 2em;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.7em;
}

.single-post .post-content .ryjik-criteria li {
    counter-increment: ryjik-step;
    position: relative;
    padding: 0.8em 1em 0.8em 2.8em;
    background: #fff;
    border: 1px solid var(--ryjik-border);
    border-radius: 8px;
    margin: 0;
    font-size: 0.96em;
    line-height: 1.45;
}

.single-post .post-content .ryjik-criteria li::before {
    content: counter(ryjik-step);
    position: absolute;
    left: 0.8em;
    top: 0.7em;
    width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    text-align: center;
    background: var(--ryjik-accent);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.9em;
}

/* ─── Tables ─── */
.single-post .post-content figure.wp-block-table,
.single-post .post-content table {
    margin: 1.5em 0;
}

.single-post .post-content figure.wp-block-table {
    overflow-x: auto;
}

.single-post .post-content table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95em;
    background: #fff;
    border: 1px solid var(--ryjik-border);
    border-radius: 8px;
    overflow: hidden;
}

.single-post .post-content table thead th {
    background: var(--ryjik-accent);
    color: #fff;
    font-weight: 700;
    text-align: left;
    padding: 0.8em 1em;
    border: none;
    font-size: 0.95em;
}

.single-post .post-content table tbody td {
    padding: 0.7em 1em;
    border-top: 1px solid var(--ryjik-border);
    line-height: 1.5;
    vertical-align: top;
}

.single-post .post-content table tbody tr:nth-child(odd) {
    background: var(--ryjik-bg-soft);
}

.single-post .post-content figure.wp-block-table figcaption {
    margin-top: 0.6em;
    font-size: 0.88em;
    color: var(--ryjik-muted);
    font-style: italic;
    text-align: left;
}

/* ─── Figures (images) ─── */
.single-post .post-content figure.wp-block-image {
    margin: 1.8em 0;
    text-align: center;
}

.single-post .post-content figure.wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
    display: block;
}

/* ─── Blockquote / callout ─── */
.single-post .post-content blockquote {
    margin: 1.5em 0;
    padding: 1.1em 1.3em 1.1em 1.5em;
    background: var(--ryjik-bg-soft);
    border-left: 4px solid var(--ryjik-muted);
    border-radius: 0 8px 8px 0;
    color: #374151;
    font-style: normal;
}

.single-post .post-content blockquote.ryjik-callout {
    background: #fef3c7;
    border-left-color: #d97706;
}

.single-post .post-content blockquote p {
    margin-bottom: 0.7em;
}

.single-post .post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ─── Pros/Cons two-column comparison ─── */
.single-post .post-content .ryjik-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
    margin: 1.5em 0;
}

@media (max-width: 600px) {
    .single-post .post-content .ryjik-pros-cons {
        grid-template-columns: 1fr;
    }
}

.single-post .post-content .ryjik-pros,
.single-post .post-content .ryjik-cons {
    padding: 1.2em 1.3em;
    border-radius: 8px;
    border: 1px solid;
}

.single-post .post-content .ryjik-pros {
    background: var(--ryjik-pros-soft);
    border-color: var(--ryjik-pros-line);
}

.single-post .post-content .ryjik-cons {
    background: var(--ryjik-cons-soft);
    border-color: var(--ryjik-cons-line);
}

.single-post .post-content .ryjik-pros h4,
.single-post .post-content .ryjik-cons h4 {
    margin: 0 0 0.7em;
    font-size: 1.05em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.single-post .post-content .ryjik-pros h4 { color: var(--ryjik-pros); }
.single-post .post-content .ryjik-cons h4 { color: var(--ryjik-cons); }

.single-post .post-content .ryjik-pros h4::before {
    content: "✓";
    display: inline-flex;
    width: 1.5em;
    height: 1.5em;
    background: var(--ryjik-pros);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    flex-shrink: 0;
}

.single-post .post-content .ryjik-cons h4::before {
    content: "✕";
    display: inline-flex;
    width: 1.5em;
    height: 1.5em;
    background: var(--ryjik-cons);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    flex-shrink: 0;
}

.single-post .post-content .ryjik-pros ul,
.single-post .post-content .ryjik-cons ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.single-post .post-content .ryjik-pros li,
.single-post .post-content .ryjik-cons li {
    position: relative;
    padding: 0.3em 0 0.3em 1.4em;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.single-post .post-content .ryjik-pros li::before {
    content: "+";
    position: absolute;
    left: 0;
    top: 0.3em;
    color: var(--ryjik-pros);
    font-weight: 700;
}

.single-post .post-content .ryjik-cons li::before {
    content: "−";
    position: absolute;
    left: 0;
    top: 0.3em;
    color: var(--ryjik-cons);
    font-weight: 700;
}

/* ─── Step titles (RER calculation) ─── */
.single-post .post-content .ryjik-step-title {
    counter-increment: ryjik-formula-step;
    position: relative;
    padding: 0.6em 0 0.6em 3em;
    margin: 1.5em 0 0.6em;
    font-size: 1.1em;
    color: #111827;
}

.single-post .post-content {
    counter-reset: ryjik-formula-step;
}

.single-post .post-content .ryjik-step-title::before {
    content: counter(ryjik-formula-step);
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 2em;
    height: 2em;
    line-height: 2em;
    text-align: center;
    background: var(--ryjik-accent);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.9em;
}

/* ─── Code (formulas) ─── */
.single-post .post-content code {
    background: var(--ryjik-bg-soft);
    border: 1px solid var(--ryjik-border);
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    color: #1f2937;
}

/* ─── Final summary list ─── */
.single-post .post-content .ryjik-summary-list {
    counter-reset: ryjik-summary;
    list-style: none;
    padding: 0;
    margin: 1em 0 1.5em;
    background: var(--ryjik-accent-soft);
    border-radius: 10px;
    padding: 1.3em 1.5em 1.3em 1.5em;
    border: 1px solid var(--ryjik-accent-line);
}

.single-post .post-content .ryjik-summary-list li {
    counter-increment: ryjik-summary;
    position: relative;
    padding: 0.4em 0 0.4em 2.2em;
    margin: 0;
    border-bottom: 1px solid var(--ryjik-accent-line);
}

.single-post .post-content .ryjik-summary-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.single-post .post-content .ryjik-summary-list li::before {
    content: counter(ryjik-summary);
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 1.6em;
    height: 1.6em;
    line-height: 1.6em;
    text-align: center;
    background: var(--ryjik-accent);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.85em;
}

/* ─── FAQ accordion ─── */
.single-post .post-content .ryjik-faq-item {
    margin: 0.6em 0;
    border: 1px solid var(--ryjik-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.single-post .post-content .ryjik-faq-item summary {
    cursor: pointer;
    padding: 0.95em 1.2em 0.95em 2.6em;
    font-weight: 600;
    font-size: 1.02em;
    color: #111827;
    list-style: none;
    position: relative;
    transition: background 0.15s;
}

.single-post .post-content .ryjik-faq-item summary::-webkit-details-marker {
    display: none;
}

.single-post .post-content .ryjik-faq-item summary::before {
    content: "+";
    position: absolute;
    left: 0.95em;
    top: 50%;
    transform: translateY(-50%);
    width: 1.3em;
    height: 1.3em;
    line-height: 1.3em;
    text-align: center;
    background: var(--ryjik-accent);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.9em;
    transition: transform 0.2s;
}

.single-post .post-content .ryjik-faq-item[open] summary::before {
    content: "−";
}

.single-post .post-content .ryjik-faq-item:hover summary {
    background: var(--ryjik-accent-soft);
}

.single-post .post-content .ryjik-faq-answer {
    padding: 0 1.2em 1em 2.6em;
    color: #374151;
    line-height: 1.65;
}

.single-post .post-content .ryjik-faq-answer p {
    margin: 0 0 0.7em;
}

.single-post .post-content .ryjik-faq-answer p:last-child {
    margin-bottom: 0;
}

/* ─── Links inside content ─── */
.single-post .post-content a {
    color: var(--ryjik-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

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

/* ─── HR ─── */
.single-post .post-content hr {
    border: none;
    border-top: 1px solid var(--ryjik-border);
    margin: 2.5em 0;
}

/* ─── Title section: extra breathing room ─── */
.single-post .post-title-section {
    text-align: center;
    margin-bottom: 1.8em;
}

.single-post .post-title-section .post-title {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
}

/* ─── Strong/inline emphasis: subtle accent ─── */
.single-post .post-content p > strong:first-child {
    color: #111827;
}
