/* ==========================================================================
   1. BỘ LỌC AJAX (FILTER BAR)
   ========================================================================== */
.mc-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 50px;
    background: #fff;
    padding: 10px 0;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.mc-filter-bar input[type="text"],
.mc-filter-bar select {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: 2px solid transparent;
    background-color: #f2f4f7;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.mc-filter-bar input[type="text"]:focus,
.mc-filter-bar select:focus {
    background-color: #fff;
    border-color: #ffde59;
    box-shadow: 0 0 0 4px rgba(255, 222, 89, 0.1);
}

.mc-filter-bar button {
    background-color: #ffde59;
    color: #2d3436;
    border: none;
    padding: 0 35px;
    height: 52px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mc-filter-bar button:hover {
    background-color: #f9d233;
    transform: translateY(-2px);
}

/* ==========================================================================
   2. LƯỚI BÀI VIẾT (GRID)
   ========================================================================== */
.mc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

.mc-grid article img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.meta-date {
    font-size: 13px;
    color: #e67e22;
    display: block;
    margin-bottom: 8px;
}

.mc-grid h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
}

.mc-grid h3 a {
    text-decoration: none;
    color: #003366;
}

/* ==========================================================================
   3. TRANG CHI TIẾT (SINGLE PAGE)
   ========================================================================== */
.mc-document-wrapper {
    display: flex;
    gap: 50px;
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.mc-document-sidebar {
    flex: 1;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    height: fit-content;
}

.sidebar-title {
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #ffde59;
    padding-bottom: 10px;
    font-size: 20px;
}

.mc-detail-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.mc-detail-item:last-child {
    border-bottom: none;
}

.mc-detail-item strong {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.mc-detail-item span {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.mc-document-content {
    flex: 2.5;
}

.document-title {
    margin-top: 0;
    font-size: 32px;
    color: #003366;
}

.entry-content {
    line-height: 1.7;
    font-size: 16px;
    color: #444;
    margin-bottom: 40px;
}

/* --- FIX NÚT TẢI VỀ --- */
.mc-file-box {
    background: #f2f4f7;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Giữ nút nằm giữa theo chiều dọc */
    margin-top: 15px;
    gap: 20px;
    transition: background 0.2s;
}

.mc-file-box:hover {
    background: #e8ebf0;
}

.file-name {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    /* Để text chiếm không gian và tự xuống dòng */
    word-break: break-all;
    /* Ngắt dòng link dài để không đẩy nút */
    line-height: 1.4;
}

.mc-download-btn {
    background: #003366;
    color: #fff !important;
    padding: 10px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    flex-shrink: 0;
    /* KHÔNG cho phép nút bị co bóp */
    white-space: nowrap;
    /* ÉP chữ nằm trên 1 dòng */
    display: inline-block;
    height: fit-content;
}

.mc-download-btn:hover {
    background: #002244;
    transform: translateY(-1px);
}

/* ==========================================================================
   4. RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .mc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mc-document-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .mc-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .mc-grid {
        grid-template-columns: 1fr;
    }

    .mc-file-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .mc-download-btn {
        width: 100%;
        margin-top: 10px;
    }
}