/* Common Widget Styles */
.td-widget {
    margin-bottom: 20px;
}

/* Related Posts Widget */
.td-related-posts-widget {
    margin: 0;
    padding: 0;
}
.td-related-post {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
    align-items: center;
}
.td-related-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.td-post-thumb {
    flex: 0 0 80px;
    margin-right: 15px;
    position: relative;
    padding-bottom: 80px;
    width: 80px;
    overflow: hidden;
}
.td-post-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}
.td-post-thumb:hover img {
    transform: scale(1.05);
}
.td-related-post-content {
    flex: 1;
    min-width: 0;
}
.td-related-post-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}
.td-related-post-title a {
    color: #222;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.td-related-post-title a:hover {
    color: #4db2ec;
}

/* Table of Contents Widget */
.td-toc-widget {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}
.td-toc-toggle {
    width: 100%;
    padding: 10px 15px;
    background: #4db2ec;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-align: left;
    position: relative;
    transition: background 0.3s ease;
}
.td-toc-toggle:hover {
    background: #3a9ad9;
}
.td-toc-toggle:after {
    content: '+';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    transition: transform 0.3s ease;
}
.td-toc-toggle.active:after {
    transform: translateY(-50%) rotate(45deg);
}
.td-toc-content {
    margin-top: 15px;
}
.td-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.td-toc-item {
    margin: 5px 0;
    line-height: 1.4;
}
.td-toc-item a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: all 0.3s ease;
}
.td-toc-item a:hover {
    color: #4db2ec;
    padding-left: 5px;
}
.td-toc-level-2 { padding-left: 0; }
.td-toc-level-3 { padding-left: 15px; }
.td-toc-level-4 { padding-left: 30px; }

/* Category Cloud Widget */
.td-category-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
}
.td-category-link {
    display: inline-block;
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}
.td-category-link:hover {
    background: #4db2ec;
    color: #fff;
}

/* Newsletter Widget */
.td-newsletter-widget {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}
.td-newsletter-widget p {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.5;
}
.td-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.td-newsletter-form input[type="email"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.td-newsletter-form button {
    padding: 10px;
    background: #4db2ec;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}
.td-newsletter-form button:hover {
    background: #3a9ad9;
}

/* Social Media Widget */
.td-social-media-widget {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}
.td-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: transform 0.3s ease;
}
.td-social-link:hover {
    transform: scale(1.1);
}
.td-social-link.facebook { background: #3b5998; }
.td-social-link.twitter { background: #1da1f2; }
.td-social-link.youtube { background: #ff0000; }
.td-social-link.linkedin { background: #0077b5; }

/* Responsive styles */
@media screen and (max-width: 767px) {
    .td-post-thumb {
        flex: 0 0 60px;
        padding-bottom: 60px;
        width: 60px;
    }
    .td-related-post-title {
        font-size: 13px;
    }
    .td-toc-widget {
        padding: 10px;
    }
    .td-toc-item {
        font-size: 13px;
    }
    .td-toc-toggle {
        padding: 8px 12px;
        font-size: 14px;
    }
}
@media screen and (max-width: 480px) {
    .td-post-thumb {
        flex: 0 0 50px;
        padding-bottom: 50px;
        width: 50px;
        margin-right: 10px;
    }
    .td-related-post-title {
        font-size: 12px;
    }
    .td-toc-item {
        font-size: 12px;
    }
    .td-toc-level-3 { padding-left: 10px; }
    .td-toc-level-4 { padding-left: 20px; }
    .td-toc-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    .td-social-media-widget {
        justify-content: center;
        gap: 10px;
    }
}
