/* Single Post Styles */

/* Enhanced Table of Contents Styles */
#table-of-contents {
    position: relative;
}

#toc-toggle {
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    padding: 0;
}

#toc-toggle:hover {
    background-color: rgba(30, 41, 59, 0.05);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: -0.5rem;
}

#toc-toggle:focus {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

#toc-list {
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    transform-origin: top;
}

#toc-list.hidden {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
}

#toc-list:not(.hidden) {
    max-height: 1000px;
    opacity: 1;
    transform: scaleY(1);
}

#toc-arrow {
    transition: transform 0.3s ease-in-out;
}

/* TOC Link hover effects */
#toc-list a {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

#toc-list a:hover {
    background-color: rgba(30, 41, 59, 0.1);
    transform: translateX(4px);
    padding-left: 1rem;
}

#toc-list a:focus {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
    background-color: rgba(30, 41, 59, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #table-of-contents {
        position: sticky;
        top: 1rem;
        z-index: 10;
        margin-bottom: 1.5rem;
    }
    
    #toc-toggle {
        font-size: 1rem;
    }
    
    #toc-list a {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
}

/* Utility classes for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Enhanced prose styles for affiliate content */
.prose {
    color: #374151;
    line-height: 1.7;
}

.prose h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.prose h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: #1e293b;
    text-decoration: underline;
    text-decoration-color: rgba(30, 41, 59, 0.3);
    text-underline-offset: 0.2em;
    transition: all 0.2s ease;
}

.prose a:hover {
    color: #0f172a;
    text-decoration-color: #0f172a;
}

.prose blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
}

.prose img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prose th, .prose td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.prose th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Affiliate box styles */
.affiliate-box {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 2px solid #1e293b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.affiliate-button {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.affiliate-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
