/* ── Article reading experience ─────────────────────────────────── */

.post-page {
    padding-bottom: 2rem;
}

.single-wrapper {
    max-width: 42rem;
    margin: 2rem auto 3rem;
    background: var(--card-bg);
    padding: 2rem 2.25rem 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.post-header-area {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.post-meta-badges span,
.post-meta-badges a {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.post-author-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.post-author-link:hover {
    color: var(--primary-color);
}

.post-title-lg {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.22;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.featured-img-lg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 28rem;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 0 1.75rem;
}

.post-body-content {
    font-size: 1.0625rem;
    line-height: 1.78;
    color: var(--text-main);
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.post-body-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.85rem;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

.post-body-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

.post-body-content p {
    margin-bottom: 1.25rem;
}

.post-body-content ul,
.post-body-content ol {
    margin: 0 0 1.25rem 1.25rem;
}

.post-body-content li {
    margin-bottom: 0.4rem;
}

.post-body-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem auto;
}

.post-body-content blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    font-style: italic;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--primary-color) 6%, var(--card-bg));
    border-radius: 0 10px 10px 0;
}

.post-body-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    margin: 1.25rem 0;
    font-size: 0.85rem;
}

.post-body-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.post-body-content iframe,
.post-body-content video {
    max-width: 100%;
    border-radius: 10px;
}

.back-nav {
    margin-bottom: 1.25rem;
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.btn-back-link:hover {
    color: var(--primary-color);
}

.post-share-block {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-share-block h4 {
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    transition: transform 0.15s, opacity 0.15s;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.share-btn:active {
    transform: scale(0.98);
}

.share-whatsapp { background: #25D366; }
.share-twitter { background: #0f172a; }
.share-linkedin { background: #0A66C2; }
.share-facebook { background: #1877F2; }
.share-copy { background: #64748b; }

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--primary-color);
    z-index: 110;
    pointer-events: none;
    transition: width 0.12s ease-out;
}

/* Comments */
.comments-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.comments-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.comment-item {
    background: color-mix(in srgb, var(--bg-color) 70%, var(--card-bg));
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.85rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}

.comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.comment-meta { font-size: 0.8125rem; }
.comment-name { font-weight: 600; color: var(--text-main); }
.comment-date { color: var(--text-muted); font-size: 0.75rem; }
.comment-text {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.9375rem;
    opacity: 0.92;
}

.comment-reply {
    margin-left: 0.75rem;
    margin-top: 0.65rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border-color);
}

.comment-form {
    margin-top: 1.5rem;
    background: color-mix(in srgb, var(--bg-color) 70%, var(--card-bg));
    padding: 1.125rem;
    border-radius: 12px;
}

.comment-form h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-main);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.comment-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    min-height: 44px;
    width: 100%;
}

.comment-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.comment-msg {
    margin-top: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
}

.comment-msg.is-visible { display: block; }
.comment-msg.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.comment-msg.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.comment-antispam {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.comment-antispam label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.legal-consent-label {
    font-size: 0.8rem !important;
}

.hp-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ── Tablet / desktop enhancements ──────────────────────────────── */

@media (min-width: 769px) {
    .share-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .share-btn {
        width: auto;
        padding: 0.5rem 1rem;
        min-height: auto;
    }

    .comment-submit {
        width: auto;
    }
}

/* ── Mobile: immersive reading ────────────────────────────────── */

@media (max-width: 768px) {
    .post-page.container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .single-wrapper {
        margin: 0;
        padding: 1rem 1.125rem 2rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        max-width: 100%;
    }

    .post-header-area {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .post-meta-badges {
        font-size: 0.75rem;
        gap: 0.35rem 0.65rem;
    }

    .post-title-lg {
        font-size: clamp(1.45rem, 6.5vw, 1.85rem);
        line-height: 1.28;
    }

    .featured-img-lg {
        margin-left: -1.125rem;
        margin-right: -1.125rem;
        width: calc(100% + 2.25rem);
        max-width: none;
        border-radius: 0;
        margin-bottom: 1.25rem;
    }

    .post-body-content {
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .post-body-content h2 {
        font-size: 1.25rem;
        margin-top: 1.75rem;
    }

    .post-body-content h3 {
        font-size: 1.1rem;
    }

    .post-body-content p {
        margin-bottom: 1.1rem;
    }

    .post-share-block {
        margin-top: 2rem;
        padding-top: 1.25rem;
    }

    .comments-section {
        margin-top: 2rem;
    }

    .comment-form-grid,
    .comment-antispam {
        grid-template-columns: 1fr;
    }

    .comment-reply {
        margin-left: 0.5rem;
    }
}

@media (max-width: 380px) {
    .single-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .featured-img-lg {
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .single-wrapper {
            padding-bottom: max(2rem, env(safe-area-inset-bottom));
        }
    }
}