/* Sidebar Custom Blocks Styles */

/* Block Container */
.sidebar-posts-block {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
}

/* Block Title */
.sidebar-block-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 5px solid #fdbf30;
    position: relative;
}

.sidebar-block-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40px;
    height: 3px;
}

/* Posts List */
.sidebar-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual Post Item */
.sidebar-post-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-post-item:hover {
    background: #f8f9fa;
    border-color: #e5e5e5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Post Thumbnail */
.sidebar-post-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.sidebar-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sidebar-post-item:hover .sidebar-post-thumb img {
    transform: scale(1.05);
}

/* Post Content */
.sidebar-post-content {
    flex: 1;
    min-width: 0;
}

/* Post Meta */
.sidebar-post-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Category Badge */
.sidebar-post-category {
    display: inline-block;
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    max-width: fit-content;
}

/* Category Colors - All Orange/Gold */
.sidebar-post-category.category-world,
.sidebar-post-category.category-domestic,
.sidebar-post-category.category-news,
.sidebar-post-category.category-currency {
    background: #fdbf30;
    color: #000;
}

/* Post Date */
.sidebar-post-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

/* Post Title */
.sidebar-post-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-post-title a:hover {
    color: #2c5aa0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar-posts-block {
        padding: 12px;
    }

    .sidebar-block-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding-bottom: 6px;
    }

    .sidebar-posts-list {
        gap: 8px;
    }

    .sidebar-post-item {
        padding: 6px;
        gap: 8px;
    }

    .sidebar-post-thumb {
        width: 90px;
        height: 60px;
    }

    .sidebar-post-title {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .sidebar-post-category {
        font-size: 9px;
        padding: 2px 5px;
    }

    .sidebar-post-date {
        font-size: 10px;
    }

    .sidebar-post-meta {
        gap: 2px;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .sidebar-posts-block {
        padding: 10px;
    }

    .sidebar-block-title {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .sidebar-posts-list {
        gap: 6px;
    }

    .sidebar-post-item {
        padding: 5px;
        gap: 6px;
    }

    .sidebar-post-thumb {
        width: 80px;
        height: 55px;
    }

    .sidebar-post-title {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .sidebar-post-meta {
        gap: 1px;
        margin-bottom: 3px;
    }

    .sidebar-post-date {
        font-size: 9px;
    }
}

/* Loading State */
.sidebar-posts-block.loading {
    opacity: 0.7;
    pointer-events: none;
}

.sidebar-posts-block.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.sidebar-posts-block .no-posts {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-style: italic;
}

.sidebar-posts-block .no-posts::before {
    content: '📝';
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* Hover Effects */
.sidebar-post-item {
    position: relative;
    overflow: hidden;
}

.sidebar-post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.sidebar-post-item:hover::before {
    left: 100%;
}

/* Focus States for Accessibility */
.sidebar-post-title a:focus,
.sidebar-post-thumb a:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Custom Categories Block */
.sidebar-categories-block {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
}

.sidebar-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-category-item {
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.sidebar-category-item:hover {
    border-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.sidebar-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
}

.sidebar-category-link:hover {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    color: #2c5aa0;
}

.sidebar-category-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.sidebar-category-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.sidebar-category-item:hover .sidebar-category-icon {
    transform: scale(1.1);
}

.sidebar-category-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.sidebar-category-count {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.sidebar-category-arrow {
    color: #6c757d;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.sidebar-category-item:hover .sidebar-category-arrow {
    color: #2c5aa0;
    opacity: 1;
    transform: translateX(2px);
}

.sidebar-category-arrow svg {
    width: 12px;
    height: 12px;
}

/* Categories Responsive */
@media (max-width: 768px) {
    .sidebar-categories-block {
        padding: 12px;
    }

    .sidebar-categories-list {
        gap: 6px;
    }

    .sidebar-category-link {
        padding: 10px 12px;
    }

    .sidebar-category-content {
        gap: 8px;
    }

    .sidebar-category-icon {
        font-size: 14px;
        width: 18px;
    }

    .sidebar-category-name {
        font-size: 13px;
    }

    .sidebar-category-count {
        padding: 2px 6px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .sidebar-categories-block {
        padding: 10px;
    }

    .sidebar-category-link {
        padding: 8px 10px;
    }

    .sidebar-category-content {
        gap: 6px;
    }

    .sidebar-category-name {
        font-size: 12px;
    }

    .sidebar-category-count {
        padding: 1px 5px;
        font-size: 9px;
    }
}

/* Additional styles for sidebar widget posts */
.widget-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-content .sidebar-post-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    margin-bottom: 10px;
}

.widget-content .sidebar-post-item:hover {
    background: #f8f9fa;
    border-color: #e5e5e5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.widget-content .sidebar-post-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.widget-content .sidebar-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.widget-content .sidebar-post-item:hover .sidebar-post-thumb img {
    transform: scale(1.05);
}

.widget-content .sidebar-post-content {
    flex: 1;
    min-width: 0;
}

.widget-content .sidebar-post-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;
}

.widget-content .sidebar-post-category {
    display: inline-block;
    background: #6c757d;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
    max-width: fit-content;
}

.widget-content .sidebar-post-category.category-world,
.widget-content .sidebar-post-category.category-domestic,
.widget-content .sidebar-post-category.category-news,
.widget-content .sidebar-post-category.category-currency {
    background: #fdbf30;
    color: #000;
}

.widget-content .sidebar-post-date {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.widget-content .sidebar-post-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.widget-content .sidebar-post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-content .sidebar-post-title a:hover {
    color: #2c5aa0;
}

/* Print Styles */
@media print {
    .sidebar-posts-block,
    .sidebar-categories-block {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .sidebar-post-item:hover,
    .sidebar-category-item:hover {
        background: transparent;
        transform: none;
        box-shadow: none;
    }

    .sidebar-post-thumb img {
        transform: none;
    }

    .sidebar-category-arrow {
        display: none;
    }
}
