/* ============================================
   SINGLE ARTICLE TEMPLATE STYLES
   Extracted from gamekb-style.css
============================================ */

/* Single Article Layout */
.gamekb-single-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
    width: 100%;
}

.gamekb-article-header {
    margin-bottom: 30px;
}

/* ARTICLE TITLE & META LAYOUT */
.gamekb-single-article .entry-content {
    font-size: 16px;
    line-height: 1.6;
}

.gamekb-single-article .entry-content p {
    margin: 0 0 1em 0;
}

/* Headings spacing */
.gamekb-single-article .entry-content h2 {
    margin: 2em 0 0.75em 0;
}

.gamekb-single-article .entry-content h3 {
    margin: 1.75em 0 0.5em 0;
}

.gamekb-single-article .entry-content h4 {
    margin: 1.5em 0 0.5em 0;
}

/* List spacing */
.gamekb-single-article .entry-content ul,
.gamekb-single-article .entry-content ol {
    margin: 0 0 1.5em 1.5em;
}

.gamekb-single-article .entry-content li {
    margin-bottom: 0.5em;
}

/* Blockquote spacing */
.gamekb-single-article .entry-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
}

/* Image spacing */
.gamekb-single-article .entry-content figure {
    margin: 1.5em 0;
}

.gamekb-single-article .gamekb-article-header .entry-title {
    font-size: var(--article-title-size, 36px);
    line-height: 1.2;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Article Meta Container */
.gamekb-article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #332f2f;
}

/* Update Date Styling */
.gamekb-update-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* View Count Styling */
.view-count-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-count-number {
    transition: all 0.3s ease;
}

.view-count-number.updating {
    color: #4CAF50;
    transform: scale(1.1);
}

.view-count-label {
    color: #666;
}

/* Title Size Customization Classes */
.gamekb-single-article .gamekb-article.gamekb-title-small .gamekb-article-header .entry-title {
    --article-title-size: 28px;
}

.gamekb-single-article .gamekb-article.gamekb-title-medium .gamekb-article-header .entry-title {
    --article-title-size: 36px;
}

.gamekb-single-article .gamekb-article.gamekb-title-large .gamekb-article-header .entry-title {
    --article-title-size: 48px;
}

/* Inline style support for direct px customization */
.gamekb-title-custom .entry-title {
    font-size: inherit;
}

/* ARTICLE LAYOUT GRID */
.gamekb-article-layout {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 40px;
}

/* Ensure article-bottom stays within main content column */
.gamekb-article-content-wrapper {
    display: flex;
    flex-direction: column;
}

/* Bottom navigation should match main content width */
.gamekb-article-bottom {
    width: 100%;
}

/* Article Navigation */
.gamekb-article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #eee;
    border-bottom: 2px solid #eee;
    width: 100%;
    align-items: start; /* Changed from center to start for better text alignment */
}

/* Navigation items container - Fixed alignment */
.gamekb-nav-prev {
    grid-column: 1;
    justify-self: start; /* Align to left */
    text-align: left;
    display: flex;
    flex-direction: column;
}

.gamekb-nav-next {
    grid-column: 2;
    justify-self: end; /* Align to right */
    text-align: right;
    display: flex;
    flex-direction: column;
}

/* Navigation labels and links styling */
.gamekb-nav-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin: 0 0 0 0; /* Fixed spacing */
    line-height: 1.3;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gamekb-nav-link {
    font-size: 1em;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    margin: 0; /* Reset margin */
    transition: color 0.2s ease;
    max-width: 100%;
    word-wrap: break-word;
}

.gamekb-nav-link:hover {
    text-decoration: underline;
    color: #005a87;
}

/* Ensure proper spacing for empty states */
.gamekb-nav-prev:only-child {
    grid-column: 1 / span 2;
    text-align: center;
}

.gamekb-nav-next:only-child {
    grid-column: 1 / span 2;
    text-align: center;
}

/* Optional: Add arrows for better visual indication */
.gamekb-nav-prev .gamekb-nav-label::before {
    content: "← ";
    margin-right: 5px;
}

.gamekb-nav-next .gamekb-nav-label::after {
    content: " →";
    margin-left: 5px;
}

/* Ensure both nav items have equal internal spacing */
.gamekb-nav-prev .gamekb-nav-link,
.gamekb-nav-next .gamekb-nav-link {
    margin-top: 8px;
}

/* Promotion Block */
.gamekb-promotion-block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Promotion Block - Desktop layout */
.gamekb-promotion-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Promotion Block Image - Desktop version */
.gamekb-promotion-image {
    flex: 0 0 160px;
    margin-left: 20px;
    order: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

.gamekb-promotion-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

/* Hover effect - picture shrinks slightly */
.gamekb-promotion-image:hover img {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.gamekb-promotion-text {
    flex: 1;
    min-width: 0;
    order: 1;
}

/* Optional: Add a subtle shine effect on the image */
.gamekb-promotion-image {
    position: relative;
    overflow: hidden;
}

.gamekb-promotion-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.gamekb-promotion-image:hover::after {
    left: 100%;
}

.gamekb-promotion-title {
    margin-top: 0;
    font-size: 1.5em;
    color: white;
}

.gamekb-promotion-button {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.gamekb-promotion-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Adjacent Articles Styling */
.gamekb-card-footer-post {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-top: 3rem;
}

.gamekb-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -1rem;
}

.gamekb-col {
    padding: 0 1rem;
    box-sizing: border-box;
}

.gamekb-col-2 {
    width: 50%;
}

.gamekb-prev-post,
.gamekb-next-post {
    padding: 1.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
}

.gamekb-prev-post:hover,
.gamekb-next-post:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gamekb-prev-post {
    text-align: left;
}

.gamekb-next-post {
    text-align: right;
}

.gamekb-adjacent-title {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gamekb-prev-post h4,
.gamekb-next-post h4 {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
}

.gamekb-prev-post h4 a,
.gamekb-next-post h4 a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gamekb-prev-post h4 a:hover,
.gamekb-next-post h4 a:hover {
    color: #007cba;
}

/* ============================================
   BREADCRUMBS STYLES
============================================ */
.gamekb-breadcrumbs-container {
    margin: 20px 0 30px 0;
}

.gamekb-breadcrumbs {
    font-size: 14px;
    color: #666;
}

.gamekb-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gamekb-breadcrumbs-item {
    display: flex;
    align-items: center;
}

.gamekb-breadcrumbs-item a {
    color: #0366d6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gamekb-breadcrumbs-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.gamekb-breadcrumbs-item span {
    color: #24292f;
}

.gamekb-breadcrumbs-separator {
    margin: 0 10px;
    color: #8b949e;
}

/* ============================================
   TABLE OF CONTENTS STYLES (Single Article Only)
============================================ */
.gamekb-table-of-contents {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 11px;
    margin: 0 0 25px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #178b23;
    position: relative;
    overflow: hidden;
}

/* Title Styling - Compact */
.gamekb-toc-title {
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-bottom: 1px solid rgba(93, 125, 168, 0.15);
    position: relative;
    z-index: 1;
    letter-spacing: -0.2px;
}

/* Compact TOC List */
.gamekb-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
    z-index: 1;
}

/* Compact TOC Items */
.gamekb-toc-item {
    margin: 0 0 6px 0;
    padding: 0;
    transition: all 0.2s ease;
    border-radius: 6px;
}

/* All TOC Links - Compact */
.gamekb-toc-list a {
    display: block;
    padding: 10px 14px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: rgba(252, 251, 251, 0.836);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    position: relative;
    font-size: 0.95rem;
}

/* Compact Hover effect */
.gamekb-toc-list a:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #ec8e0b;
    border-color: #e3e8f0;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.1);
    border-left: 3px solid #c40606;
}

/* Active/Current TOC Item */
.gamekb-toc-item.active a,
.gamekb-toc-item.current a {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #be2fe6;
    box-shadow: 0 2px 6px rgba(56, 166, 107, 0.2);
}

/* Hierarchical Levels - Compact */
.gamekb-toc-level-2 a {
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 14px;
    margin-bottom: 4px;
}

.gamekb-toc-level-3 a {
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 14px 8px 26px;
    margin-left: 12px;
    margin-top: 2px;
    margin-bottom: 4px;
    background: rgba(248, 249, 250, 0.9);
    border-left: 2px solid #dfe6ec;
}

.gamekb-toc-level-4 a {
    font-size: 0.88rem;
    font-weight: 400;
    padding: 6px 14px 6px 38px;
    margin-left: 24px;
    margin-top: 2px;
    margin-bottom: 3px;
    background: rgba(245, 247, 250, 0.9);
    border-left: 1px solid #e8ecef;
}

.gamekb-toc-level-5 a,
.gamekb-toc-level-6 a {
    font-size: 0.85rem;
    padding: 5px 14px 5px 50px;
    margin-left: 36px;
    margin-top: 1px;
    margin-bottom: 2px;
    background: rgba(242, 245, 248, 0.9);
    border-left: 1px solid #eef1f4;
}

/* Visual indicators for hierarchy - Compact */
.gamekb-toc-level-2 a::before {
    content: "•";
    color: #5d7da8;
    font-weight: bold;
    margin-right: 8px;
    font-size: 1.1em;
}

.gamekb-toc-level-3 a::before {
    content: "›";
    color: #7d98ba;
    margin-right: 6px;
    font-size: 1em;
    margin-left: -6px;
}

.gamekb-toc-level-4 a::before {
    content: "»";
    color: #9cb2cf;
    margin-right: 6px;
    font-size: 0.9em;
    margin-left: -6px;
}

/* Ultra-Compact option */
.gamekb-toc-ultra-compact .gamekb-table-of-contents {
    padding: 14px 16px;
    margin: 15px 0 20px 0;
}

.gamekb-toc-ultra-compact .gamekb-toc-title {
    font-size: 1.1rem;
    padding-bottom: 8px;
}

.gamekb-toc-ultra-compact .gamekb-toc-list a {
    background: #f2f2f5;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.3;
}

.gamekb-toc-ultra-compact .gamekb-toc-level-3 a {
    padding: 6px 12px 6px 22px;
    margin-left: 10px;
}

.gamekb-toc-ultra-compact .gamekb-toc-level-4 a {
    padding: 5px 12px 5px 32px;
    margin-left: 20px;
}

/* Minimalist option */
.gamekb-toc-minimalist .gamekb-table-of-contents {
    background: #ffffff;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 15px 18px;
}

.gamekb-toc-minimalist .gamekb-toc-list a {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 7px 12px;
}

.gamekb-toc-minimalist .gamekb-toc-list a:hover {
    background: #f8f9fa;
    transform: none;
    border-left: 2px solid #db3463;
}

/* ============================================
   RESPONSIVE STYLES FOR SINGLE ARTICLE
============================================ */

/* Mobile and tablet (up to 1023px) */
@media (max-width: 1023px) {
    .gamekb-article-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .gamekb-article-sidebar {
        order: 2;
    }
    
    .gamekb-article-content-wrapper {
        order: 1;
    }
    
    .gamekb-promotion-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .gamekb-promotion-image {
        margin-left: 0;
        margin-top: 10px;
        flex: 0 0 auto;
        width: 120px;
        height: auto;
        order: 1;
    }
    
    .gamekb-promotion-image img {
        width: 100%;
        height: auto;
        max-height: 160px;
        object-fit: contain;
    }
    
    .gamekb-promotion-text {
        order: 2;
    }
    
    .gamekb-article-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .gamekb-article-header .entry-title {
        font-size: var(--article-title-size-mobile, 28px);
    }
    
    /* Table of Contents */
    .gamekb-table-of-contents {
        padding: 14px 16px;
        margin: 15px 0 20px 0;
        border-radius: 6px;
    }
    
    .gamekb-toc-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .gamekb-toc-list a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .gamekb-toc-level-3 a {
        padding-left: 22px;
        margin-left: 10px;
    }
    
    .gamekb-toc-level-4 a {
        padding-left: 32px;
        margin-left: 20px;
    }
    
    /* Article navigation */
    .gamekb-article-navigation {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 0;
        margin: 30px 0;
    }
    
    .gamekb-nav-prev,
    .gamekb-nav-next {
        grid-column: 1;
        justify-self: center;
        text-align: center;
        width: 100%;
    }
    
    .gamekb-nav-next {
        text-align: center;
    }
    
    /* Remove arrows on mobile for simplicity */
    .gamekb-nav-prev .gamekb-nav-label::before,
    .gamekb-nav-next .gamekb-nav-label::after {
        content: "";
        margin: 0;
    }
    
    /* Add visual separator between items on mobile */
    .gamekb-nav-prev:not(:last-child) {
        padding-bottom: 25px;
        border-bottom: 1px solid #eee;
    }
    
    /* Breadcrumbs */
    .gamekb-breadcrumbs {
        font-size: 13px;
    }
    
    .gamekb-breadcrumbs-separator {
        margin: 0 6px;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .gamekb-promotion-content {
        flex-direction: row;
        text-align: left;
        gap: 30px;
    }
    
    .gamekb-promotion-image {
        margin-left: 20px;
        flex: 0 0 160px;
        order: 2;
    }
    
    .gamekb-promotion-text {
        order: 1;
    }
    
    .gamekb-promotion-image img {
        max-height: 200px;
        object-fit: contain;
    }
}

/* Small mobile (480px and down) */
@media (max-width: 480px) {
    .gamekb-single-article {
        padding: 10px;
    }
    
    .gamekb-article-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Article Header */
    .gamekb-article-header .entry-title {
        font-size: 24px;
        line-height: 1.3;
    }
    
    .gamekb-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }
    
    /* Content Spacing */
    .gamekb-single-article .entry-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .gamekb-single-article .entry-content p {
        margin-bottom: 0.8em;
    }
    
    /* Table of Contents */
    .gamekb-table-of-contents {
        padding: 12px 14px;
    }
    
    .gamekb-toc-title {
        font-size: 1rem;
    }
    
    .gamekb-toc-list a {
        padding: 7px 10px;
        font-size: 0.85rem;
    }
    
    .gamekb-toc-level-3 a {
        padding-left: 20px;
    }
    
    .gamekb-toc-level-4 a {
        padding-left: 30px;
    }
    
    /* Article Navigation */
    .gamekb-article-navigation {
        gap: 10px;
        padding: 15px 0;
        margin: 15px 0;
    }
    
    .gamekb-nav-label {
        font-size: 0.85em;
        margin-bottom: 5px;
    }
    
    .gamekb-nav-link {
        font-size: 0.95em;
    }
    
    /* Promotion Block */
    .gamekb-promotion-block {
        padding: 20px !important;
    }
    
    .gamekb-promotion-content {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }
    
    .gamekb-promotion-image {
        margin-left: 0 !important;
        flex: 0 0 auto !important;
        width: 120px !important;
        height: auto !important;
        order: 1 !important;
        margin: 0 auto 15px !important;
    }

    .gamekb-promotion-image img {
        width: 100% !important;
        height: auto !important;
        max-height: 160px !important;
        object-fit: contain !important;
    }
    
    .gamekb-promotion-text {
        order: 2 !important;
    }
    
    .gamekb-promotion-title {
        font-size: 1.2em !important;
    }
    
    /* Increase spacing for touch */
    .gamekb-article-item {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
}