/**
 * Single Post Sidebar Styles
 * 
 * Sticky sidebar with TOC, WYSIWYG content, and social links.
 */

/* ===== Sidebar Accordion (CSS-only) ===== */
.sidebar-accordion-checkbox {
    display: none; /* Hide the checkbox */
}


.accordion-title {
    font-size: 1rem;
    font-weight: 600;
}

.accordion-arrow {
    transition: transform 0.3s ease;
}

.sidebar-accordion-content {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0 var(--spacing-lg);
    margin-top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}


.sidebar-accordion-checkbox:checked + .sidebar-accordion-toggle + .sidebar-accordion-content {
    max-height: 1000px;
    padding: var(--spacing-lg);
    opacity: 1;
}

/* ===== Sidebar ===== */
.single-sidebar {
    position: static; /* Mobile: static positioning */
    top: auto;
    height: fit-content;
    z-index: 100;
}

.single-sidebar__content {
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-out;
}

.single-sidebar__section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid #e2e8f0;
}

.single-sidebar__section--share {
    display: none;
}

.single-sidebar__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.single-sidebar__section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
    border-bottom: none;
    padding-bottom: 0;
}

.single-sidebar__section p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0;
}


/* ===== WYSIWYG Content ===== */
.single-sidebar__wysiwyg {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-light);
}

.single-sidebar__wysiwyg p {
    margin: 0 0 var(--spacing-sm) 0;
}

.single-sidebar__wysiwyg ul,
.single-sidebar__wysiwyg ol {
    margin: 0 0 var(--spacing-sm) var(--spacing-sm);
    padding: 0;
}

.single-sidebar__wysiwyg li {
    margin-bottom: 4px;
}

.single-sidebar__wysiwyg strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* ===== Share Buttons ===== */
.single-sidebar__share {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.single-sidebar__share-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.3s ease;
}

.share-btn i {
    width: 16px;
    text-align: center;
}

.single-sidebar__share-btn--facebook,
.single-sidebar__share-btn--twitter {
    background: transparent;
    color: transparent;
    border: 1px solid #e5e7eb;
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.single-sidebar__share-btn--facebook:hover,
.single-sidebar__share-btn--twitter:hover {
    background: transparent;
    color: transparent;
    transform: scale(1.1);
    border-color: #d1d5db;
}

.single-sidebar__share-btn--facebook img,
.single-sidebar__share-btn--twitter img {
    width: 24px;
    height: 24px;
    margin: 0;
}

.single-sidebar__share-btn--linkedin {
    background: #0077b5;
    color: white;
}

.single-sidebar__share-btn--linkedin:hover {
    background: #006ba1;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.single-sidebar__share-btn--instagram:hover {
    opacity: 0.9;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--youtube {
    background: #ff0000;
    color: white;
}

.single-sidebar__share-btn--youtube:hover {
    background: #e60000;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--tiktok {
    background: #000000;
    color: white;
}

.single-sidebar__share-btn--tiktok:hover {
    background: #333333;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--pinterest {
    background: #bd081c;
    color: white;
}

.single-sidebar__share-btn--pinterest:hover {
    background: #a0071a;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--reddit {
    background: #ff4500;
    color: white;
}

.single-sidebar__share-btn--reddit:hover {
    background: #e63e00;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--github {
    background: #333333;
    color: white;
}

.single-sidebar__share-btn--github:hover {
    background: #555555;
    color: white;
    transform: translateY(-1px);
}

.single-sidebar__share-btn--discord {
    background: #5865f2;
    color: white;
}

.single-sidebar__share-btn--discord:hover {
    background: #4752c4;
    color: white;
    transform: translateY(-1px);
}

/* ===== Responsive Breakpoints - Mobile First ===== */


.sidebar-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.single-sidebar__content {
    margin-top: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.single-sidebar {
    position: static;
    top: auto;
    margin-top: var(--spacing-lg);
}


/* Large desktop (1200px+) */
@media (min-width: 1200px) {
    .sidebar-accordion-checkbox {
        display: none;
    }
    
    .sidebar-accordion-content {
        max-height: none !important;
        padding: var(--spacing-lg) !important;
        opacity: 1 !important;
    }
    
    .single-sidebar__content {
        margin-top: 75px;
        background: var(--bg-light);
        border: 1px solid var(--border-light);
        border-radius: 12px;
        padding: var(--spacing-lg);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .single-sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
        z-index: 100;
    }
}

/* Desktop (992px+) - Sidebar becomes sticky with smooth scrolling */
@media (min-width: 992px) {
    .single-sidebar {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        transition: transform 0.3s ease-out, top 0.3s ease-out;
        z-index: 1000;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .single-sidebar__content {
        scroll-snap-type: y proximity;
    }
}

@media (min-width: 1400px) {
    .single-sidebar__content {
        margin-top: 80px;
    }
}

