/**
 * File: _single-post.css
 * Purpose: New single post layout styles
 * Desktop: Two-column layout with article content + VNA/sources
 * Mobile: Stacked layout with toggle between article and perspectives
 */

/* ============================================
   DESKTOP LAYOUT (Two Columns)
   ============================================ */

/* Main container */
.single-post-container {
    width: 100%;
    padding: 20px;
    margin: 0 auto;
}

/* Desktop layout */
.single-post-container.desktop-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Left Column - Article Content */
.single-post-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Right Column - VNA + Sources */
.single-post-right-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Categories */
.single-post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.single-post-categories .category-pill {
    background-color: var(--primary-color, #d00000);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

/* Title */
.single-post-header {
    margin-bottom: 5px;
}

.single-post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-headings, #1a1a1a);
    margin: 0;
    font-family: 'Libre Baskerville', Georgia, serif;
}

/* Entry Meta: Author and Date */
.single-post-entry-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
}

.single-post-entry-meta .byline {
    font-weight: 500;
}

.single-post-entry-meta .posted-on time {
    color: var(--text-secondary, #666);
}

.single-post-entry-meta .byline a {
    color: var(--text-secondary, #666);
    text-decoration: none;
}

.single-post-entry-meta .byline a:hover {
    color: var(--primary-color, #d00000);
    text-decoration: underline;
}

/* Content */
.single-post-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-main, #333);
}

/* Article content styling - needs to match Perspectives text */
.vna-neutral-summary-content,
#article-content .vna-neutral-summary-content,
.mobile-content-section#article-content .vna-neutral-summary-content,
.mobile-content-section#article-content {
    font-size: 1.25rem !important;
    line-height: 1.8 !important;
    color: var(--text-main, #333) !important;
    font-family: inherit !important;
}

.vna-neutral-summary-content p {
    margin-bottom: 1em;
}

/* Thumbnail */
.single-post-thumbnail {
    width: 100%;
    margin: 10px 0 0 0;
}

/* Remove gap between thumbnail and content */
.single-post-thumbnail + .single-post-content {
    margin-top: 0;
}

.single-post-thumbnail + .mobile-content-section {
    margin-top: 0;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* VNA Perspectives Section */
.single-post-vna-perspectives {
    background-color: var(--background-light, #f9f9f9);
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 8px;
    padding: 20px;
}

.vna-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--text-headings, #1a1a1a);
    border-bottom: 2px solid var(--primary-color, #d00000);
    padding-bottom: 8px;
}

/* Bias Sources Section - Applied to bias bar plugin output */
.single-post-right-column .bbm-d-container,
.mobile-sources .bbm-d-container {
    /* Restore original bias bar styling - let plugin handle its own colors */
    border-radius: 8px;
    margin-top: 0;
}

/* Hide the plugin's own "Källor" heading */
.single-post-right-column .bbm-d-container h3,
.mobile-sources .bbm-d-container h3 {
    display: none;
}

.bias-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--text-headings, #1a1a1a);
    border-bottom: 2px solid var(--primary-color, #d00000);
    padding-bottom: 8px;
}

/* ============================================
   MOBILE LAYOUT
   ============================================ */

/* Mobile layout - hidden by default */
.single-post-container.mobile-layout {
    display: none !important;
    flex-direction: column;
    gap: 20px;
}

/* Mobile Toggle Buttons */
.mobile-content-toggle {
    display: flex;
    background-color: var(--background-light, #f0f0f0);
    border-radius: 8px;
    padding: 4px;
    margin: 20px 0;
    border: 1px solid var(--border-light, #e0e0e0);
}

.toggle-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-main, #333);
}

.toggle-btn.active {
    background-color: var(--primary-color, #d00000);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-btn:hover {
    background-color: var(--primary-color, #d00000);
    color: white;
}

/* Mobile Content Sections */
.mobile-content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.mobile-content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Sources */
.mobile-sources .bbm-d-container {
    margin-top: 30px;
}

/* VNA Perspectives Mobile Fix */
.mobile-content-section .vna-perspectives-wrapper {
    display: block !important;
}

.mobile-content-section .vna-perspectives-wrapper.active {
    display: block !important;
}

/* Standardize text styling between Article and Perspectives */
/* Target the p tags created by wpautop() in VNA perspectives */
.mobile-content-section .vna-perspective-panel p {
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
    color: var(--text-main, #333) !important;
    margin-bottom: 1em !important;
    margin-top: 0 !important;
    font-family: inherit !important;
}

/* Also ensure the parent container has consistent styling */
.mobile-content-section .vna-perspective-panel {
    font-size: 1.1rem !important;
    line-height: 1.7 !important;
    color: var(--text-main, #333) !important;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Hide mobile layout on desktop */
@media (min-width: 768px) {
    .single-post-container.mobile-layout {
        display: none !important;
    }
    
    .single-post-container.desktop-layout {
        display: grid !important;
    }
    
    .desktop-only {
        display: block;
    }
}

/* Hide desktop layout on mobile */
@media (max-width: 767px) {
    .single-post-container.desktop-layout {
        display: none !important;
    }
    
    .single-post-container.mobile-layout {
        display: flex !important;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* Mobile specific adjustments */
    .single-post-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .single-post-entry-meta {
        font-size: 0.85rem;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .single-post-content,
    .vna-neutral-summary-content,
    #article-content .vna-neutral-summary-content,
    .mobile-content-section#article-content {
        font-size: 1.25rem !important;
        line-height: 1.8 !important;
    }
    
    .single-post-thumbnail {
        margin: 5px 0 0 0;
    }
    
    /* Reduce excessive mobile spacing */
    .single-post-categories {
        margin-bottom: 5px;
        margin-top: 0 !important;
    }
    
    .single-post-header {
        margin-bottom: 3px;
    }
    
    .single-post-container.mobile-layout {
        gap: 15px;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    .mobile-content-toggle {
        margin: 15px 0;
    }

    .single-post-thumbnail + .single-post-content {
        margin-top: 0;
    }
    
    .single-post-vna-perspectives {
        padding: 15px;
    }
    
    .single-post-right-column .bbm-d-container,
    .mobile-sources .bbm-d-container {
        /* Let plugin handle its own padding on mobile */
    }
    
    .vna-section-title,
    .bias-section-title {
        font-size: 1.2rem;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

.dark-mode .single-post-title {
    color: var(--dark-text-color, #eee);
}

.dark-mode .single-post-content,
.dark-mode .vna-neutral-summary-content,
.dark-mode #article-content .vna-neutral-summary-content,
.dark-mode .mobile-content-section#article-content {
    color: var(--dark-text-color, #eee) !important;
}

.dark-mode .single-post-vna-perspectives {
    background-color: var(--dark-background-light, #222);
    border-color: var(--dark-border, #444);
}

.dark-mode .single-post-right-column .bbm-d-container,
.dark-mode .mobile-sources .bbm-d-container {
    /* Let plugin handle its own dark mode colors */
}

.dark-mode .vna-section-title,
.dark-mode .bias-section-title {
    color: var(--dark-text-color, #eee);
}

.dark-mode .mobile-content-toggle {
    background-color: var(--dark-background-light, #222);
    border-color: var(--dark-border, #444);
}

.dark-mode .toggle-btn {
    color: var(--dark-text-color, #eee);
}

.dark-mode .toggle-btn.active {
    background-color: var(--primary-color, #d00000);
    color: white;
}

.dark-mode .category-pill {
    background-color: var(--primary-color, #d00000);
    color: white;
}

.dark-mode .single-post-entry-meta {
    color: var(--dark-text-secondary, #aaa);
}

.dark-mode .single-post-entry-meta .posted-on time {
    color: var(--dark-text-secondary, #aaa);
}

.dark-mode .single-post-entry-meta .byline a {
    color: var(--dark-text-secondary, #aaa);
}

.dark-mode .single-post-entry-meta .byline a:hover {
    color: var(--primary-color, #d00000);
}

.dark-mode .mobile-content-section .vna-perspective-panel,
.dark-mode .mobile-content-section .vna-perspective-panel p {
    color: var(--dark-text-color, #eee) !important;
}