/* ==========================================
   Webiko Blog - Single Post Styles
   Premium Magazine Design
   ========================================== */

:root {
    --single-max-width: 780px;
    --single-font-size: 18px;
    --single-line-height: 1.85;
}

/* Reading Progress Bar */
.webiko-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
    z-index: 9999;
}

.webiko-reading-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--webiko-primary, #6366f1) 0%, var(--webiko-secondary, #8b5cf6) 100%);
    transition: width 0.1s ease-out;
    border-radius: 0 2px 2px 0;
}

/* Single Layout */
.single-main {
    padding: 40px 0 80px;
    background: #f8fafc;
}

.single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.single-content-area {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.single-post-article {
    padding: 40px;
}

/* Breadcrumbs */
.webiko-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
}

.webiko-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.webiko-breadcrumbs a:hover {
    color: var(--webiko-primary, #6366f1);
}

.webiko-breadcrumbs .separator {
    color: #cbd5e1;
}

.webiko-breadcrumbs .current {
    color: #1e293b;
    font-weight: 500;
}

/* Hero Section */
.single-hero {
    margin-bottom: 32px;
}

.single-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--webiko-primary, #6366f1) 0%, var(--webiko-secondary, #8b5cf6) 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 100px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.single-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    margin: 0 0 24px;
    letter-spacing: -0.5px;
}

/* Meta Info */
.single-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-author img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.meta-author .author-name {
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
}

.meta-author .author-name:hover {
    color: var(--webiko-primary, #6366f1);
}

.meta-author .author-role {
    font-size: 12px;
    color: #94a3b8;
}

.meta-details {
    display: flex;
    align-items: center;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.meta-item svg {
    opacity: 0.6;
}

/* Featured Image */
.single-featured-image {
    margin: 0 -40px 32px;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    padding: 12px 40px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    background: #f8fafc;
}

/* Review Score Box */
.review-score-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid var(--webiko-primary, #6366f1);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.review-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.review-score {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.score-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--webiko-primary, #6366f1);
}

.score-max {
    font-size: 16px;
    color: #64748b;
}

.review-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 100px;
    overflow: hidden;
}

.review-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--webiko-primary, #6366f1) 0%, var(--webiko-secondary, #8b5cf6) 100%);
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* Content Typography */
.single-content {
    font-size: var(--single-font-size);
    line-height: var(--single-line-height);
    color: #334155;
}

.single-content p {
    margin-bottom: 1.5em;
}

.single-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 48px 0 20px;
    letter-spacing: -0.3px;
}

.single-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 36px 0 16px;
}

.single-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 28px 0 12px;
}

.single-content a {
    color: var(--webiko-primary, #6366f1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.single-content a:hover {
    color: var(--webiko-secondary, #8b5cf6);
}

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.single-content ul,
.single-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

.single-content li {
    margin-bottom: 8px;
}

.single-content blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-left: 4px solid var(--webiko-primary, #6366f1);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #475569;
}

.single-content blockquote p:last-child {
    margin-bottom: 0;
}

.single-content pre,
.single-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
}

.single-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
}

.single-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e11d48;
}

/* In-Content Ads */
.in-content-ad,
.after-content-ad {
    margin: 32px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    text-align: center;
}

/* Tags */
.single-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.tags-label {
    font-weight: 600;
    color: #64748b;
    font-size: 14px;
}

.tag-item {
    display: inline-block;
    padding: 6px 14px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-item:hover {
    background: var(--webiko-primary, #6366f1);
    color: #fff;
}

/* Share Buttons */
.single-share {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 12px;
}

.share-label {
    font-weight: 600;
    color: #64748b;
    font-size: 14px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
    color: #fff;
}

.share-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.share-linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
    color: #fff;
}

.share-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}

.share-copy:hover {
    background: var(--webiko-primary, #6366f1);
    border-color: var(--webiko-primary, #6366f1);
    color: #fff;
}

.share-copy.copied {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    margin: 40px 0;
}

.author-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-content {
    flex: 1;
}

.author-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.author-box .author-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.author-box .author-name a {
    color: #0f172a;
    text-decoration: none;
}

.author-box .author-name a:hover {
    color: var(--webiko-primary, #6366f1);
}

.author-title {
    font-size: 13px;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 100px;
}

.author-bio {
    color: #475569;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 16px;
}

.author-links {
    display: flex;
    gap: 12px;
}

.author-posts-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--webiko-primary, #6366f1);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.2s;
}

.author-posts-link:hover {
    background: var(--webiko-secondary, #8b5cf6);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Related Posts */
.related-posts {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.related-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

.related-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.related-image {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-item:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 16px;
}

.related-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--webiko-primary, #6366f1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.related-item-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.related-item-title a {
    color: #1e293b;
    text-decoration: none;
}

.related-item-title a:hover {
    color: var(--webiko-primary, #6366f1);
}

/* Sidebar */
.single-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
}

/* Mobile Share Bar */
.mobile-share-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    justify-content: center;
    gap: 12px;
    z-index: 1000;
}

.mobile-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.mobile-share-btn:hover,
.mobile-share-btn:active {
    background: var(--webiko-primary, #6366f1);
    color: #fff;
}

/* Comments */
.single-comments {
    margin-top: 48px;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 1024px) {
    .single-layout {
        grid-template-columns: 1fr;
    }

    .single-sidebar {
        display: none;
    }

    .mobile-share-bar {
        display: flex;
    }

    .single-main {
        padding-bottom: 100px;
    }
}

@media (max-width: 768px) {
    .single-post-article {
        padding: 24px;
    }

    .single-title {
        font-size: 26px;
    }

    .single-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-details {
        flex-wrap: wrap;
        gap: 12px;
    }

    .single-featured-image {
        margin: 0 -24px 24px;
    }

    .single-content {
        font-size: 16px;
    }

    .single-content h2 {
        font-size: 22px;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }

    .author-header {
        flex-direction: column;
        gap: 8px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .single-share {
        flex-direction: column;
        gap: 12px;
    }

    .share-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
}