/**
 * Single Blog Post Typography & Layout
 * Scoped to .single-post .entry-content
 * Overrides Minimog theme defaults. Only loaded on single posts (is_singular('post')).
 */

/* ─── Design tokens (mirrors product-content.css) ────────────── */
:root {
    --sp-brand: #007cba;
    --sp-brand-light: #e8f4fb;
    --sp-brand-mid: #c2e0f2;
    --sp-heading: #1a2332;
    --sp-text: #3d4a5c;
    --sp-muted: #6b7a8d;
    --sp-border: #e2e8f0;
    --sp-bg: #ffffff;
    --sp-radius: 10px;
    --sp-radius-sm: 6px;
    --sp-shadow: 0 2px 12px rgba(0, 124, 186, 0.07);
    --sp-shadow-hover: 0 6px 24px rgba(0, 124, 186, 0.14);
}

/* ─── Entry header ───────────────────────────────────────────── */
.single-post .entry-header {
    margin-bottom: 2rem;
}

/* Category badge(s) */
.single-post .entry-header .entry-post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.single-post .entry-header .entry-post-categories a {
    display: inline-block;
    background: var(--sp-brand-light);
    color: var(--sp-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid var(--sp-brand-mid);
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.single-post .entry-header .entry-post-categories a:hover {
    background: var(--sp-brand);
    color: #fff;
    border-color: var(--sp-brand);
}

/* Post title (h1) */
.single-post .entry-header .entry-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--sp-heading);
    line-height: 1.25;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

/* Meta row (date, author, etc.) */
.single-post .entry-header .entry-post-meta {
    margin-bottom: 1.5rem;
}

.single-post .entry-header .entry-post-meta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem 1.25rem;
}

.single-post .entry-header .post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--sp-muted);
    font-weight: 500;
}

.single-post .entry-header .post-date span {
    color: var(--sp-muted);
}

/* Featured image */
.single-post .entry-header .entry-post-feature,
.single-post .entry-header .post-thumbnail {
    margin: 0;
    border-radius: var(--sp-radius);
    overflow: hidden;
    box-shadow: var(--sp-shadow);
    line-height: 0;
    aspect-ratio: 3 / 2;
    position: relative;
}

/* Minimog lazy-image wrapper — fill the container */
.single-post .entry-header .entry-post-feature m-image,
.single-post .entry-header .post-thumbnail m-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    --lazy-image-width: 100% !important;
    --lazy-image-height: 100% !important;
}

.single-post .entry-header .entry-post-feature img,
.single-post .entry-header .post-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    display: block;
}

/* ─── Base content area ──────────────────────────────────────── */
.single-post .entry-content {
    color: var(--sp-text);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 100%;
}

/* ─── Paragraphs ─────────────────────────────────────────────── */
.single-post .entry-content p {
    margin: 0 0 1.25rem;
    color: var(--sp-text);
    line-height: 1.8;
}

.single-post .entry-content p:last-child {
    margin-bottom: 0;
}

/* ─── H2 — section titles ───────────────────────────────────── */
.single-post .entry-content h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--sp-heading);
    margin: 2.25rem 0 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--sp-brand-mid);
    position: relative;
    line-height: 1.3;
}

.single-post .entry-content h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background: var(--sp-brand);
    border-radius: 2px;
}

/* ─── H3 — sub-section titles ───────────────────────────────── */
.single-post .entry-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sp-brand);
    margin: 1.75rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.875rem;
}

/* ─── H4 ─────────────────────────────────────────────────────── */
.single-post .entry-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--sp-heading);
    margin: 1.5rem 0 0.5rem;
}

/* ─── Unordered lists ────────────────────────────────────────── */
.single-post .entry-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.single-post .entry-content ul li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--sp-text);
    line-height: 1.7;
}

.single-post .entry-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    background: var(--sp-brand);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ─── Ordered lists ──────────────────────────────────────────── */
.single-post .entry-content ol {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    counter-reset: sp-counter;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.single-post .entry-content ol li {
    padding-left: 2.375rem;
    position: relative;
    counter-increment: sp-counter;
    color: var(--sp-text);
    line-height: 1.7;
}

.single-post .entry-content ol li::before {
    content: counter(sp-counter);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--sp-brand);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

/* ─── Inline links ───────────────────────────────────────────── */
.single-post .entry-content a {
    color: var(--sp-brand);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--sp-brand-mid);
    text-underline-offset: 3px;
    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.single-post .entry-content a:hover {
    color: var(--sp-heading);
    text-decoration-color: var(--sp-heading);
}

/* ─── Strong / em ────────────────────────────────────────────── */
.single-post .entry-content strong {
    color: var(--sp-heading);
    font-weight: 600;
}

.single-post .entry-content em {
    color: var(--sp-muted);
    font-style: italic;
}

/* ─── Blockquote ─────────────────────────────────────────────── */
.single-post .entry-content blockquote {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--sp-brand);
    background: var(--sp-brand-light);
    border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
    color: var(--sp-heading);
    font-size: 1.0125rem;
    line-height: 1.7;
    font-style: italic;
}

.single-post .entry-content blockquote p {
    margin: 0;
    color: inherit;
}

/* ─── Images ─────────────────────────────────────────────────── */
.single-post .entry-content img:not(.fg-image) {
    border-radius: var(--sp-radius-sm);
    max-width: 100%;
    height: auto;
}

/* ─── Horizontal rule ────────────────────────────────────────── */
.single-post .entry-content hr {
    border: none;
    border-top: 2px solid var(--sp-border);
    margin: 2rem 0;
}

/* ─── Table ──────────────────────────────────────────────────── */
.single-post .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}

.single-post .entry-content table th {
    background: var(--sp-brand-light);
    color: var(--sp-heading);
    font-weight: 600;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--sp-border);
    text-align: left;
}

.single-post .entry-content table td {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--sp-border);
    color: var(--sp-text);
    vertical-align: top;
}

.single-post .entry-content table tr:nth-child(even) td {
    background: #f8fbfd;
}

/* ─── Lead / intro paragraph (first p after h1/entry-title) ─── */
.single-post .entry-content > p:first-child {
    font-size: 1.05rem;
    color: var(--sp-text);
    line-height: 1.85;
}

/* ─── Code / pre ─────────────────────────────────────────────── */
.single-post .entry-content code {
    background: var(--sp-brand-light);
    color: var(--sp-brand);
    font-size: 0.875em;
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
}

.single-post .entry-content pre {
    background: var(--sp-heading);
    color: #e8f4fb;
    padding: 1.25rem 1.5rem;
    border-radius: var(--sp-radius-sm);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 1.5rem 0;
}

/* ─── Post FAQ block ─────────────────────────────────────────── */
.single-post .post-faq-block {
    margin-top: 2.5rem;
}

.single-post .post-faq-block > h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--sp-heading);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--sp-brand-mid);
    position: relative;
    line-height: 1.3;
}

.single-post .post-faq-block > h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 3rem;
    height: 2px;
    background: var(--sp-brand);
    border-radius: 2px;
}

.single-post .post-faq-block .faq-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--sp-border);
}

.single-post .post-faq-block .faq-item:first-of-type {
    padding-top: 0;
}

.single-post .post-faq-block .faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.single-post .post-faq-block .faq-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sp-heading);
    margin: 0 0 0.5rem;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
    padding-left: 0.875rem;
    border-left: 3px solid var(--sp-brand);
    background: none;
    border-bottom: none;
    display: block;
}

.single-post .post-faq-block .faq-item h3::before {
    display: none;
}

.single-post .post-faq-block .faq-item p {
    margin: 0;
    padding: 0 0 0 0.875rem;
    color: var(--sp-text);
    font-size: 1rem;
    line-height: 1.8;
    background: none;
}

.single-post .post-faq-block .faq-item p a {
    color: var(--sp-brand);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--sp-brand-mid);
    text-underline-offset: 3px;
    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.single-post .post-faq-block .faq-item p a:hover {
    color: var(--sp-heading);
    text-decoration-color: var(--sp-heading);
}

/* ─── Mobile — tablet ≤ 768px ────────────────────────────────── */
@media (max-width: 768px) {
    .single-post .entry-header .entry-title {
        font-size: 1.625rem;
    }
    .single-post .entry-content {
        font-size: 0.9625rem;
    }

    .single-post .entry-content h2 {
        font-size: 1.25rem;
        margin-top: 1.875rem;
    }

    .single-post .entry-content h3 {
        margin-top: 1.5rem;
    }

    .single-post .entry-content ol li {
        padding-left: 2.125rem;
    }

    .single-post .entry-content blockquote {
        padding: 1rem 1.125rem;
    }

    .single-post .post-faq-block {
        margin-top: 2rem;
    }

    .single-post .post-faq-block > h2 {
        font-size: 1.25rem;
    }

    .single-post .post-faq-block .faq-item h3 {
        font-size: 0.9375rem;
    }
}

/* ─── Mobile — small ≤ 480px ─────────────────────────────────── */
@media (max-width: 480px) {
    .single-post .entry-header .entry-title {
        font-size: 1.35rem;
        letter-spacing: 0;
    }

    .single-post .entry-header {
        margin-bottom: 1.5rem;
    }

    .single-post .entry-header .entry-post-feature,
    .single-post .entry-header .post-thumbnail {
        border-radius: var(--sp-radius-sm);
        aspect-ratio: 4 / 3;
    }
    .single-post .entry-content {
        font-size: 0.9375rem;
        line-height: 1.75;
    }

    .single-post .entry-content h2 {
        font-size: 1.125rem;
        margin-top: 1.625rem;
        padding-bottom: 0.625rem;
    }

    .single-post .entry-content h3 {
        margin-top: 1.25rem;
    }

    .single-post .entry-content ul li,
    .single-post .entry-content ol li {
        line-height: 1.65;
    }

    .single-post .entry-content blockquote {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    .single-post .entry-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .single-post .post-faq-block {
        margin-top: 1.5rem;
    }

    .single-post .post-faq-block > h2 {
        font-size: 1.125rem;
    }

    .single-post .post-faq-block .faq-item h3 {
        font-size: 0.875rem;
    }

    .single-post .post-faq-block .faq-item p {
        font-size: 0.9375rem;
    }
}
