/* ========== ОБЩИЕ НАСТРОЙКИ ДЛЯ РАЗДЕЛА ЗАМЕТОК ========== */
.note-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.note-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.2);
}

/* Изображение */
.note-card .blog-card-image {
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

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

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

/* Дата на изображении */
.note-card .blog-card-date {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 40px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Если нет изображения — красивая заглушка */
.note-card .blog-card-date.no-image-date {
    position: relative;
    background: linear-gradient(135deg, #2b9348, #55a630);
    color: white;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 0;
}

/* Содержимое карточки */
.note-card .blog-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Текст заметки (обрезаем красиво) */
.note-card .blog-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #334155;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Теги — мягкие и цветные */
.note-card .post-tags {
    margin-bottom: 1rem;
}

.note-card .post-tags .badge {
    background: #eef2ff;
    color: #1e293b;
    font-weight: 500;
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.7rem;
    transition: 0.2s;
}

.note-card .post-tags .badge:hover {
    background: #2b9348;
    color: white;
}

/* Ссылка на товар */
.note-card .product-link {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    background: #f8fafc;
    padding: 0.3rem 0.6rem;
    border-radius: 50px;
    display: inline-block;
    align-self: flex-start;
}

.note-card .product-link i {
    color: #2b9348;
    margin-right: 0.3rem;
}

.note-card .product-link a {
    color: #0f172a;
    text-decoration: none;
}

.note-card .product-link a:hover {
    text-decoration: underline;
    color: #2b9348;
}

/* Нижняя панель мета-данных */
.note-card .blog-card-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

/* Кнопки лайков */
.note-card .blog-card-meta-left {
    display: flex;
    gap: 0.5rem;
}

.btn-like-note, .btn-dislike-note {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 40px;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-like-note i, .btn-dislike-note i {
    margin-right: 0.3rem;
}

.btn-like-note:hover, .btn-dislike-note:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-like-note.active, .btn-dislike-note.active {
    background: #2b9348;
    border-color: #2b9348;
    color: white;
}

/* Ссылки быстрого просмотра */
.note-card .blog-card-read-more {
    font-size: 0.8rem;
    white-space: nowrap;
}

.note-card .blog-card-read-more a {
    color: #2b9348;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.note-card .blog-card-read-more a:hover {
    text-decoration: underline;
    color: #1f5f36;
}

/* ========== СТРАНИЦА ОТДЕЛЬНОЙ ЗАМЕТКИ ========== */
.post-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #1e293b;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content video {
    border-radius: 20px;
    margin: 1.5rem 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Блок с товаром */
.alert-success {
    background: #e9f7ef;
    border-color: #2b9348;
    border-radius: 16px;
    color: #14532d;
}

.alert-success a {
    font-weight: 600;
    text-decoration: underline;
}

/* Кнопки лайков на странице */
.post-actions .btn {
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal-content {
    border-radius: 28px;
    border: none;
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: #fafcff;
    padding: 1.2rem 1.5rem;
}

.modal-body {
    padding: 1.8rem;
}

.note-modal-content img,
.note-modal-content video {
    border-radius: 20px;
    margin-bottom: 1.2rem;
}

.note-modal-content .note-quote {
    font-size: 1rem;
    line-height: 1.65;
    color: #1e293b;
    white-space: pre-wrap;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .note-card .blog-card-content {
        padding: 1rem;
    }

    .note-card .blog-card-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }

    .note-card .blog-card-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .note-card .blog-card-read-more {
        white-space: normal;
    }

    .btn-like-note, .btn-dislike-note {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .note-card .blog-card-image {
        height: 160px;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* ---------------------------------------------------------------------------- */

/* ===== ВЫРАВНИВАНИЕ КАРТОЧЕК ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.note-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.note-card .blog-card-image {
    height: 240px; /* фиксированная высота для вертикальных картинок */
    background: #f1f5f9;
}

.note-card .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* картинка заполняет блок без искажений */
    object-position: center;
}

/* Если картинки нет, даём заглушке такую же высоту */
.note-card .blog-card-date.no-image-date {
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-card .blog-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.note-card .blog-card-excerpt {
    flex: 1; /* чтобы текст занимал доступное место, а мета-блок прижимался вниз */
}

/* Hero для заметок – свой оттенок зелёного */
.notes-hero {
    background: linear-gradient(135deg, #1e5a3a, #2b9348);
    margin-top: -80px; /* компенсирует фиксированный хедер */
    padding: 100px 0 60px;
    border-bottom: none;
}

.notes-hero .hero-stats .badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #1e5a3a;
}

/* ===== САЙДБАР ДЛЯ ЗАМЕТОК ===== */
.sidebar-widget {
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.sidebar-widget h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #1e5a3a;
    border-left: 4px solid #2b9348;
    padding-left: 0.75rem;
}

/* Популярные заметки */
.popular-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-post-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eef2ff;
}

.popular-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-post-image {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex: 1;
}

.popular-post-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.popular-post-title a {
    color: #0f172a;
    text-decoration: none;
    transition: 0.2s;
}

.popular-post-title a:hover {
    color: #2b9348;
}

.popular-post-meta {
    font-size: 0.7rem;
    color: #64748b;
}

.popular-post-meta i {
    margin-right: 0.25rem;
}