/**
 * Общие стили для карточек
 */

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #F7F9FA;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F7F9FA;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #F7F9FA;
    color: var(--color-primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.card-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1C1D1F;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-excerpt {
    color: #6A6F73;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6A6F73;
    margin-top: auto;
}

.card-date,
.card-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-tag {
    padding: 0.25rem 0.75rem;
    background: #F7F9FA;
    color: #6A6F73;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.card-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-top: auto;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
}

.card-link:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.1);
}

.card-link svg,
.card-link .icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor !important;
    stroke: currentColor !important;
    color: currentColor !important;
}

.card-link .icon {
    width: 20px;
    height: 20px;
    margin: 0;
    fill: currentColor !important;
    stroke: currentColor !important;
    color: currentColor !important;
}

.card-link:hover svg,
.card-link:hover .icon svg {
    fill: white !important;
    stroke: white !important;
    color: white !important;
}

/* Project Card Overlay */
.card-project .card-image,
.project-card .project-image-wrapper {
    position: relative;
}

/* Project Badge для иконок GitHub/Demo в правом верхнем углу */
.card-project .project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    z-index: 2;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.card-project .project-badge a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.card-project .project-badge a:hover {
    transform: scale(1.1);
}

.card-project .project-badge svg,
.card-project .project-badge .icon svg {
    width: 16px;
    height: 16px;
    fill: #2563eb !important;
    stroke: #2563eb !important;
    color: #2563eb !important;
}

.card-project .project-badge .icon {
    width: 16px;
    height: 16px;
    margin: 0;
    fill: #2563eb !important;
    stroke: #2563eb !important;
    color: #2563eb !important;
}

.card-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-action-btn {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.card-action-btn svg,
.card-action-btn .icon svg {
    width: 13px;
    height: 13px;
    fill: currentColor !important;
    stroke: currentColor !important;
    color: currentColor !important;
}

.card-action-btn .icon {
    width: 13px;
    height: 13px;
    margin: 0;
    fill: currentColor !important;
    stroke: currentColor !important;
    color: currentColor !important;
}

.card-action-btn:hover {
    transform: scale(1.1);
    background: var(--color-primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.card-action-btn:hover svg,
.card-action-btn:hover .icon svg {
    fill: white !important;
    stroke: white !important;
    color: white !important;
}

/* Related Projects Section (для сайдбаров) */
.related-projects-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    width: 100%;
    min-width: 0;
}

.related-projects-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-projects-section h2 svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.related-projects-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
}

.related-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-project-card {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.related-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.related-project-image {
    width: 100%;
    max-width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--bg-light);
    box-sizing: border-box;
}

.related-project-image img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.related-project-card:hover .related-project-image img {
    transform: scale(1.05);
}

.related-project-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    height: 140px;
}

.related-project-image-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.related-project-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.related-project-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.related-project-content p {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    -webkit-line-clamp: none;
    -webkit-box-orient: initial;
    overflow: visible;
    hyphens: auto;
}

.related-project-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: auto;
}

.related-project-date svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Стили для сайдбаров */
.feed-sidebar,
.project-sidebar {
    width: 100%;
    min-width: 0;
}

.feed-sidebar .related-projects-section,
.project-sidebar .related-projects-section {
    width: 100%;
    min-width: 0;
}

.feed-sidebar .related-projects-list,
.project-sidebar .related-projects-list {
    width: 100%;
    min-width: 0;
}

.feed-sidebar .related-project-card,
.project-sidebar .related-project-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.feed-sidebar .related-project-content,
.project-sidebar .related-project-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.feed-sidebar .related-project-content h3,
.project-sidebar .related-project-content h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.feed-sidebar .related-project-content p,
.project-sidebar .related-project-content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.feed-sidebar .related-project-image,
.project-sidebar .related-project-image {
    width: 100%;
    max-width: 100%;
    height: 140px;
    overflow: hidden;
    box-sizing: border-box;
}

.feed-sidebar .related-project-image img,
.project-sidebar .related-project-image img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .related-projects-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .card-content {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .related-projects-list {
        grid-template-columns: 1fr;
    }
}

