/* ── Single Post Layout ───────────────────────── */
.sp-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 5px 60px;
}
@media (min-width: 768px) {
    .sp-wrap {
        padding: 24px 16px 60px;
    }
}

/* Hero: image + info side by side */
.sp-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.sp-hero-img {
    flex: 0 0 140px;
    width: 140px;
    min-height: 210px;
}
@media (min-width: 768px) {
    .sp-hero-img {
        flex: 0 0 200px;
        width: 200px;
        min-height: 300px;
    }
}
.sp-hero-img img {
    width: 100%;
    border-radius: 10px;
    display: block;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #e2e8f0;
}
.sp-hero-info {
    flex: 1;
    min-width: 0;
}
.sp-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--theme-secondary, #0e7490);
    color: #fff;
    margin-bottom: 10px;
}
.sp-title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.3;
    color: #1e293b;
    margin: 0 0 10px;
    word-break: break-word;
}
@media (min-width: 768px) {
    .sp-title { font-size: 2.1rem; }
}
@media (max-width: 500px) {
    .sp-hero {
        gap: 14px;
    }
    .sp-hero-img {
        flex: 0 0 100px;
        width: 100px;
        min-height: 150px;
    }
    .sp-title { font-size: 1.55rem; font-weight: 800; }
    .sp-content h2 { font-size: 1.2rem; }
    .sp-meta-row { font-size: 0.62rem; gap: 3px 6px; }
    .sp-meta-row a, .sp-meta-item, .sp-meta-item i { font-size: 0.62rem; }
    .sp-category-badge { font-size: 0.58rem; padding: 2px 7px; margin-bottom: 4px; }
}
.sp-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 6px;
}
.sp-meta-row a {
    color: var(--theme-secondary, #0e7490);
    font-weight: 600;
    text-decoration: none;
}
.sp-meta-row a:hover { text-decoration: underline; }
.sp-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Action Buttons ───────────────────────────── */
.sp-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 20px;
}
.sp-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 0;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
    border: none;
    cursor: pointer;
}
@media (max-width: 500px) {
    .sp-btn {
        padding: 11px 0 !important;
        font-size: 0.94rem !important;
        gap: 4px !important;
    }
}
.sp-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.sp-btn-read {
    background: var(--theme-secondary, #0e7490);
    color: #fff;
}
.sp-btn-dl {
    background: #f1f5f9;
    color: #1e293b;
    border: 1.5px solid #e2e8f0;
}
.sp-btn-dl.is-downloading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
    background: #f8fafc !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}
.sp-btn-dl.is-downloading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: var(--download-progress, 0%);
    height: 3px;
    background-color: var(--theme-secondary);
    transition: width 0.1s ease-out;
}

/* ── Specs Table ──────────────────────────────── */
.sp-table-wrap {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.sp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.sp-table tr:nth-child(even) { background: #f8fafc; }
.sp-table tr:nth-child(odd)  { background: #fff; }
.sp-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
.sp-table tr:last-child td { border-bottom: none; }
.sp-table td:first-child {
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    width: 36%;
}
.sp-table td:last-child {
    color: #1e293b;
}

/* ── Content Area ─────────────────────────────── */
.sp-content {
    font-size: 0.97rem;
    line-height: 1.85;
    color: #334155;
    margin-bottom: 32px;
    word-break: break-word;
}
.sp-content p  { margin-bottom: 1em; }
.sp-content h2 { font-size: 1.2rem; font-weight: 700; margin: 1.5em 0 0.5em; color: #1e293b; }
.sp-content h3 { font-size: 1.05rem; font-weight: 700; margin: 1.2em 0 0.4em; color: #1e293b; }
.sp-content img { max-width: 100%; border-radius: 8px; }

/* ── Share Row ────────────────────────────────── */
.sp-share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.sp-share-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.sp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.15s;
}
.sp-share-btn:hover { transform: scale(1.12); }
.sp-share-fb { background: #1877f2; color: #fff; }
.sp-share-wa { background: #25d366; color: #fff; }
.sp-share-li { background: #0a66c2; color: #fff; }

/* ── Comments ─────────────────────────────────── */
.sp-comments-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-author-heading {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
.sp-comment-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.sp-comment-node {
    display: flex;
    gap: 10px;
    position: relative;
}
.sp-comment-avatar-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    position: relative;
    z-index: 2;
}
.sp-comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.guest-letter-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.sp-comment-content {
    flex-grow: 1;
    min-width: 0;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 8px 12px;
    position: relative;
}
.sp-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 6px;
}
.sp-comment-author-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sp-comment-author-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
}
.sp-comment-badge-admin {
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}
.sp-comment-date {
    font-size: 0.7rem;
    color: #94a3b8;
}
.sp-comment-text {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
}
.sp-comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 0.74rem;
}
.sp-comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--theme-secondary, #0e7490);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.15s;
}
.sp-comment-action-btn:hover {
    opacity: 0.8;
}

/* Replies styling */
.sp-comment-replies-list {
    margin-left: 18px;
    padding-left: 18px;
    border-left: 2px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
@media (max-width: 640px) {
    .sp-comment-replies-list {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* Inline Reply form */
.sp-reply-form-wrap {
    margin-top: 10px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* ── Comment Form ─────────────────────────────── */
.sp-form-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    margin: 32px 0 16px;
}
.sp-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
@media (min-width: 640px) {
    .sp-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.sp-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}
.sp-field input,
.sp-field textarea {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.sp-field input:focus,
.sp-field textarea:focus {
    border-color: var(--theme-secondary, #0e7490);
}
.sp-field textarea { resize: vertical; min-height: 100px; }
.sp-submit {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 10px;
    background: var(--theme-secondary, #0e7490);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.sp-submit:hover { opacity: 0.88; }

/* ── Alerts ───────────────────────────────────── */
.sp-alert {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-alert-ok   { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.sp-alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.sp-alert-err  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 500px) {
    .sp-form-grid { grid-template-columns: 1fr; }
}
/* ── Writer Info Card ─────────────────────────── */
.sp-author-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    margin: 24px 0;
}
.sp-author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--theme-secondary);
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--theme-secondary);
}
.sp-author-details {
    flex-grow: 1;
}
.sp-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 4px;
    display: inline-block;
    text-decoration: none;
    transition: color 0.15s;
}
.sp-author-name:hover {
    color: var(--theme-secondary);
}
.sp-author-bio {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}
.sp-buy-now-btn {
    background: var(--theme-secondary, #0e7490);
    color: #fff;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 0.98rem;
    font-weight: 700;
    border-radius: 8px;
    width: 100%;
    max-width: 250px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
    transition: opacity 0.15s, transform 0.15s;
    cursor: pointer;
}
.sp-buy-now-btn:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}
@media (max-width: 500px) {
    .sp-buy-now-btn {
        max-width: 100% !important;
        width: 100% !important;
        padding: 8px 0 !important;
        font-size: 0.88rem !important;
        letter-spacing: -0.03em !important;
        white-space: nowrap !important;
        gap: 4px !important;
    }
}
